Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###_[贸易优化debug] <季度debug/初始化/设置完成> 参数统计/添加修正
- z_pf2_eft_cntr_trade_opt_debug = {
- if = {
- limit = {
- is_gestalt = no
- OR = {
- has_global_flag = z_pf2_flg_glbl_trade_ban #_[贸易禁止]
- AND = { is_ai = yes has_global_flag = z_pf2_flg_glbl_trade_opt } #_[贸易优化]
- }
- }
- every_owned_planet = {
- ###_[参数统计] init/人口/人力/贸易增值/贸易乘数/贸易权重/最值限定
- #_[init]
- set_variable = { which = z_pf2_var_plnt_trade_value_final value = 0 }
- #_[人口]
- # set_variable = { which = z_pf2_var_plnt_trade_value_pop value = 0 }
- # export_trigger_value_to_variable = { trigger = num_pops variable = z_pf2_var_plnt_trade_value_pop rounded = yes } #_[人口统计]
- # multiply_variable = { which = z_pf2_var_plnt_trade_value_pop value = 0.5 } #_[人口权重]
- # change_variable = { which = z_pf2_var_plnt_trade_value_final value = z_pf2_var_plnt_trade_value_pop }
- # clear_variable = z_pf2_var_plnt_trade_value_pop
- #_[人力]
- # change_variable = { which = z_pf2_var_plnt_trade_value_manpower value = 产业革命人力 } #_[产业革命]
- # multiply_variable = { which = z_pf2_var_plnt_trade_value_manpower value = 0.5 } #_[人力权重]
- # change_variable = { which = z_pf2_var_plnt_trade_value_final value = z_pf2_var_plnt_trade_value_manpower }
- # clear_variable = z_pf2_var_plnt_trade_value_manpower
- #_[贸易增值]
- export_modifier_to_variable = { modifier = trade_value_add variable = z_pf2_var_plnt_trade_value_add }
- change_variable = { which = z_pf2_var_plnt_trade_value_final value = z_pf2_var_plnt_trade_value_add }
- clear_variable = z_pf2_var_plnt_trade_value_add
- #_[贸易乘数]
- export_modifier_to_variable = { modifier = trade_value_mult variable = z_pf2_var_plnt_trade_value_mult }
- change_variable = { which = z_pf2_var_plnt_trade_value_mult value = 1 }
- multiply_variable = { which = z_pf2_var_plnt_trade_value_final value = z_pf2_var_plnt_trade_value_mult }
- clear_variable = z_pf2_var_plnt_trade_value_mult
- #_[贸易权重]
- multiply_variable = { which = z_pf2_var_plnt_trade_value_final value = { scope = event_target:z_fw_tgt_global_event variable = z_pf2_var_npc0_trade_weight_set } }
- #_[最值限定]
- if = { limit = { check_variable = { which = z_pf2_var_plnt_trade_value_final value < 0 } } set_variable = { which = z_pf2_var_plnt_trade_value_final value = 0 } }
- #_[四舍五入]
- round_variable = z_pf2_var_plnt_trade_value_final
- ###_[添加修正] 工整传统/vanilla
- #_[工整传统] 电/矿/食/科研/合金/消费/合金消费/凝聚/贸易联盟/颗粒/天然气/水晶/战略/活金属/泽洛/暗物质
- if = { limit = { has_global_flag = tidy_tradition_active }
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_1e
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_1m
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_1f
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_rr
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_2a
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_2c
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_2ac
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_ru
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_league
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_3vm
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_3eg
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_3rc
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_3all
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_srlm
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_srzro
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_srdm
- if = {#_[矿]
- limit = { owner = { has_policy_flag = trade_conversion_minerals } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_1m
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[食]
- limit = { owner = { has_policy_flag = trade_conversion_food } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_1f
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[科研]
- limit = { owner = { has_policy_flag = trade_conversion_research } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_rr
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[合金]
- limit = { owner = { has_policy_flag = trade_conversion_alloys } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_2a
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[消费]
- limit = { owner = { has_policy_flag = trade_conversion_consumer_goods } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_2c
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[合金消费]
- limit = { owner = { has_policy_flag = trade_conversion_alloys_and_consumer_goods } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_2ac
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[凝聚]
- limit = { owner = { has_policy_flag = trade_conversion_unity } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_ru
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[贸易联盟]
- limit = { owner = { has_policy_flag = trade_conversion_trade_league } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_league
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[颗粒]
- limit = { owner = { has_policy_flag = trade_conversion_volatile_motes } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_3vm
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[天然气]
- limit = { owner = { has_policy_flag = trade_conversion_exotic_gases } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_3eg
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[水晶]
- limit = { owner = { has_policy_flag = trade_conversion_rare_crystals } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_3rc
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[战略]
- limit = { owner = { has_policy_flag = trade_conversion_advanced_resources } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_3all
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[活金属]
- limit = { owner = { has_policy_flag = trade_conversion_sr_living_metal } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_srlm
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[泽洛]
- limit = { owner = { has_policy_flag = trade_conversion_sr_zro } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_srzro
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[暗物质]
- limit = { owner = { has_policy_flag = trade_conversion_sr_dark_matter } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_srdm
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else = {#_[电]
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_1e
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- }
- #_[vanilla] 消费品/凝聚/联盟/普通
- else = {
- remove_modifier = z_pf2_mod_plnt_trade_opt_goods
- remove_modifier = z_pf2_mod_plnt_trade_opt_unity
- remove_modifier = z_pf2_mod_plnt_trade_opt_league
- remove_modifier = z_pf2_mod_plnt_trade_opt_normal
- if = {#_[消费品]
- limit = { owner = { has_policy_flag = trade_conversion_consumer_goods } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_goods
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[凝聚]
- limit = { owner = { has_policy_flag = trade_conversion_unity } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_unity
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else_if = {#_[联盟]
- limit = { owner = { has_policy_flag = trade_conversion_trade_league } }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_league
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- else = {#_[普通]
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_normal
- days = 97
- multiplier = z_pf2_var_plnt_trade_value_final
- clear_on_owner_change = yes
- }
- }
- }
- }
- set_variable = {
- which = z_pf2_var_body_trade_value_tally
- value = 0
- }
- every_planet_within_border = {
- limit = {
- is_colony = no
- }
- export_modifier_to_variable = {
- modifier = trade_value_add
- variable = z_pf2_var_body_trade_value_tally
- }
- root = {
- change_variable = {
- which = z_pf2_var_body_trade_value_tally
- value = prev
- }
- }
- }
- export_modifier_to_variable = { modifier = trade_value_mult variable = z_pf2_var_body_trade_value_tally_mult }
- change_variable = { which = z_pf2_var_body_trade_value_tally_mult value = 1 }
- multiply_variable = { which = z_pf2_var_body_trade_value_tally value = z_pf2_var_body_trade_value_tally_mult }
- clear_variable = z_pf2_var_body_trade_value_tally_mult
- multiply_variable = { which = z_pf2_var_body_trade_value_tally value = { scope = event_target:z_fw_tgt_global_event variable = z_pf2_var_npc0_trade_weight_set } }
- round_variable = z_pf2_var_body_trade_value_tally
- ###_[添加修正] 工整传统/vanilla
- #_[工整传统] 电/矿/食/科研/合金/消费/合金消费/凝聚/贸易联盟/颗粒/天然气/水晶/战略/活金属/泽洛/暗物质
- if = { limit = { has_global_flag = tidy_tradition_active }
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_1e
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_1m
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_1f
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_rr
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_2a
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_2c
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_2ac
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_ru
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_league
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_3vm
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_3eg
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_3rc
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_3all
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_srlm
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_srzro
- remove_modifier = z_pf2_mod_plnt_trade_opt_tt_srdm
- if = {#_[矿]
- limit = { has_policy_flag = trade_conversion_minerals }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_1m
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[食]
- limit = { has_policy_flag = trade_conversion_food }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_1f
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[科研]
- limit = { has_policy_flag = trade_conversion_research }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_rr
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[合金]
- limit = { has_policy_flag = trade_conversion_alloys }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_2a
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[消费]
- limit = { has_policy_flag = trade_conversion_consumer_goods }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_2c
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[合金消费]
- limit = { has_policy_flag = trade_conversion_alloys_and_consumer_goods }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_2ac
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[凝聚]
- limit = { has_policy_flag = trade_conversion_unity }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_ru
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[贸易联盟]
- limit = { has_policy_flag = trade_conversion_trade_league }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_league
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[颗粒]
- limit = { has_policy_flag = trade_conversion_volatile_motes }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_3vm
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[天然气]
- limit = { has_policy_flag = trade_conversion_exotic_gases }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_3eg
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[水晶]
- limit = { has_policy_flag = trade_conversion_rare_crystals }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_3rc
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[战略]
- limit = { has_policy_flag = trade_conversion_advanced_resources }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_3all
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[活金属]
- limit = { has_policy_flag = trade_conversion_sr_living_metal }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_srlm
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[泽洛]
- limit = { has_policy_flag = trade_conversion_sr_zro }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_srzro
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[暗物质]
- limit = { has_policy_flag = trade_conversion_sr_dark_matter }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_srdm
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else = {#_[电]
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_tt_1e
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- }
- #_[vanilla] 消费品/凝聚/联盟/普通 #_[消费品]
- else = {
- remove_modifier = z_pf2_mod_plnt_trade_opt_goods
- remove_modifier = z_pf2_mod_plnt_trade_opt_unity
- remove_modifier = z_pf2_mod_plnt_trade_opt_league
- remove_modifier = z_pf2_mod_plnt_trade_opt_normal
- if = {
- limit = { has_policy_flag = trade_conversion_consumer_goods }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_goods
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[凝聚]
- limit = { has_policy_flag = trade_conversion_unity }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_unity
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else_if = {#_[联盟]
- limit = { has_policy_flag = trade_conversion_trade_league }
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_league
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- else = {#_[普通]
- add_modifier = {
- modifier = z_pf2_mod_plnt_trade_opt_normal
- days = 97
- multiplier = z_pf2_var_body_trade_value_tally
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment