# Author(s): AngriestBird scripted_diplomatic_actions = { ##Yard1's Recall Volunteers mod integrated :D recall_volunteers = { allowed = { has_game_rule = { rule = allow_recall_intervention_forces option = yes } ROOT = { is_ai = no } } visible = { has_volunteers_amount_from = { tag = ROOT count > 0 } } selectable = { # doing this for nicer tooltips if = { limit = { NOT = { has_volunteers_amount_from = { tag = ROOT count > 0 } } } custom_trigger_tooltip = { tooltip = RECALL_VOLUNTEERS_TOOLTIP always = no } } else = { custom_trigger_tooltip = { tooltip = RECALL_VOLUNTEERS_TOOLTIP_G always = yes } } } cost = 50 command_power = 15 requires_acceptance = no show_acceptance_on_action_button = no icon = 1 send_description = RECALL_VOLUNTEERS_SEND_DESC complete_effect = { ROOT = { recall_volunteers_from = PREV } } } # Trade Agreements propose_improved_trade_agreement = { visible = { NOT = { has_country_flag = trade_agreement@ROOT } } selectable = { custom_trigger_tooltip = { tooltip = PROPOSE_TRADE_AGREEMENT_TOOLTIP NOT = { has_country_flag = trade_agreement@ROOT } } if = { limit = { ROOT = { NOT = { has_idea = EU_member } } tag = SWI } NOT = { has_war_with = ROOT } has_opinion = { target = ROOT value > 50 } } else = { NOT = { has_war_with = ROOT } has_opinion = { target = ROOT value > 10 } } if = { limit = { is_in_faction = yes any_allied_country = { exists = yes } } # Do not ally your enemies friends any_allied_country = { NOT = { has_war_with = ROOT } } } embassy_with_root_closed = no ERI_is_not_transitional_government = yes } cost = 75 requires_acceptance = yes show_acceptance_on_action_button = yes icon = 20 send_description = PROPOSE_TRADE_AGREEMENT_DESC on_sent_effect = { ROOT = { set_variable = { pending_trade_offer_country = PREV.id } } } complete_effect = { set_country_flag = trade_agreement@ROOT ROOT = { clear_variable = pending_trade_offer_country set_country_flag = trade_agreement@PREV if = { limit = { original_tag = SIN } add_to_array = { SIN_singaporean_trade_agreement = PREV.id } } if = { limit = { has_dlc = "By Blood Alone" } if = { limit = { is_embargoing = PREV } break_embargo = PREV } if = { limit = { PREV = { is_embargoing = ROOT } } PREV = { break_embargo = ROOT } } } } add_opinion_modifier = { target = ROOT modifier = mutual_trade_agreement } add_opinion_modifier = { target = ROOT modifier = mutual_trade_opinion } reverse_add_opinion_modifier = { target = ROOT modifier = mutual_trade_opinion } reverse_add_opinion_modifier = { target = ROOT modifier = mutual_trade_agreement } set_temp_variable = { percent_change = 1 } set_temp_variable = { tag_index = ROOT.id } set_temp_variable = { influence_target = THIS.id } change_influence_percentage = yes add_to_variable = { signed_trade_agreements = 1 } if = { limit = { original_tag = SIN } add_to_array = { SIN_singaporean_trade_agreement = ROOT.id } } ROOT = { set_temp_variable = { percent_change = 1 } set_temp_variable = { tag_index = PREV.id } set_temp_variable = { influence_target = THIS.id } change_influence_percentage = yes add_to_variable = { signed_trade_agreements = 1 } if = { limit = { ROOT = { original_tag = SIN } } SIN_calculate_singaporean_trade_agreements = yes } } } reject_effect = { ROOT = { clear_variable = pending_trade_offer_country set_country_flag = { flag = rejected_trade_agreement_@PREV days = 180 value = 1 } } set_country_flag = { flag = rejected_trade_agreement_@ROOT days = 180 value = 1 } add_opinion_modifier = { target = ROOT modifier = reject_trade_agreement } reverse_add_opinion_modifier = { target = ROOT modifier = reject_trade_agreement } } accept_title = PROPOSE_TRADE_AGREEMENT_ACCEPT_TT accept_description = PROPOSE_TRADE_AGREEMENT_ACCEPT_DESC reject_title = PROPOSE_TRADE_AGREEMENT_REJECT_TT reject_description = PROPOSE_TRADE_AGREEMENT_REJECT_DESC ai_acceptance = { base_trade_condition = { base = -25 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } modifier = { ROOT = { has_country_flag = italy_china_trade_deal } has_country_flag = italy_china_trade_deal add = 50 } } condition_two = { base = 0 modifier = { add = 5 has_government = ROOT } modifier = { add = -50 has_government = nationalist } } condition_three = { base = 0 modifier = { check_opinion_calculation = yes add = opinion_calculator } modifier = { add = -50 has_country_flag = has_recently_canceled_trade_agreement_@ROOT } } condition_four = { base = 0 modifier = { ROOT = { has_idea = NATO_member } has_idea = NATO_member add = 10 } } condition_five = { base = 0 modifier = { OR = { has_idea = EU_member tag = SWI } ROOT = { has_idea = EU_member } add = 15 } } condition_six = { base = 0 modifier = { ROOT = { is_in_faction_with = PREV } add = 10 } } condition_seven = { base = 0 modifier = { add = 10 is_subject_of = ROOT } } condition_eight = { base = 0 modifier = { add = 5 influence_higher_10 = yes } modifier = { add = 5 influence_higher_20 = yes } modifier = { add = 5 influence_higher_30 = yes } modifier = { add = 5 influence_higher_40 = yes } modifier = { add = 5 influence_higher_50 = yes } modifier = { add = 5 influence_higher_60 = yes } } } ai_desire = { base = 25 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } modifier = { add = 5 ROOT = { has_opinion = { target = PREV value > 0 } } } modifier = { add = 5 ROOT = { has_opinion = { target = PREV value > 25 } } } modifier = { add = 10 ROOT = { has_opinion = { target = PREV value > 50 } } } modifier = { ROOT = { original_tag = SOV } has_idea = NATO_member add = -5 } modifier = { ROOT = { is_in_faction_with = PREV } add = 10 } modifier = { ROOT = { has_idea = EU_member } has_idea = EU_member add = 8 } modifier = { ROOT = { has_idea = NATO_member } has_idea = NATO_member add = 8 } modifier = { ROOT = { is_guaranteed_by = PREV } add = 5 } modifier = { add = 5 is_subject_of = ROOT } modifier = { add = 5 is_influencer = yes } modifier = { add = 5 is_top3_influencer = yes } modifier = { factor = 1.10 ROOT = { has_political_power > 499 } } modifier = { add = -15 date < 2000.6.1 } modifier = { add = -25 ROOT = { OR = { has_idea = non_power has_idea = minor_power } } } modifier = { add = -25 ROOT = { is_on_same_continent_as = PREV OR = { has_idea = non_power has_idea = minor_power has_idea = regional_power } } } modifier = { add = 5 ROOT = { is_on_same_continent_as = PREV } } # Graduated economic gates modifier = { factor = 0.5 check_variable = { ROOT.interest_rate > 6 } } modifier = { factor = 0.5 check_variable = { ROOT.interest_rate > 8 } } modifier = { factor = 0.5 ROOT = { has_political_power < 250 } } modifier = { factor = 0 ROOT = { OR = { check_variable = { ROOT.interest_rate > 12 } has_political_power < 100 has_active_mission = bankruptcy_incoming_collapse NOT = { check_variable = { pending_trade_offer_country = 0 } } has_country_flag = rejected_trade_agreement_@PREV has_country_flag = has_recently_canceled_trade_agreement_@PREV } } } modifier = { factor = 0 ROOT = { OR = { any_enemy_country = { is_in_faction_with = PREV.PREV } any_allied_country = { has_war_with = PREV.PREV } } } } # Geopolitical: USA-CHI softened, NKO pairs hard blocked modifier = { factor = 0.05 OR = { AND = { ROOT = { tag = CHI } tag = USA } AND = { ROOT = { tag = USA } tag = CHI } } } modifier = { factor = 0 OR = { AND = { ROOT = { tag = NKO } tag = KOR } AND = { ROOT = { tag = KOR } tag = NKO } AND = { ROOT = { tag = JAP } tag = NKO } AND = { ROOT = { tag = NKO } tag = JAP } } } } } cancel_trade_agreement = { visible = { has_country_flag = trade_agreement@ROOT } selectable = { custom_trigger_tooltip = { tooltip = CANCEL_TRADE_AGREEMENT_TOOLTIP has_country_flag = trade_agreement@ROOT } ERI_is_not_transitional_government = yes } cost = 75 can_be_sent = { always = yes } show_acceptance_on_action_button = no requires_acceptance = no icon = 17 send_description = CANCEL_TRADE_AGREEMENT_DESC complete_effect = { remove_opinion_modifier = { target = ROOT modifier = mutual_trade_agreement } remove_opinion_modifier = { target = ROOT modifier = mutual_trade_opinion } clr_country_flag = trade_agreement@ROOT set_temp_variable = { percent_change = -1.25 } set_temp_variable = { tag_index = ROOT.id } set_temp_variable = { influence_target = THIS.id } change_influence_percentage = yes add_to_variable = { signed_trade_agreements = -1 } set_country_flag = { flag = has_recently_canceled_trade_agreement_@ROOT days = 90 value = 1 } ROOT = { remove_opinion_modifier = { target = PREV modifier = mutual_trade_agreement } remove_opinion_modifier = { target = PREV modifier = mutual_trade_opinion } add_opinion_modifier = { target = PREV modifier = broke_trade_agreement } clr_country_flag = trade_agreement@PREV set_temp_variable = { percent_change = -1.25 } set_temp_variable = { tag_index = PREV.id } set_temp_variable = { influence_target = THIS.id } change_influence_percentage = yes add_to_variable = { signed_trade_agreements = -1 } if = { limit = { ROOT = { original_tag = SIN } } SIN_calculate_singaporean_trade_agreements = yes } } add_opinion_modifier = { target = ROOT modifier = broke_trade_agreement } } ai_desire = { base = 1 modifier = { ROOT = { has_opinion = { target = PREV value < 0 } } add = 25 } modifier = { ROOT = { has_opinion = { target = PREV value < -25 } } add = 25 } modifier = { ROOT = { has_opinion = { target = PREV value < -50 } } add = 25 } modifier = { ROOT = { has_opinion = { target = PREV value < -75 } } add = 100 } modifier = { ROOT = { any_enemy_country = { is_in_faction_with = PREV.PREV } } add = 100 } modifier = { ROOT = { has_war_with = PREV } add = 100 } modifier = { factor = 0 is_in_faction_with = ROOT } modifier = { factor = 0 ROOT = { has_opinion = { target = PREV value > 25 } } NOT = { has_war_with = ROOT } } modifier = { factor = 1.10 ROOT = { has_political_power > 499 } } modifier = { factor = 0.50 ROOT = { has_political_power < 450 } } modifier = { factor = 0.5 ROOT = { has_political_power < 100 } } } } # Assume Debt diplo_action_assume_debt = { selectable = { if = { limit = { NOT = { is_subject_of = ROOT } } #selected country has lower GDP/C than us custom_trigger_tooltip = { check_expr = { value = ROOT.gdp_total multiply = 2 greater_than = { value = THIS.gdp_total } } tooltip = gdp_total_cannot_be_double_ours } gdp_debt_ratio_higher_25 = yes ROOT = { gdp_debt_ratio_lower_75 = yes } NOT = { has_war_with = ROOT } } has_opinion = { target = ROOT value > 49 } if = { limit = { is_in_faction = yes } any_allied_country = { NOT = { has_war_with = ROOT } } } custom_trigger_tooltip = { set_temp_variable = { tmp = { value = debt multiply = 0.25 } } tooltip = treasury_more_than_25_debt_tt } embassy_with_root_closed = no ERI_is_not_transitional_government = yes } cost = 75 requires_acceptance = yes show_acceptance_on_action_button = yes icon = 21 send_description = DIPLO_ACTION_ASSUME_DEBT_DESC on_sent_effect = { set_variable = { ROOT.assuming_debt_value = THIS.debt } multiply_variable = { ROOT.assuming_debt_value = 0.25 } ROOT = { set_variable = { pending_assume_debt_offer = PREV.id } if = { limit = { is_ai = yes } set_country_flag = { flag = AI_recently_sent_debt_assumption_offer_@PREV value = 1 days = 90 } } } } complete_effect = { ROOT = { clear_variable = pending_assume_debt_offer subtract_from_variable = { treasury = assuming_debt_value } ingame_update_setup = yes } subtract_from_variable = { debt = ROOT.assuming_debt_value } ingame_update_setup = yes ROOT = { clear_variable = assuming_debt_value } } reject_effect = { ROOT = { clear_variable = pending_assume_debt_offer clear_variable = assuming_debt_value } add_opinion_modifier = { target = ROOT modifier = reject_assuming_debt } reverse_add_opinion_modifier = { target = ROOT modifier = reject_assuming_debt } } accept_title = DIPLO_ACTION_ASSUME_DEBT_ACCEPT accept_description = DIPLO_ACTION_ASSUME_DEBT_ACCEPT_DESC reject_title = DIPLO_ACTION_ASSUME_DEBT_REJECT reject_description = DIPLO_ACTION_ASSUME_DEBT_REJECT_DESC ai_acceptance = { base_assume_debt_condition = { base = -50 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } } condition_two = { base = 0 modifier = { add = 5 has_government = ROOT } modifier = { add = -50 has_government = nationalist } } condition_three = { base = 0 modifier = { check_opinion_calculation = yes add = opinion_calculator } } condition_four = { base = 0 modifier = { ROOT = { has_idea = NATO_member } has_idea = NATO_member add = 10 } } condition_five = { base = 0 modifier = { OR = { has_idea = EU_member tag = SWI } ROOT = { has_idea = EU_member } add = 15 } } condition_six = { base = 0 modifier = { ROOT = { is_in_faction_with = PREV } add = 10 } } condition_seven = { base = 0 modifier = { add = 15 is_subject_of = ROOT } } condition_eight = { base = 0 modifier = { add = 5 influence_higher_10 = yes } modifier = { add = 5 influence_higher_20 = yes } modifier = { add = 5 influence_higher_30 = yes } modifier = { add = 5 influence_higher_40 = yes } modifier = { add = 5 influence_higher_50 = yes } modifier = { add = 5 influence_higher_60 = yes } } condition_nine = { base = 0 modifier = { set_temp_variable = { temp_interest_rate = { value = interest_rate multiply = 2 } } check_variable = { temp_interest_rate > 0.8 } add = temp_interest_rate } } } ai_desire = { base = 20 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } modifier = { ROOT = { has_opinion = { target = PREV value > 49 } } add = 5 } modifier = { ROOT = { has_opinion = { target = PREV value > 75 } } add = 10 } modifier = { ROOT = { has_opinion = { target = PREV value > 99 } } add = 5 } modifier = { ROOT = { is_in_faction_with = PREV } add = 10 } modifier = { ROOT = { has_idea = EU_member } has_idea = EU_member add = 8 } modifier = { ROOT = { has_idea = NATO_member } has_idea = NATO_member add = 8 } modifier = { ROOT = { is_guaranteed_by = PREV } add = 5 } modifier = { add = 5 is_subject_of = ROOT } # Geopolitical: USA-CHI softened, NKO pairs hard blocked modifier = { factor = 0.05 OR = { AND = { ROOT = { tag = CHI } tag = USA } AND = { ROOT = { tag = USA } tag = CHI } } } modifier = { factor = 0 OR = { AND = { ROOT = { tag = NKO } tag = KOR } AND = { ROOT = { tag = KOR } tag = NKO } AND = { ROOT = { tag = JAP } tag = NKO } AND = { ROOT = { tag = NKO } tag = JAP } } } # Same-tier power: softened from hard block modifier = { factor = 0.3 OR = { AND = { ROOT = { has_idea = non_power } has_idea = non_power } AND = { ROOT = { has_idea = minor_power } has_idea = minor_power } AND = { ROOT = { has_idea = regional_power } has_idea = regional_power } } } # Small nations as target: keep hard block modifier = { factor = 0 OR = { has_idea = non_power has_idea = minor_power } } # Upward-tier: softened from hard block modifier = { factor = 0.1 OR = { AND = { ROOT = { has_idea = regional_power } OR = { has_idea = large_power has_idea = great_power has_idea = super_power } } AND = { ROOT = { has_idea = large_power } OR = { has_idea = great_power has_idea = super_power } } AND = { ROOT = { has_idea = great_power } has_idea = super_power } } } modifier = { ROOT = { OR = { any_enemy_country = { is_in_faction_with = PREV.PREV } any_allied_country = { has_war_with = PREV.PREV } } } factor = 0 } modifier = { factor = 1.25 ROOT = { has_idea = regional_power } OR = { has_idea = minor_power has_idea = non_power } } modifier = { factor = 1.25 ROOT = { has_idea = large_power } OR = { has_idea = regional_power has_idea = minor_power has_idea = non_power } } modifier = { factor = 1.25 ROOT = { has_idea = great_power } OR = { has_idea = large_power has_idea = regional_power has_idea = minor_power has_idea = non_power } } modifier = { factor = 1.25 ROOT = { has_idea = super_power } OR = { has_idea = great_power has_idea = large_power has_idea = regional_power has_idea = minor_power has_idea = non_power } } modifier = { factor = 1.10 ROOT = { has_political_power > 499 } } modifier = { factor = 0.25 check_variable = { ROOT.debt_ratio > 0.8 } } modifier = { factor = 0.25 check_variable = { ROOT.debt_ratio > 1.0 } } modifier = { factor = 0.25 check_variable = { ROOT.debt_ratio > 1.2 } } modifier = { factor = 0.90 check_variable = { ROOT.interest_rate > THIS.interest_rate } } modifier = { factor = 0 check_expr = { value = 0 add = { value = debt multiply = 0.25 add = ROOT.debt } divide = ROOT.gdp_total multiply = 10 add = ROOT.modifier@interest_rate_multiplier_modifier greater_than = { value = 7.99 } } } # Graduated economic gates modifier = { factor = 0.5 check_variable = { ROOT.interest_rate > 6 } } modifier = { factor = 0.5 check_variable = { ROOT.interest_rate > 8 } } modifier = { factor = 0 check_variable = { ROOT.interest_rate > 10 } } modifier = { factor = 0.5 ROOT = { has_political_power < 250 } } modifier = { factor = 0 ROOT = { has_political_power < 100 } } modifier = { factor = 0 ROOT = { NOT = { has_country_flag = AI_recently_sent_debt_assumption_offer_@PREV } } } modifier = { factor = 0 ROOT = { NOT = { check_variable = { pending_assume_debt_offer = 0 } } } } } } # Form a Mutual Investment Treaty propose_mutual_investment_treaty = { visible = { NOT = { has_country_flag = mutual_investment_treaty_@ROOT } } selectable = { custom_trigger_tooltip = { tooltip = PROPOSE_MUTUAL_INVESTMENT_TREATY_TOOLTIP NOT = { has_country_flag = mutual_investment_treaty_@ROOT } } NOT = { has_war_with = ROOT } has_opinion = { target = ROOT value > 25 } if = { limit = { is_in_faction = yes any_allied_country = { exists = yes } } # Do not ally your enemies friends any_allied_country = { NOT = { has_war_with = ROOT } } } embassy_with_root_closed = no ERI_is_not_transitional_government = yes } cost = 75 requires_acceptance = yes show_acceptance_on_action_button = yes icon = 25 send_description = DIPLO_ACTION_PROPOSE_MUTUAL_INVESTMENT_TREATY on_sent_effect = { ROOT = { set_variable = { pending_mutual_investment_treaty_offer = PREV.id } } } complete_effect = { set_country_flag = mutual_investment_treaty_@ROOT ROOT = { clear_variable = pending_mutual_investment_treaty_offer set_country_flag = mutual_investment_treaty_@PREV } add_opinion_modifier = { target = ROOT modifier = mutual_investment_treaty_opinion } add_opinion_modifier = { target = ROOT modifier = mutual_investment_treaty_trade_opinion } reverse_add_opinion_modifier = { target = ROOT modifier = mutual_investment_treaty_opinion } reverse_add_opinion_modifier = { target = ROOT modifier = mutual_investment_treaty_trade_opinion } set_temp_variable = { percent_change = 1 } set_temp_variable = { tag_index = ROOT.id } set_temp_variable = { influence_target = THIS.id } change_influence_percentage = yes # Permanent Investment Targets set_temp_variable = { target_nation = THIS.id } set_temp_variable = { adding_nation = ROOT.id } change_permanent_investment_target = yes ROOT = { set_temp_variable = { percent_change = 1 } set_temp_variable = { tag_index = PREV.id } set_temp_variable = { influence_target = THIS.id } change_influence_percentage = yes # Permanent Investment Targets set_temp_variable = { target_nation = THIS.id } set_temp_variable = { adding_nation = PREV.id } change_permanent_investment_target = yes if = { limit = { has_dlc = "By Blood Alone" } if = { limit = { is_embargoing = PREV } break_embargo = PREV } if = { limit = { PREV = { is_embargoing = ROOT } } PREV = { break_embargo = ROOT } } } } } reject_effect = { ROOT = { clear_variable = pending_mutual_investment_treaty_offer } add_opinion_modifier = { target = ROOT modifier = reject_mutual_investment_treaty } reverse_add_opinion_modifier = { target = ROOT modifier = reject_mutual_investment_treaty } } accept_title = DIPLO_ACTION_PROPOSE_MUTUAL_INVESTMENT_TREATY_ACCEPT accept_description = DIPLO_ACTION_PROPOSE_MUTUAL_INVESTMENT_TREATY_ACCEPT_DESC reject_title = DIPLO_ACTION_PROPOSE_MUTUAL_INVESTMENT_TREATY_REJECT reject_description = DIPLO_ACTION_PROPOSE_MUTUAL_INVESTMENT_TREATY_REJECT_DESC ai_acceptance = { base_mutual_investment_treaty_condition = { base = -25 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } modifier = { ROOT = { has_country_flag = italy_china_trade_deal } has_country_flag = italy_china_trade_deal add = 40 } } condition_two = { base = 0 modifier = { add = 5 has_government = ROOT } modifier = { add = -50 has_government = nationalist } } condition_three = { base = 0 modifier = { check_opinion_calculation = yes add = opinion_calculator } modifier = { add = -50 has_country_flag = has_recently_canceled_mif_treaty_@ROOT } } condition_four = { base = 0 modifier = { ROOT = { has_idea = NATO_member } has_idea = NATO_member add = 10 } } condition_five = { base = 0 modifier = { OR = { has_idea = EU_member tag = SWI } ROOT = { has_idea = EU_member } add = 15 } } condition_six = { base = 0 modifier = { ROOT = { is_in_faction_with = PREV } add = 10 } } condition_seven = { base = 0 modifier = { add = 10 is_subject_of = ROOT } } condition_eight = { base = 0 modifier = { add = 5 influence_higher_10 = yes } modifier = { add = 5 influence_higher_20 = yes } modifier = { add = 5 influence_higher_30 = yes } modifier = { add = 5 influence_higher_40 = yes } modifier = { add = 5 influence_higher_50 = yes } modifier = { add = 5 influence_higher_60 = yes } } } ai_desire = { base = 25 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } modifier = { ROOT = { has_opinion = { target = PREV value > 0 } } add = 5 } modifier = { ROOT = { has_opinion = { target = PREV value > 25 } } add = 5 } modifier = { ROOT = { has_opinion = { target = PREV value > 50 } } add = 10 } modifier = { ROOT = { original_tag = SOV } has_idea = NATO_member add = -5 } modifier = { ROOT = { is_in_faction_with = PREV } add = 10 } modifier = { ROOT = { has_idea = EU_member } has_idea = EU_member add = 8 } modifier = { ROOT = { has_idea = NATO_member } has_idea = NATO_member add = 8 } modifier = { ROOT = { is_guaranteed_by = PREV } add = 5 } modifier = { add = 5 is_subject_of = ROOT } modifier = { add = 5 is_influencer = yes } modifier = { add = 5 is_top3_influencer = yes } modifier = { add = -25 ROOT = { OR = { has_idea = non_power has_idea = minor_power } } } modifier = { add = -25 ROOT = { is_on_same_continent_as = PREV OR = { has_idea = non_power has_idea = minor_power has_idea = regional_power } } } modifier = { add = 5 ROOT = { is_on_same_continent_as = PREV } } # Geopolitical: USA-CHI softened, NKO pairs hard blocked modifier = { factor = 0.05 OR = { AND = { ROOT = { tag = CHI } tag = USA } AND = { ROOT = { tag = USA } tag = CHI } } } modifier = { factor = 0 OR = { AND = { ROOT = { tag = NKO } tag = KOR } AND = { ROOT = { tag = KOR } tag = NKO } AND = { ROOT = { tag = JAP } tag = NKO } AND = { ROOT = { tag = NKO } tag = JAP } } } modifier = { ROOT = { OR = { any_enemy_country = { is_in_faction_with = PREV.PREV } any_allied_country = { has_war_with = PREV.PREV } } } factor = 0 } modifier = { factor = 1.10 ROOT = { has_political_power > 499 } } modifier = { add = -15 date < 2000.6.1 } # Graduated economic gates modifier = { factor = 0.5 check_variable = { ROOT.interest_rate > 6 } } modifier = { factor = 0.5 check_variable = { ROOT.interest_rate > 8 } } modifier = { factor = 0 check_variable = { ROOT.interest_rate > 12 } } modifier = { factor = 0.5 ROOT = { has_political_power < 250 } } modifier = { factor = 0 ROOT = { has_political_power < 100 } } modifier = { factor = 0 ROOT = { has_active_mission = bankruptcy_incoming_collapse } } modifier = { factor = 0 ROOT = { NOT = { check_variable = { pending_mutual_investment_treaty_offer = 0 } } } } } } cancel_mutual_investment_treaty = { visible = { has_country_flag = mutual_investment_treaty_@ROOT } selectable = { custom_trigger_tooltip = { tooltip = CANCEL_MUTUAL_INVESTMENT_TOOLTIP has_country_flag = mutual_investment_treaty_@ROOT } ERI_is_not_transitional_government = yes } cost = 75 can_be_sent = { always = yes } show_acceptance_on_action_button = no requires_acceptance = no icon = 21 send_description = DIPLO_ACTION_CANCEL_MUTUAL_INVESTMENT_TREATY complete_effect = { clr_country_flag = mutual_investment_treaty_@ROOT remove_opinion_modifier = { target = ROOT modifier = mutual_investment_treaty_opinion } remove_opinion_modifier = { target = ROOT modifier = mutual_investment_treaty_trade_opinion } set_temp_variable = { target_nation = ROOT.id } set_temp_variable = { remove_nation = THIS.id } change_permanent_investment_target = yes set_temp_variable = { percent_change = -1.25 } set_temp_variable = { tag_index = ROOT.id } set_temp_variable = { influence_target = THIS.id } change_influence_percentage = yes set_country_flag = { flag = has_recently_canceled_mif_treaty_@ROOT days = 90 value = 1 } ROOT = { clr_country_flag = mutual_investment_treaty_@PREV remove_opinion_modifier = { target = ROOT modifier = mutual_investment_treaty_opinion } remove_opinion_modifier = { target = ROOT modifier = mutual_investment_treaty_trade_opinion } set_temp_variable = { target_nation = THIS.id } set_temp_variable = { remove_nation = ROOT.id } change_permanent_investment_target = yes set_temp_variable = { percent_change = -1.25 } set_temp_variable = { tag_index = PREV.id } set_temp_variable = { influence_target = THIS.id } change_influence_percentage = yes } } ai_desire = { base = 1 modifier = { ROOT = { has_opinion = { target = PREV value < 0 } } add = 25 } modifier = { ROOT = { has_opinion = { target = PREV value < -25 } } add = 25 } modifier = { ROOT = { has_opinion = { target = PREV value < -50 } } add = 25 } modifier = { ROOT = { has_opinion = { target = PREV value < -75 } } add = 100 } modifier = { ROOT = { any_enemy_country = { is_in_faction_with = PREV.PREV } } add = 100 } modifier = { ROOT = { has_war_with = PREV } add = 100 } modifier = { factor = 0 is_in_faction_with = ROOT } modifier = { factor = 1.10 ROOT = { has_political_power > 499 } } modifier = { factor = 0.50 ROOT = { has_political_power < 450 } } modifier = { factor = 0.5 ROOT = { has_political_power < 100 } } } } # Overlord Subsidies propose_subsidies_to_subject = { visible = { is_subject = yes is_subject_of = ROOT NOT = { has_country_flag = overlord_is_subsidizing_us_@ROOT } } selectable = { is_subject_of = ROOT NOT = { has_war_with = ROOT } has_opinion = { target = ROOT value > 25 } ERI_is_not_transitional_government = yes } cost = 50 requires_acceptance = yes show_acceptance_on_action_button = yes icon = 23 send_description = DIPLO_ACTION_PROPOSE_SUBSIDIES_TO_SUBJECT on_sent_effect = { ROOT = { set_variable = { pending_overlord_subsidization_offer = PREV.id } } } complete_effect = { set_country_flag = overlord_is_subsidizing_us_@ROOT set_country_flag = overlord_subsidies add_ideas = idea_overlord_subsidies ingame_update_setup = yes ROOT = { clear_variable = pending_overlord_subsidization_offer set_country_flag = overlord_is_subsidizing_us_@PREV add_to_array = { subject_subsidization = PREV.id } ingame_update_setup = yes } } reject_effect = { set_country_flag = { flag = recently_rejected_overlord_subsidies_offer value = 1 days = 90 } ROOT = { clear_variable = pending_overlord_subsidization_offer } } accept_title = DIPLO_ACTION_PROPOSE_SUBSIDIES_TO_SUBJECT_ACCEPT accept_description = DIPLO_ACTION_PROPOSE_SUBSIDIES_TO_SUBJECT_ACCEPT_DESC reject_title = DIPLO_ACTION_PROPOSE_SUBSIDIES_TO_SUBJECT_REJECT reject_description = DIPLO_ACTION_PROPOSE_SUBSIDIES_TO_SUBJECT_REJECT_DESC ai_acceptance = { base_propose_subsidies_to_subject_condition = { base = -15 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } } condition_high_interest_rate = { base = 0 modifier = { add = 5 check_variable = { interest_rate > 4.99 } } modifier = { add = 5 interest_rate_higher_than_8 = yes } modifier = { add = 5 check_variable = { interest_rate > 9.99 } } modifier = { add = 5 check_variable = { interest_rate > 12.99 } } modifier = { add = 5 check_variable = { interest_rate > 14.99 } } } condition_three = { base = 0 modifier = { check_opinion_calculation = yes add = opinion_calculator } } } ai_desire = { base = 25 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } modifier = { add = 10 check_variable = { ROOT.treasury_rate > 3.00 } } modifier = { add = 10 ROOT = { has_opinion = { target = PREV value > 50 } } } modifier = { add = 10 ROOT = { has_opinion = { target = PREV value > 100 } } } modifier = { add = 10 is_in_faction_with = ROOT } modifier = { factor = 0.5 ROOT = { ai_has_minor_economic_problems = yes } } modifier = { factor = 0.15 ROOT = { ai_has_moderate_economic_problems = yes } } modifier = { factor = 0 check_variable = { ROOT.interest_rate > 12.99 } } modifier = { factor = 0 ROOT = { has_country_flag = canceled_overlord_subsidies_@PREV } } modifier = { factor = 0 has_country_flag = recently_rejected_overlord_subsidies_offer } modifier = { factor = 0 ROOT = { NOT = { check_variable = { pending_overlord_subsidization_offer = 0 } } } } } } cancel_subsidies_to_subject = { visible = { has_country_flag = overlord_is_subsidizing_us_@ROOT } selectable = { OR = { is_subject_of = ROOT ROOT = { has_subject = PREV } ROOT = { has_country_flag = overlord_subsidies } } } cost = 50 can_be_sent = { always = yes } show_acceptance_on_action_button = no requires_acceptance = no icon = 17 send_description = DIPLO_ACTION_CANCEL_OVERLORD_SUBSIDIES complete_effect = { if = { limit = { ROOT = { has_country_flag = overlord_subsidies } } set_country_flag = { flag = canceled_overlord_subsidies_@ROOT value = 1 days = 30 } clr_country_flag = overlord_is_subsidizing_us_@ROOT remove_from_array = { subject_subsidization = ROOT.id } ingame_update_setup = yes ROOT = { set_country_flag = { flag = canceled_overlord_subsidies_@PREV value = 1 days = 30 } # Clear the data clr_country_flag = overlord_is_subsidizing_us_@PREV clr_country_flag = overlord_subsidies remove_ideas = idea_overlord_subsidies ingame_update_setup = yes } } else = { set_country_flag = { flag = canceled_overlord_subsidies_@ROOT value = 1 days = 30 } clr_country_flag = overlord_is_subsidizing_us_@ROOT clr_country_flag = overlord_subsidies remove_ideas = idea_overlord_subsidies ingame_update_setup = yes ROOT = { set_country_flag = { flag = canceled_overlord_subsidies_@PREV value = 1 days = 30 } clr_country_flag = overlord_is_subsidizing_us_@PREV remove_from_array = { subject_subsidization = PREV.id } ingame_update_setup = yes } } } ai_desire = { base = 5 modifier = { factor = 0 is_in_faction_with = ROOT } modifier = { add = -15 ROOT = { has_opinion = { target = PREV value > 75 } } } modifier = { add = -10 ROOT = { has_opinion = { target = PREV value > 100 } } } modifier = { add = 15 ROOT = { ai_has_major_economic_problems = yes } } modifier = { add = 25 is_subject = no check_variable = { interest_rate > 8.99 } } modifier = { add = 25 is_subject = no has_active_mission = bankruptcy_incoming_collapse } } } # Negotiate Release negotiate_operative_release = { allowed = { has_dlc = "La Resistance" ROOT = { NOT = { MD_special_countries = yes } } } visible = { has_captured_operative = ROOT } selectable = { has_captured_operative = ROOT ERI_is_not_transitional_government = yes } cost = 50 icon = 26 requires_acceptance = yes show_acceptance_on_action_button = yes send_description = DIPLO_ACTION_NEGOTIATE_OPERATIVE_RELEASE_DESC on_sent_effect = { ROOT = { set_variable = { pending_negotiate_operative_release_offer = PREV.id } } } complete_effect = { add_opinion_modifier = { target = ROOT modifier = negotiate_operative_release } reverse_add_opinion_modifier = { target = ROOT modifier = negotiate_operative_release } ROOT = { set_temp_variable = { treasury_change = -2 } modify_treasury_effect = yes free_random_operative = { captured_by = PREV } } } reject_effect = { ROOT = { clear_variable = pending_negotiate_operative_release_offer set_country_flag = { flag = recently_rejected_operative_release_@PREV days = 180 value = 1 } } add_opinion_modifier = { target = ROOT modifier = rejected_negotiate_operative_release } reverse_add_opinion_modifier = { target = ROOT modifier = rejected_negotiate_operative_release } } accept_title = DIPLO_ACTION_NEGOTIATE_OPERATIVE_RELEASE_ACCEPT_TITLE accept_description = DIPLO_ACTION_NEGOTIATE_OPERATIVE_RELEASE_ACCEPT_DESC reject_title = DIPLO_ACTION_NEGOTIATE_OPERATIVE_RELEASE_REJECT_TITLE reject_description = DIPLO_ACTION_NEGOTIATE_OPERATIVE_RELEASE_REJECT_DESC ai_acceptance = { base_negotiate_operative_release = { base = -50 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } } condition_two = { base = 0 modifier = { add = 5 has_government = ROOT } modifier = { add = -50 has_government = nationalist } } condition_three = { base = 0 modifier = { check_opinion_calculation = yes add = opinion_calculator } } difference_in_power_ranking = { base = 0 modifier = { add = 5 OR = { AND = { has_idea = non_power ROOT = { has_idea = minor_power } } AND = { has_idea = minor_power ROOT = { has_idea = regional_power } } AND = { has_idea = regional_power ROOT = { has_idea = large_power } } AND = { has_idea = large_power ROOT = { has_idea = great_power } } AND = { has_idea = great_power ROOT = { has_idea = super_power } } } } modifier = { add = 15 OR = { AND = { OR = { has_idea = non_power has_idea = minor_power } ROOT = { has_idea = large_power } } AND = { OR = { has_idea = minor_power has_idea = regional_power } ROOT = { has_idea = great_power } } } } modifier = { add = 20 has_idea = great_power ROOT = { has_idea = super_power } } modifier = { add = 30 OR = { has_idea = non_power has_idea = minor_power has_idea = regional_power has_idea = large_power } ROOT = { has_idea = super_power } } } } ai_desire = { base = 15 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } modifier = { add = 10 ROOT = { has_opinion = { target = PREV value > 50 } } } modifier = { add = 10 ROOT = { has_opinion = { target = PREV value > 100 } } } modifier = { add = 15 is_in_faction_with = ROOT } modifier = { add = 5 OR = { ROOT = { has_military_access_to = PREV } ROOT = { gives_military_access_to = PREV } has_volunteers_amount_from = { tag = ROOT count > 0 } ROOT = { has_volunteers_amount_from = { tag = PREV count > 0 } } } } modifier = { add = 10 ROOT = { OR = { has_idea = super_power has_idea = great_power } } } modifier = { factor = 0.5 ROOT = { ai_has_minor_economic_problems = yes } } modifier = { factor = 0.15 ROOT = { ai_has_moderate_economic_problems = yes } } modifier = { factor = 0 ROOT = { NOT = { check_variable = { pending_negotiate_operative_release_offer = 0 } } } } modifier = { factor = 0 ROOT = { has_country_flag = recently_rejected_operative_release_@PREV } } } } # Enforce Peace enforce_peace_option = { allowed = { has_game_rule = { rule = allow_forcing_a_white_peace option = yes } ROOT = { NOT = { MD_special_countries = yes } } } visible = { NOT = { has_war_with = ROOT } ROOT = { NOT = { has_country_flag = recently_demanded_enforce_peace_@PREV } } has_offensive_war = yes has_civil_war = no NOT = { MD_special_countries = yes } } selectable = { influence_higher_40 = yes has_opinion = { target = ROOT value > 50 } ERI_is_not_transitional_government = yes } cost = 50 icon = 27 requires_acceptance = yes show_acceptance_on_action_button = yes send_description = DIPLO_ACTION_ENFORCE_PEACE_OPTION_DESC on_sent_effect = { ROOT = { set_variable = { pending_enforce_peace_pending_offer = PREV.id } } add_opinion_modifier = { target = ROOT modifier = forced_a_ceasefire_during_our_conflict } } complete_effect = { for_each_scope_loop = { array = enemies every_owned_state = { limit = { is_controlled_by = PREV.PREV } PREV.PREV = { transfer_state = PREV } } PREV = { white_peace = PREV } } set_temp_variable = { percent_change = -15 } set_temp_variable = { tag_index = ROOT } set_temp_variable = { influence_target = THIS } change_influence_percentage = yes ROOT = { clear_variable = pending_enforce_peace_pending_offer set_country_flag = { flag = recently_demanded_enforce_peace_@PREV value = 1 days = 90 } } } reject_effect = { ROOT = { clear_variable = pending_enforce_peace_pending_offer set_country_flag = { flag = recently_demanded_enforce_peace_@PREV value = 1 days = 90 } } } accept_title = DIPLO_ACTION_ENFORCE_PEACE_OPTION_ACCEPT_TITLE accept_description = DIPLO_ACTION_ENFORCE_PEACE_OPTION_ACCEPT_DESC reject_title = DIPLO_ACTION_ENFORCE_PEACE_OPTION_REJECT_TITLE reject_description = DIPLO_ACTION_ENFORCE_PEACE_OPTION_REJECT_DESC ai_acceptance = { base_enforce_peace_option = { base = -50 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } } condition_two = { base = 0 modifier = { add = 5 has_government = ROOT } modifier = { add = -50 has_government = nationalist } } condition_three = { base = 0 modifier = { check_opinion_calculation = yes add = opinion_calculator } } difference_in_power_ranking = { base = 0 modifier = { add = 5 OR = { AND = { has_idea = non_power ROOT = { has_idea = minor_power } } AND = { has_idea = minor_power ROOT = { has_idea = regional_power } } AND = { has_idea = regional_power ROOT = { has_idea = large_power } } AND = { has_idea = large_power ROOT = { has_idea = great_power } } AND = { has_idea = great_power ROOT = { has_idea = super_power } } } } modifier = { add = 15 OR = { AND = { OR = { has_idea = non_power has_idea = minor_power } ROOT = { has_idea = large_power } } AND = { OR = { has_idea = minor_power has_idea = regional_power } ROOT = { has_idea = great_power } } } } modifier = { add = 20 has_idea = great_power ROOT = { has_idea = super_power } } modifier = { add = 30 OR = { has_idea = non_power has_idea = minor_power has_idea = regional_power has_idea = large_power } ROOT = { has_idea = super_power } } } war_duration_reluctance = { base = 0 modifier = { add = -50 check_variable = { THIS.months_at_war < 12 } surrender_progress < 0.5 } modifier = { add = -25 check_variable = { THIS.months_at_war < 18 } surrender_progress < 0.5 } modifier = { add = -15 check_variable = { THIS.months_at_war < 24 } surrender_progress < 0.5 } } surrender_progress_reluctance = { base = 0 modifier = { set_temp_variable = { ep_sp = { value = THIS.surrender_progress multiply = 100 subtract = 50 clamp = { min = -50 max = 50 } } } add = ep_sp } } # Desperation to end the war: a clearly losing belligerent grows # willing to accept the enforced peace, mirroring the conditional peace deal AI. desperation_to_end_war = { base = 0 modifier = { add = 25 surrender_progress > 0.5 } modifier = { add = 25 surrender_progress > 0.75 } } } ai_desire = { base = 1 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } modifier = { add = 25 ROOT = { OR = { has_idea = super_power has_idea = great_power } } } modifier = { add = 15 is_in_faction_with = ROOT } modifier = { add = 10 is_subject_of = ROOT } modifier = { add = 10 ROOT = { has_opinion = { target = PREV value > 150 } } } modifier = { factor = 0.5 ROOT = { ai_has_minor_economic_problems = yes } } modifier = { factor = 0.1 ROOT = { ai_has_moderate_economic_problems = yes } } modifier = { factor = 0 OR = { ROOT = { ai_has_major_economic_problems = yes } ROOT = { has_war = yes } ROOT = { NOT = { check_variable = { pending_enforce_peace_pending_offer = 0 } } } } } } } # Energy Load Sharing propose_energy_load_sharing = { allowed = { NOT = { has_global_flag = GAME_RULE_disable_energy_load_sharing } ROOT = { NOT = { MD_special_countries = yes } } } visible = { NOT = { is_in_array = { ROOT.energy_load_sharing_nations = THIS.id } } NOT = { is_in_array = { THIS.energy_load_sharing_nations = ROOT.id } } } selectable = { is_neighbor_of = ROOT NOT = { has_country_flag = energy_load_sharing_recipient } has_war_with_or_allies_have_war_with_ROOT = no has_an_energy_deficit = yes embassy_with_root_closed = no ERI_is_not_transitional_government = yes } cost = 50 icon = 24 requires_acceptance = yes show_acceptance_on_action_button = yes send_description = DIPLO_ACTION_PROPOSE_ENERGY_LOAD_SHARING_DESC on_sent_effect = { ROOT = { set_variable = { pending_proposal_to_energy_load_share = PREV.id } } } complete_effect = { set_country_flag = energy_load_sharing_recipient ROOT = { add_to_array = { energy_load_sharing_nations = PREV.id } # Initial calculation calculate_energy_load_sharing = yes ingame_update_setup = yes clear_variable = pending_proposal_to_energy_load_share # Do Not Instant Revoke set_country_flag = { flag = recently_accepted_energy_load_sharing_@PREV value = 1 days = 90 } } ingame_update_setup = yes } reject_effect = { ROOT = { clear_variable = pending_proposal_to_energy_load_share set_country_flag = { flag = recently_rejected_propose_energy_load_sharing_@PREV value = 1 days = 270 } } } accept_title = DIPLO_ACTION_ENERGY_LOAD_SHARING_ACCEPT_TITLE accept_description = DIPLO_ACTION_ENERGY_LOAD_SHARING_ACCEPT_DESC reject_title = DIPLO_ACTION_ENERGY_LOAD_SHARING_REJECT_TITLE reject_description = DIPLO_ACTION_ENERGY_LOAD_SHARING_REJECT_DESC ai_acceptance = { base_energy_load_sharing = { base = 15 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } } condition_two = { base = 0 modifier = { add = 5 has_government = ROOT } modifier = { add = -50 has_government = nationalist } } condition_three = { base = 0 modifier = { check_opinion_calculation = yes add = opinion_calculator } } proposer_energy_surplus = { base = 0 modifier = { add = -50 ROOT = { has_an_energy_deficit = yes } } modifier = { add = 10 check_variable = { ROOT.energy_balance > 10 } } modifier = { add = 15 check_variable = { ROOT.energy_balance > 25 } } } } ai_desire = { base = 0 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } modifier = { add = 20 ROOT = { NOT = { has_an_energy_deficit = yes } } } modifier = { add = 25 is_in_faction_with = ROOT } modifier = { add = 20 is_subject_of = ROOT } modifier = { add = 5 ROOT = { has_opinion = { target = PREV value > 50 } } } modifier = { add = 10 ROOT = { has_opinion = { target = PREV value > 100 } } } modifier = { add = 5 has_government = ROOT } modifier = { add = 5 OR = { ROOT = { has_military_access_to = PREV } ROOT = { gives_military_access_to = PREV } has_volunteers_amount_from = { tag = ROOT count > 0 } ROOT = { has_volunteers_amount_from = { tag = PREV count > 0 } } } } modifier = { factor = 0.5 ROOT = { ai_has_minor_economic_problems = yes } } modifier = { factor = 0.2 ROOT = { ai_has_moderate_economic_problems = yes } } modifier = { factor = 0 ROOT = { NOT = { check_variable = { pending_proposal_to_energy_load_share = 0 } } } } modifier = { factor = 0 ROOT = { NOT = { check_variable = { energy_balance > 10 } } } } modifier = { add = -100 ROOT = { has_country_flag = recently_rejected_propose_energy_load_sharing_@PREV } } } } request_energy_load_sharing = { allowed = { NOT = { has_global_flag = GAME_RULE_disable_energy_load_sharing } ROOT = { NOT = { MD_special_countries = yes } } } visible = { NOT = { MD_special_countries = yes } NOT = { is_in_array = { ROOT.energy_load_sharing_nations = THIS.id } } NOT = { is_in_array = { THIS.energy_load_sharing_nations = ROOT.id } } } selectable = { is_neighbor_of = ROOT NOT = { has_country_flag = energy_load_sharing_recipient } has_war_with_or_allies_have_war_with_ROOT = no ROOT = { has_an_energy_deficit = yes NOT = { has_country_flag = energy_load_sharing_recipient } } embassy_with_root_closed = no ERI_is_not_transitional_government = yes } cost = 50 icon = 24 requires_acceptance = yes show_acceptance_on_action_button = yes send_description = DIPLO_ACTION_REQUEST_ENERGY_LOAD_SHARING_DESC on_sent_effect = { ROOT = { set_variable = { pending_request_to_energy_load_share = PREV.id } } } complete_effect = { add_to_array = { energy_load_sharing_nations = ROOT.id } calculate_energy_load_sharing = yes ROOT = { set_country_flag = energy_load_sharing_recipient ingame_update_setup = yes clear_variable = pending_request_to_energy_load_share } ingame_update_setup = yes } reject_effect = { ROOT = { clear_variable = pending_request_to_energy_load_share set_country_flag = { flag = recently_rejected_request_energy_load_sharing_@PREV value = 1 days = 270 } } } accept_title = DIPLO_ACTION_ENERGY_LOAD_SHARING_ACCEPT_TITLE accept_description = DIPLO_ACTION_ENERGY_LOAD_SHARING_ACCEPT_DESC reject_title = DIPLO_ACTION_ENERGY_LOAD_SHARING_REJECT_TITLE reject_description = DIPLO_ACTION_ENERGY_LOAD_SHARING_REJECT_DESC ai_acceptance = { base_energy_load_sharing = { base = 15 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } } condition_two = { base = 0 modifier = { add = 5 has_government = ROOT } modifier = { add = -50 has_government = nationalist } } condition_three = { base = 0 modifier = { check_opinion_calculation = yes add = opinion_calculator } } sharer_energy_surplus = { base = 0 modifier = { add = -50 has_an_energy_deficit = yes } modifier = { add = 10 check_variable = { energy_balance > 10 } } modifier = { add = 15 check_variable = { energy_balance > 25 } } } } ai_desire = { base = 25 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } modifier = { add = 20 is_in_faction_with = ROOT } modifier = { add = 15 ROOT = { is_subject_of = PREV } } modifier = { add = 5 ROOT = { has_opinion = { target = PREV value > 50 } } } modifier = { add = 10 ROOT = { has_opinion = { target = PREV value > 100 } } } modifier = { add = 5 has_government = ROOT } modifier = { add = 5 OR = { ROOT = { has_military_access_to = PREV } ROOT = { gives_military_access_to = PREV } has_volunteers_amount_from = { tag = ROOT count > 0 } ROOT = { has_volunteers_amount_from = { tag = PREV count > 0 } } } } modifier = { factor = 0.5 ROOT = { ai_has_moderate_economic_problems = yes } } modifier = { factor = 0 ROOT = { ai_has_major_economic_problems = yes } } modifier = { factor = 0 ROOT = { NOT = { check_variable = { pending_request_to_energy_load_share = 0 } } } } modifier = { add = -100 ROOT = { has_country_flag = recently_rejected_request_energy_load_sharing_@PREV } } } } cancel_energy_load_sharing = { allowed = { NOT = { has_global_flag = GAME_RULE_disable_energy_load_sharing } } visible = { OR = { is_in_array = { THIS.energy_load_sharing_nations = ROOT.id } is_in_array = { ROOT.energy_load_sharing_nations = THIS.id } } } selectable = { is_currently_in_an_energy_load_sharing_agreement = yes ERI_is_not_transitional_government = yes } can_be_sent = { always = yes } show_acceptance_on_action_button = no requires_acceptance = no icon = 17 send_description = CANCEL_ENERGY_LOAD_SHARING_DESC complete_effect = { if = { limit = { has_country_flag = energy_load_sharing_recipient } clr_country_flag = energy_load_sharing_recipient if = { limit = { is_in_array = { ROOT.energy_load_sharing_nations = THIS.id } } remove_from_array = { ROOT.energy_load_sharing_nations = THIS.id } } clear_variable = energy_load_sharing_use_var clear_variable = energy_load_sharing_gain_var clear_variable = energy_load_sharing_income_var ROOT = { calculate_energy_load_sharing = yes ingame_update_setup = yes } ingame_update_setup = yes } else = { ROOT = { clr_country_flag = energy_load_sharing_recipient clear_variable = energy_load_sharing_use_var clear_variable = energy_load_sharing_gain_var clear_variable = energy_load_sharing_income_var if = { limit = { is_in_array = { PREV.energy_load_sharing_nations = THIS.id } } remove_from_array = { PREV.energy_load_sharing_nations = THIS.id } } } calculate_energy_load_sharing = yes ingame_update_setup = yes ROOT = { ingame_update_setup = yes } } } ai_desire = { base = 0 modifier = { add = 25 ROOT = { has_opinion = { target = PREV value < 0 } } } modifier = { add = 25 ROOT = { has_opinion = { target = PREV value < -25 } } } modifier = { add = 50 ROOT = { has_opinion = { target = PREV value < -50 } } } modifier = { add = 100 ROOT = { has_war_with = PREV } } modifier = { add = 50 ROOT = { is_in_faction = yes PREV = { is_in_faction = yes NOT = { is_in_faction_with = ROOT } } } } modifier = { add = 75 ROOT = { has_an_energy_deficit = yes NOT = { has_country_flag = energy_load_sharing_recipient } } } modifier = { add = -100 check_variable = { ROOT.energy_load_sharing_gain_var > 0.01 } } modifier = { add = -100 OR = { ROOT = { has_country_flag = recently_accepted_energy_load_sharing_@PREV } PREV = { has_country_flag = recently_accepted_energy_load_sharing_@ROOT } } } } } # Purchase Reactor-Grade Material purchase_reactor_grade_material = { allowed = { ROOT = { NOT = { MD_special_countries = yes } } } visible = { ROOT = { has_nuclear_reactors = yes } is_in_array = { global.enrichment_countries = THIS.id } NOT = { has_war_with = ROOT } NOT = { any_allied_country = { has_war_with = ROOT } } } selectable = { has_enrichment_facilities = yes has_reactor_material_stockpile = yes custom_trigger_tooltip = { tooltip = recently_purchased_reactor_material_tt ROOT = { NOT = { has_country_flag = recently_purchased_reactor_material_from_@PREV } } } ERI_is_not_transitional_government = yes } cost = 25 requires_acceptance = yes show_acceptance_on_action_button = yes icon = 24 send_description = PURCHASE_REACTOR_GRADE_MATERIAL_DESC on_sent_effect = { ROOT = { set_variable = { pending_reactor_material_purchase = PREV.id } } } complete_effect = { set_temp_variable = { change_resource = -5000 } change_reactor_grade_material_effect = yes set_temp_variable = { treasury_change = 4 } modify_treasury_effect = yes ROOT = { clear_variable = pending_reactor_material_purchase set_temp_variable = { change_resource = 5000 } change_reactor_grade_material_effect = yes set_temp_variable = { treasury_change = -4 } modify_treasury_effect = yes set_country_flag = { flag = recently_purchased_reactor_material_from_@PREV days = 90 value = 1 } } update_money_dirty_variable = yes } reject_effect = { ROOT = { clear_variable = pending_reactor_material_purchase set_country_flag = { flag = recently_rejected_reactor_material_purchase_@PREV days = 180 value = 1 } } } accept_title = PURCHASE_REACTOR_GRADE_MATERIAL_ACCEPT_TITLE accept_description = PURCHASE_REACTOR_GRADE_MATERIAL_ACCEPT_DESC reject_title = PURCHASE_REACTOR_GRADE_MATERIAL_REJECT_TITLE reject_description = PURCHASE_REACTOR_GRADE_MATERIAL_REJECT_DESC ai_acceptance = { base_purchase_reactor_grade = { base = -10 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } } surplus_production_condition = { base = 0 modifier = { add = 15 check_variable = { total_nuclear_reactor_fuel_production > nuclear_fuel_consumption } } modifier = { add = -25 NOT = { check_variable = { total_nuclear_reactor_fuel_production > nuclear_fuel_consumption } } } } opinion_condition = { base = 0 modifier = { check_opinion_calculation = yes add = opinion_calculator } } condition_six = { base = 0 modifier = { add = 10 is_in_faction_with = ROOT } } condition_four = { base = 0 modifier = { add = 10 ROOT = { has_idea = NATO_member } has_idea = NATO_member } } csto_member_condition = { base = 0 modifier = { add = 10 ROOT = { has_idea = CSTO_member } has_idea = CSTO_member } } geopolitical_rivals_condition = { base = 0 modifier = { add = -25 OR = { AND = { original_tag = CHI ROOT = { original_tag = USA } } AND = { original_tag = USA ROOT = { original_tag = CHI } } AND = { original_tag = CHI ROOT = { original_tag = TAI } } AND = { original_tag = TAI ROOT = { original_tag = CHI } } AND = { original_tag = JAP ROOT = { original_tag = CHI } } AND = { original_tag = CHI ROOT = { original_tag = JAP } } } } modifier = { add = -15 OR = { AND = { original_tag = SOV ROOT = { has_idea = NATO_member } } AND = { has_idea = NATO_member ROOT = { original_tag = SOV } } AND = { original_tag = FRA ROOT = { original_tag = SOV } } AND = { original_tag = SOV ROOT = { original_tag = FRA } } } } } war_condition = { base = 0 modifier = { add = -200 has_war = yes } } } ai_desire = { base = 0 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } # Don't buy if we have our own enrichment facilities modifier = { factor = 0 ROOT = { has_enrichment_facilities = yes } } # Only desire purchase if consumption exceeds production (net deficit) modifier = { add = 50 ROOT = { check_variable = { nuclear_fuel_consumption > total_nuclear_reactor_fuel_production } } } # Scale urgency by how low stockpile is relative to consumption # Critical: stockpile covers less than 4 weeks of consumption modifier = { add = 50 ROOT = { check_variable = { nuclear_fuel_consumption > 0 } check_expr = { value = var_reactor_material_stockpile divide = nuclear_fuel_consumption less_than = { value < 4 } } } } # Urgent: stockpile covers less than 8 weeks modifier = { add = 25 ROOT = { check_variable = { nuclear_fuel_consumption > 0 } check_expr = { value = var_reactor_material_stockpile divide = nuclear_fuel_consumption less_than = { value < 8 } } } } # Low priority: stockpile covers less than 16 weeks modifier = { add = 10 ROOT = { check_variable = { nuclear_fuel_consumption > 0 } check_expr = { value = var_reactor_material_stockpile divide = nuclear_fuel_consumption less_than = { value < 16 } } } } # No need: stockpile covers more than 26 weeks (half a year) modifier = { factor = 0 ROOT = { check_variable = { nuclear_fuel_consumption > 0 } check_expr = { value = var_reactor_material_stockpile divide = nuclear_fuel_consumption less_than = { value < 26 } } } } # No need if own production exceeds consumption and stockpile is healthy modifier = { factor = 0 ROOT = { check_variable = { total_nuclear_reactor_fuel_production > nuclear_fuel_consumption } check_expr = { value = var_reactor_material_stockpile divide = nuclear_fuel_consumption greater_than = { value > 8 } } } } modifier = { add = 10 ROOT = { has_opinion = { target = PREV value > 50 } } } modifier = { add = 15 ROOT = { has_opinion = { target = PREV value > 100 } } } modifier = { add = 10 is_in_faction_with = ROOT } modifier = { add = 5 ROOT = { has_idea = NATO_member } has_idea = NATO_member } modifier = { add = 5 ROOT = { has_idea = CSTO_member } has_idea = CSTO_member } modifier = { factor = 0.5 ROOT = { ai_has_minor_economic_problems = yes } } modifier = { factor = 0.25 ROOT = { ai_has_moderate_economic_problems = yes } } modifier = { factor = 0 ROOT = { NOT = { check_variable = { pending_reactor_material_purchase = 0 } } } } modifier = { factor = 0 ROOT = { has_country_flag = recently_rejected_reactor_material_purchase_@PREV } } } } # Close/Reopen Embassy close_embassy_action = { visible = { embassy_with_root_closed = no } selectable = { embassy_with_root_closed = no ERI_is_not_transitional_government = yes } cost = 50 icon = 26 # FIXME: Replace with a different icon requires_acceptance = no show_acceptance_on_action_button = no send_description = DIPLO_ACTION_CLOSE_EMBASSY_ACTION_DESC complete_effect = { add_opinion_modifier = { target = ROOT modifier = embassy_closed } reverse_add_opinion_modifier = { target = ROOT modifier = embassy_closed } add_opinion_modifier = { target = ROOT modifier = embassy_recently_closed } set_country_flag = closed_embassy_@ROOT set_country_flag = { flag = recently_closed_embassy_@ROOT days = 90 value = 1 } ROOT = { set_country_flag = recently_closed_embassy_@PREV set_country_flag = { flag = recently_closed_embassy_@PREV days = 90 value = 1 } } } accept_title = DIPLO_ACTION_CLOSE_EMBASSY_ACCEPT_TITLE accept_description = DIPLO_ACTION_CLOSE_EMBASSY_ACCEPT_DESC reject_title = DIPLO_ACTION_CLOSE_EMBASSY_REJECT_TITLE reject_description = DIPLO_ACTION_CLOSE_EMBASSY_REJECT_DESC ai_acceptance = { base_close_embassy = { base = -50 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } } } ai_desire = { base = -100 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } modifier = { add = 25 ROOT = { has_opinion = { target = PREV value < -25 } } } modifier = { add = 25 ROOT = { has_opinion = { target = PREV value < -50 } } } modifier = { add = 50 ROOT = { has_opinion = { target = PREV value < -75 } } } modifier = { add = 100 ROOT = { has_opinion = { target = PREV value < -100 } } } modifier = { add = 200 ROOT = { has_war_with = PREV } } modifier = { factor = 0 is_in_faction_with = ROOT } modifier = { factor = 0 is_subject_of = ROOT } modifier = { factor = 0 ROOT = { is_subject_of = PREV } } modifier = { factor = 0 ROOT = { has_military_access_to = PREV } } modifier = { factor = 0 ROOT = { gives_military_access_to = PREV } } } } reopen_embassy_action = { visible = { embassy_with_root_closed = yes } selectable = { embassy_with_root_closed = yes ERI_is_not_transitional_government = yes } cost = 50 icon = 26 # FIXME: Replace with a different icon requires_acceptance = yes show_acceptance_on_action_button = yes send_description = DIPLO_ACTION_REOPEN_EMBASSY_ACTION_DESC on_sent_effect = { ROOT = { set_variable = { pending_reopen_embassy_option = PREV.id } } } complete_effect = { add_opinion_modifier = { target = ROOT modifier = embassy_recently_reopened } reverse_add_opinion_modifier = { target = ROOT modifier = embassy_recently_reopened } remove_opinion_modifier = { target = ROOT modifier = embassy_closed } ROOT = { remove_opinion_modifier = { target = PREV modifier = embassy_closed } } clr_country_flag = closed_embassy_@ROOT ROOT = { clr_country_flag = closed_embassy_@PREV clear_variable = pending_reopen_embassy_option } } reject_effect = { ROOT = { clear_variable = pending_reopen_embassy_option } } accept_title = DIPLO_ACTION_REOPEN_EMBASSY_ACCEPT_TITLE accept_description = DIPLO_ACTION_REOPEN_EMBASSY_ACCEPT_DESC reject_title = DIPLO_ACTION_REOPEN_EMBASSY_REJECT_TITLE reject_description = DIPLO_ACTION_REOPEN_EMBASSY_REJECT_DESC ai_acceptance = { base_reopen_embassy = { base = -40 modifier = { add = 20 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -20 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } } condition_two = { base = 0 modifier = { add = 5 has_government = ROOT } modifier = { add = -50 OR = { has_government = nationalist has_government = fascism } } } condition_three = { base = 0 modifier = { check_opinion_calculation = yes add = opinion_calculator } } condition_four = { base = 0 modifier = { add = -100 has_war_with = ROOT } } condition_five = { base = 0 modifier = { add = 20 is_in_faction_with = ROOT } modifier = { add = 25 is_subject_of = ROOT } modifier = { add = 25 ROOT = { is_subject_of = PREV } } } } ai_desire = { base = 20 modifier = { add = 10 ROOT = { is_ai = no } check_variable = { global.difficulty = 0 } } modifier = { add = 5 ROOT = { is_ai = no } check_variable = { global.difficulty = 1 } } modifier = { add = -5 ROOT = { is_ai = no } check_variable = { global.difficulty = 3 } } modifier = { add = -10 ROOT = { is_ai = no } check_variable = { global.difficulty = 4 } } modifier = { ROOT = { has_opinion = { target = PREV value > 49 } } add = 2 } modifier = { ROOT = { has_opinion = { target = PREV value > 75 } } add = 5 } modifier = { ROOT = { has_opinion = { target = PREV value > 99 } } add = 5 } modifier = { add = -15 ROOT = { has_opinion = { target = PREV value < 0 } } } modifier = { add = 5 is_in_faction_with = ROOT } modifier = { add = 15 is_subject_of = ROOT } modifier = { factor = 0 OR = { ROOT = { NOT = { has_country_flag = recently_closed_embassy_@PREV } } ROOT = { NOT = { check_variable = { pending_reopen_embassy_option = 0 } } } } } } } }