add_namespace = influence add_namespace = News_influence ### Influence Action Events ### # Economic Aid Master event # Determines SIZE of gift country_event = { id = influence.0 is_triggered_only = yes hidden = yes immediate = { log = "[GetDateText]: [This.GetName]: influence.0 executed" set_variable = { five_gift_sum = gdp_total } multiply_variable = { five_gift_sum = 0.05 } clamp_variable = { var = five_gift_sum min = 1 max = 5000 } # Max Gift Amount Period set_variable = { ten_gift_sum = gdp_total } multiply_variable = { ten_gift_sum = 0.10 } clamp_variable = { var = ten_gift_sum min = 1 max = 5000 } # Max Gift Amount Period set_variable = { fifteen_gift_sum = gdp_total } multiply_variable = { fifteen_gift_sum = 0.15 } clamp_variable = { var = fifteen_gift_sum min = 1 max = 5000 } # Max Gift Amount Period # event_target is set in the targeting scope event_target:influence_sender = { country_event = influence.1 } } } # Economic Aid - Event # Do we send it to the nation? country_event = { id = influence.1 title = influence.1.t desc = influence.1.d picture = GFX_united_states_dollar is_triggered_only = yes # Send 5% of GDP as Economic Aid option = { name = influence.1.a log = "[GetDateText]: [This.GetName]: influence.1.a executed" set_temp_variable = { temp_amount_gift_sum = FROM.five_gift_sum } multiply_temp_variable = { temp_amount_gift_sum = -1 } custom_effect_tooltip = economic_aid_influence_value_TT add_to_variable = { treasury = temp_amount_gift_sum } FROM = { set_country_flag = sending_five_percent_of_gdp_@PREV effect_tooltip = { custom_effect_tooltip = accept_money set_temp_variable = { percent_change = 2 } set_temp_variable = { tag_index = PREV.id } change_influence_percentage = yes reverse_add_opinion_modifier = { target = FROM modifier = given_gift } } country_event = { id = News_influence.0 days = 1 } } update_money_dirty_variable = yes ai_chance = { base = 4 # Recipient situation modifier = { add = 2 ai_has_same_organization = yes } modifier = { add = 2 FROM = { check_variable = { interest_rate > 15.0 } } } modifier = { add = 2 FROM = { check_variable = { debt_ratio > 0.99 } } } modifier = { add = 1 has_opinion = { target = FROM value > 30 } } # Sender personality modifier = { factor = 1.3 has_government = democratic } modifier = { factor = 1.2 has_government = communism } modifier = { factor = 0.8 has_government = nationalist } # Sender capacity modifier = { factor = 1.3 check_variable = { debt_ratio < 0.5 } } modifier = { factor = 0.5 check_variable = { debt_ratio > 1.5 } } modifier = { factor = 0 check_variable = { debt_ratio > 2.0 } } modifier = { factor = 0 has_opinion = { target = FROM value < -20 } } } } # Send 10% of GDP as Economic Aid option = { name = influence.1.b log = "[GetDateText]: [This.GetName]: influence.1.b executed" set_temp_variable = { temp_amount_gift_sum = FROM.ten_gift_sum } multiply_temp_variable = { temp_amount_gift_sum = -1 } custom_effect_tooltip = economic_aid_influence_value_TT add_to_variable = { treasury = temp_amount_gift_sum } FROM = { set_country_flag = sending_ten_percent_of_gdp_@PREV effect_tooltip = { custom_effect_tooltip = accept_money set_temp_variable = { percent_change = 4 } set_temp_variable = { tag_index = PREV.id } change_influence_percentage = yes reverse_add_opinion_modifier = { target = FROM modifier = given_gift_ten } } country_event = { id = News_influence.0 days = 1 } } update_money_dirty_variable = yes ai_chance = { base = 2 modifier = { add = 3 ai_has_same_organization = yes } modifier = { add = 2 is_in_faction_with = FROM } modifier = { add = 2 FROM = { has_war = yes } } modifier = { add = 2 has_opinion = { target = FROM value > 50 } } # Sender personality modifier = { factor = 1.3 has_government = democratic } modifier = { factor = 1.4 has_government = communism } modifier = { factor = 0.7 has_government = nationalist } # Sender capacity modifier = { factor = 1.3 check_variable = { debt_ratio < 0.3 } } modifier = { factor = 0.5 check_variable = { debt_ratio > 1.0 } } modifier = { factor = 0 check_variable = { debt_ratio > 1.5 } } modifier = { factor = 0 has_opinion = { target = FROM value < 0 } } } } # Send 15% of GDP as Economic Aid option = { name = influence.1.c log = "[GetDateText]: [This.GetName]: influence.1.c executed" set_temp_variable = { temp_amount_gift_sum = FROM.fifteen_gift_sum } multiply_temp_variable = { temp_amount_gift_sum = -1 } custom_effect_tooltip = economic_aid_influence_value_TT add_to_variable = { treasury = temp_amount_gift_sum } FROM = { set_country_flag = sending_fifteen_percent_of_gdp_@PREV effect_tooltip = { custom_effect_tooltip = accept_money set_temp_variable = { percent_change = 6 } set_temp_variable = { tag_index = PREV.id } change_influence_percentage = yes reverse_add_opinion_modifier = { target = FROM modifier = given_gift_fifteen } } country_event = { id = News_influence.0 days = 1 } } update_money_dirty_variable = yes ai_chance = { base = 1 modifier = { add = 4 is_in_faction_with = FROM FROM = { has_war = yes } } modifier = { add = 3 FROM = { surrender_progress > 0.20 } } modifier = { add = 3 has_opinion = { target = FROM value > 80 } } modifier = { add = 2 has_idea = super_power } # Sender personality modifier = { factor = 1.5 has_government = communism } modifier = { factor = 1.2 has_government = democratic } modifier = { factor = 0.5 has_government = nationalist } # Hard floors modifier = { factor = 0 NOT = { is_in_faction_with = FROM } } modifier = { factor = 0 check_variable = { debt_ratio > 0.8 } } modifier = { factor = 0 has_opinion = { target = FROM value < 20 } } } } #Let's not bother option = { name = influence.1.e log = "[GetDateText]: [This.GetName]: influence.1.e executed" FROM = { ROOT = { clr_country_flag = recently_sent_aid@PREV } } update_money_dirty_variable = yes # AI Section ai_chance = { base = 3 modifier = { add = 3 ai_has_same_organization = no } modifier = { add = 3 has_opinion = { target = FROM value < 0 } } modifier = { add = 4 check_variable = { debt_ratio > 1.0 } } modifier = { add = 3 has_war = yes } # Personality modifier = { factor = 1.5 has_government = nationalist } modifier = { factor = 1.3 has_government = fascism } modifier = { factor = 0.7 has_government = democratic } } } } # Economic Aid - MP Enhancements Event # Flat-amount aid chooser, only reachable when rule_allow_MP_enhancements = yes. # Fires on the sender. event_target:influence_sender / influence_recipient are set in opt_aid_button_click. country_event = { id = influence.2 title = influence.2.t desc = influence.2.d picture = GFX_united_states_dollar is_triggered_only = yes # Send 25 Billion option = { name = influence.2.a log = "[GetDateText]: [This.GetName]: influence.2.a executed" set_temp_variable = { mp_aid_amount = 25 } set_temp_variable = { mp_aid_influence = 2 } mp_economic_aid_transfer = yes } # Send 50 Billion option = { name = influence.2.b log = "[GetDateText]: [This.GetName]: influence.2.b executed" set_temp_variable = { mp_aid_amount = 50 } set_temp_variable = { mp_aid_influence = 4 } mp_economic_aid_transfer = yes } # Send 75 Billion option = { name = influence.2.c log = "[GetDateText]: [This.GetName]: influence.2.c executed" set_temp_variable = { mp_aid_amount = 75 } set_temp_variable = { mp_aid_influence = 6 } mp_economic_aid_transfer = yes } # Send 100 Billion option = { name = influence.2.e log = "[GetDateText]: [This.GetName]: influence.2.e executed" set_temp_variable = { mp_aid_amount = 100 } set_temp_variable = { mp_aid_influence = 8 } mp_economic_aid_transfer = yes } } # Target Nation # Do we accept FROM economic Aid? country_event = { id = News_influence.0 title = News_influence.0.t desc = News_influence.0.d picture = GFX_united_states_dollar is_triggered_only = yes immediate = { log = "[GetDateText]: [This.GetName]: News_influence.0 executed" if = { limit = { has_country_flag = sending_five_percent_of_gdp_@FROM } set_variable = { gift_sum = five_gift_sum } } else_if = { limit = { has_country_flag = sending_ten_percent_of_gdp_@FROM } set_variable = { gift_sum = ten_gift_sum } } else_if = { limit = { has_country_flag = sending_fifteen_percent_of_gdp_@FROM } set_variable = { gift_sum = fifteen_gift_sum } } } # Accept the Aid option = { name = News_influence.0.a log = "[GetDateText]: [This.GetName]: News_influence.0.a executed" if = { limit = { has_country_flag = sending_five_percent_of_gdp_@FROM } set_temp_variable = { temp_amount_gift_sum = five_gift_sum } custom_effect_tooltip = accept_money set_temp_variable = { percent_change = 2 } set_temp_variable = { tag_index = FROM.id } change_influence_percentage = yes add_opinion_modifier = { target = FROM modifier = given_gift } } else_if = { limit = { has_country_flag = sending_ten_percent_of_gdp_@FROM } set_temp_variable = { temp_amount_gift_sum = ten_gift_sum } custom_effect_tooltip = accept_money set_temp_variable = { percent_change = 4 } set_temp_variable = { tag_index = FROM.id } change_influence_percentage = yes add_opinion_modifier = { target = FROM modifier = given_gift_ten } } else_if = { limit = { has_country_flag = sending_fifteen_percent_of_gdp_@FROM } set_temp_variable = { temp_amount_gift_sum = fifteen_gift_sum } custom_effect_tooltip = accept_money set_temp_variable = { percent_change = 6 } set_temp_variable = { tag_index = FROM.id } change_influence_percentage = yes add_opinion_modifier = { target = FROM modifier = given_gift_fifteen } } custom_effect_tooltip = economic_aid_influence_value_TT add_to_variable = { treasury = temp_amount_gift_sum } clr_country_flag = sending_five_percent_of_gdp_@FROM clr_country_flag = sending_ten_percent_of_gdp_@FROM clr_country_flag = sending_fifteen_percent_of_gdp_@FROM # Every nation we are at war with takes a diplomatic hit at the donor for funding our war effort every_enemy_country = { add_opinion_modifier = { target = FROM modifier = aided_our_enemy } } # Generic Response FROM = { country_event = diplomatic_response.1 } update_money_dirty_variable = yes # AI Section ai_chance = { base = 5 # Weighted to prefer it # Higher Likelihood if in the same organization modifier = { factor = 1.25 ai_has_same_organization = yes } # Lower GDP nations accept modifier = { factor = 3 check_variable = { gdp_per_capita < 15.000 } } # If they have lower domestic influence trigger fight or flight modifier = { set_temp_variable = { domestic_influence_amount_tmp = { value = domestic_influence_amount multiply = 0.10 } } factor = domestic_influence_amount_tmp } # If they have a high opinion of us they'll take it modifier = { factor = 1.25 check_variable = { ROOT.opinion@FROM > 100 } } # Massive Nations such as USA/China should be less likely to take on Economic Aid modifier = { factor = 0.75 OR = { has_idea = super_power has_idea = great_power } } # Killswitch # Do not accept under any of these conditions modifier = { factor = 0 OR = { check_variable = { interest_rate < 4.00 } check_variable = { debt_ratio < 0.50 } } } } } # Reject Influencer Nation option = { name = News_influence.0.b log = "[GetDateText]: [This.GetName]: News_influence.0.b executed" # Bonus of PP for the first rejection after this you need to wait 90 days if = { limit = { NOT = { has_country_flag = recently_refused_aid } } add_political_power = 100 set_country_flag = { flag = recently_refused_aid value = 1 days = 180 } } else = { custom_effect_tooltip = recently_refused_economic_aid_tt } set_temp_variable = { arg_popularity = 0.02 } add_ruling_outlook_popularity = yes # Returns Funds to the Influencer Nation if = { limit = { has_country_flag = sending_five_percent_of_gdp_@FROM } set_temp_variable = { temp_amount_gift_sum = five_gift_sum } } else_if = { limit = { has_country_flag = sending_ten_percent_of_gdp_@FROM } set_temp_variable = { temp_amount_gift_sum = ten_gift_sum } } else_if = { limit = { has_country_flag = sending_fifteen_percent_of_gdp_@FROM } set_temp_variable = { temp_amount_gift_sum = fifteen_gift_sum } } FROM = { custom_effect_tooltip = economic_aid_influence_value_TT add_to_variable = { treasury = temp_amount_gift_sum } country_event = diplomatic_response.2 } clr_country_flag = sending_five_percent_of_gdp_@FROM clr_country_flag = sending_ten_percent_of_gdp_@FROM clr_country_flag = sending_fifteen_percent_of_gdp_@FROM update_money_dirty_variable = yes ai_chance = { base = 1 # If they have lower domestic influence trigger fight or flight modifier = { set_temp_variable = { domestic_influence_amount_tmp = { value = domestic_influence_amount multiply = 0.1 } } factor = domestic_influence_amount_tmp } # If Superpower or Major Power # Reject if needed modifier = { factor = 3 OR = { has_idea = super_power has_idea = great_power } } # Nationalists should try and reject whenever they get it modifier = { factor = 5 has_government = nationalist } # Autocrats and Totalitarians will try and avoid it modifier = { has_autocratic_government_or_in_coalition = yes factor = 2.50 } modifier = { has_totalitarian_government_or_in_coalition = yes factor = 5 } # Opinion Section # If the AI has a low opinion be more likely to reject modifier = { check_variable = { ROOT.opinion@FROM < 0 } set_temp_variable = { opinion_calculator = ROOT.opinion@FROM } multiply_temp_variable = { opinion_calculator = -0.05 } factor = opinion_calculator } # Rejection Killswitch modifier = { factor = 0 OR = { check_variable = { debt_ratio > 1.50 } has_active_mission = debt_default_main_mission has_country_flag = AI_economic_downspiral check_variable = { interest_rate > 15.000 } is_subject_of = FROM } } } } } country_event = { id = influence.7 hidden = yes is_triggered_only = yes immediate = { save_event_target_as = influence_target event_target:influence_sender = { country_event = influence.3 } } } #Target Influences country_event = { id = influence.3 title = influence.3.t desc = influence.3.d picture = GFX_politics_surveillence is_triggered_only = yes #Target domestic influence option = { name = influence.3.a log = "[GetDateText]: [This.GetName]: influence.3.a executed" event_target:influence_target = { news_event = News_influence.2 set_temp_variable = { percent_change = -2 } change_domestic_influence_percentage = yes effect_tooltip = { add_opinion_modifier = { target = PREV modifier = attacked_our_influence } } } set_temp_variable = { percent_change = -1 } set_temp_variable = { tag_index = THIS.id } set_temp_variable = { influence_target = event_target:influence_target.id } change_influence_percentage = yes add_political_power = -100 ai_chance = { base = 8 modifier = { add = 4 has_government = nationalist } modifier = { add = 3 has_government = fascism } modifier = { add = 2 event_target:influence_target = { check_variable = { domestic_influence_amount > 30 } } } modifier = { factor = 1.3 has_government = communism } modifier = { factor = 0.7 has_government = democratic } } } #Target biggest influencer option = { name = influence.3.b log = "[GetDateText]: [This.GetName]: influence.3.b executed" trigger = { event_target:influence_target = { has_variable = influence_array^0 NOT = { check_variable = { influence_array^0 = ROOT } } } } ai_chance = { base = 8 modifier = { add = 5 event_target:influence_target = { check_variable = { influence_array_val^0 > 40 } } } modifier = { add = 4 event_target:influence_target = { OR = { check_variable = { influence_array^0 = CHI } check_variable = { influence_array^0 = SOV } check_variable = { influence_array^0 = PER } } } } modifier = { add = 3 has_idea = great_power } modifier = { add = 4 has_idea = super_power } modifier = { factor = 1.3 has_government = democratic } modifier = { factor = 1.3 has_government = communism } modifier = { factor = 0.7 num_of_factories < 30 } } event_target:influence_target = { var:influence_array^0 = { news_event = News_influence.1 } set_temp_variable = { percent_change = -2 } set_temp_variable = { influencer_index = 0 } change_current_influencer_index_percentage = yes } set_temp_variable = { percent_change = -1 } set_temp_variable = { tag_index = THIS.id } set_temp_variable = { influence_target = event_target:influence_target.id } change_influence_percentage = yes add_political_power = -100 } #Target 2nd biggest influencer option = { name = influence.3.c log = "[GetDateText]: [This.GetName]: influence.3.c executed" ai_chance = { base = 4 modifier = { add = 3 event_target:influence_target = { check_variable = { influence_array_val^1 > 30 } } } modifier = { add = 4 event_target:influence_target = { OR = { check_variable = { influence_array^1 = CHI } check_variable = { influence_array^1 = SOV } check_variable = { influence_array^1 = PER } } } } modifier = { add = 2 has_idea = great_power } modifier = { factor = 0.8 num_of_factories < 30 } } trigger = { event_target:influence_target = { has_variable = influence_array^1 NOT = { check_variable = { influence_array^1 = ROOT } } } } set_temp_variable = { percent_change = -1 } set_temp_variable = { tag_index = THIS.id } set_temp_variable = { influence_target = event_target:influence_target.id } change_influence_percentage = yes event_target:influence_target = { var:influence_array^1 = { news_event = News_influence.1 } set_temp_variable = { percent_change = -2 } set_temp_variable = { influencer_index = 1 } change_current_influencer_index_percentage = yes } add_political_power = -100 } #Target 3rd Biggest Influencer option = { name = influence.3.e log = "[GetDateText]: [This.GetName]: influence.3.e executed" ai_chance = { base = 2 modifier = { add = 3 event_target:influence_target = { OR = { check_variable = { influence_array^2 = CHI } check_variable = { influence_array^2 = SOV } check_variable = { influence_array^2 = PER } } } } modifier = { add = 1 has_idea = super_power } } trigger = { event_target:influence_target = { has_variable = influence_array^2 NOT = { check_variable = { influence_array^2 = ROOT } } } } event_target:influence_target = { var:influence_array^2 = { news_event = News_influence.1 } set_temp_variable = { percent_change = -2 } set_temp_variable = { influencer_index = 2 } change_current_influencer_index_percentage = yes } set_temp_variable = { percent_change = -1 } set_temp_variable = { tag_index = THIS.id } set_temp_variable = { influence_target = event_target:influence_target.id } change_influence_percentage = yes add_political_power = -100 } #Let's not bother option = { name = influence.3.f ai_chance = { base = 0 } } } # attacked our influence in another country news_event = { id = News_influence.1 title = News_influence.1.t desc = News_influence.1.d picture = GFX_news_crime_fighting is_triggered_only = yes #yeah... option = { name = News_influence.1.a log = "[GetDateText]: [This.GetName]: News_influence.1.a executed" add_opinion_modifier = { target = FROM modifier = attacked_our_influence } } } # attacked our domestic influence news_event = { id = News_influence.2 title = News_influence.2.t desc = News_influence.2.d picture = GFX_news_crime_fighting is_triggered_only = yes #yeah... option = { name = News_influence.2.a log = "[GetDateText]: [This.GetName]: News_influence.2.a executed" add_opinion_modifier = { target = FROM modifier = attacked_our_influence } } } ### Coup the Enemy! ### # Target country_event = { id = influence.44 is_triggered_only = yes hidden = yes immediate = { log = "[GetDateText]: [Root.GetName]: event influence.44" # Chance of failure for ROOT Coup for_loop_effect = { end = influence_array_val^num if = { limit = { var:influence_array^v = { has_government = democratic } } add_to_temp_variable = { influence_democratic = influence_array_val^v } } else_if = { limit = { var:influence_array^v = { has_government = neutrality } } add_to_temp_variable = { influence_neutrality = influence_array_val^v } } else_if = { limit = { var:influence_array^v = { has_government = communism } } add_to_temp_variable = { influence_communism = influence_array_val^v } } else_if = { limit = { var:influence_array^v = { has_government = nationalist } } add_to_temp_variable = { influence_nationalist = influence_array_val^v } } else_if = { limit = { var:influence_array^v = { has_government = fascism } } add_to_temp_variable = { influence_fascism = influence_array_val^v } } } ## Coup Failure Rate ## # Base failure rate is popularity of the ruling Outlook # Higher defending popularity makes coups more difficult set_variable = { fail_factor_biggest = party_popularity@ruling_party } # Multiply by how much influence in total supports target Outlook (domestic + foreign) # Higher domestic and foreign support for defending Outlook makes coups more difficult set_temp_variable = { fail_influence_multiplier = domestic_influence_amount } if = { limit = { has_government = democratic } add_to_temp_variable = { fail_influence_multiplier = influence_democratic } } else_if = { limit = { has_government = neutrality } add_to_temp_variable = { fail_influence_multiplier = influence_neutrality } } else_if = { limit = { has_government = communism } add_to_temp_variable = { fail_influence_multiplier = influence_communism } } else_if = { limit = { has_government = nationalist } add_to_temp_variable = { fail_influence_multiplier = influence_nationalist } } else_if = { limit = { has_government = fascism } add_to_temp_variable = { fail_influence_multiplier = influence_fascism } } multiply_temp_variable = { fail_influence_multiplier = 0.01 } add_to_temp_variable = { fail_influence_multiplier = stability } multiply_variable = { fail_factor_biggest = fail_influence_multiplier } ## Coup success rate ## # Base success rate is popularity of the attacking Outlook # This is multiplied by how much foreign influence there is in support for the attacking Outlook if = { limit = { event_target:influence_sender = { has_government = democratic } } set_variable = { success_factor_biggest = party_popularity@democratic } set_temp_variable = { success_influence_multiplier = influence_democratic } multiply_temp_variable = { success_influence_multiplier = 0.01 } multiply_variable = { success_factor_biggest = success_influence_multiplier } # Storing the biggest party set_temp_variable = { prevmax_temp = 0 } if = { limit = { has_variable = party_pop_array^1 check_variable = { party_pop_array^1 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^1 } } if = { limit = { has_variable = party_pop_array^2 check_variable = { party_pop_array^2 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^2 } } if = { limit = { has_variable = party_pop_array^3 check_variable = { party_pop_array^3 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^3 } } if = { limit = { has_variable = party_pop_array^0 check_variable = { party_pop_array^0 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^0 } } #Set for highest value if = { limit = { check_variable = { prevmax_temp = party_pop_array^1 } } set_variable = { influence_coup_party = 1 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^2 } } set_variable = { influence_coup_party = 2 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^3 } } set_variable = { influence_coup_party = 3 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^0 } } set_variable = { influence_coup_party = 0 } } } else_if = { limit = { event_target:influence_sender = { has_government = neutrality } } set_variable = { success_factor_biggest = party_popularity@neutrality } set_temp_variable = { success_influence_multiplier = influence_neutrality } multiply_temp_variable = { success_influence_multiplier = 0.01 } multiply_variable = { success_factor_biggest = success_influence_multiplier } #storing biggest party set_temp_variable = { prevmax_temp = 0 } if = { limit = { has_variable = party_pop_array^14 check_variable = { party_pop_array^14 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^14 } } if = { limit = { has_variable = party_pop_array^15 check_variable = { party_pop_array^15 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^15 } } if = { limit = { has_variable = party_pop_array^18 check_variable = { party_pop_array^18 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^18 } } if = { limit = { has_variable = party_pop_array^16 check_variable = { party_pop_array^16 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^16 } } if = { limit = { has_variable = party_pop_array^13 check_variable = { party_pop_array^13 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^13 } } if = { limit = { has_variable = party_pop_array^19 check_variable = { party_pop_array^19 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^19 } } if = { limit = { has_variable = party_pop_array^17 check_variable = { party_pop_array^17 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^17 } } if = { limit = { has_variable = party_pop_array^12 check_variable = { party_pop_array^12 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^12 } } #Set for highest value if = { limit = { check_variable = { prevmax_temp = party_pop_array^14 } } set_variable = { influence_coup_party = 14 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^15 } } set_variable = { influence_coup_party = 15 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^18 } } set_variable = { influence_coup_party = 18 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^16 } } set_variable = { influence_coup_party = 16 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^13 } } set_variable = { influence_coup_party = 13 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^19 } } set_variable = { influence_coup_party = 19 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^17 } } set_variable = { influence_coup_party = 17 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^12 } } set_variable = { influence_coup_party = 12 } } } else_if = { limit = { event_target:influence_sender = { has_government = communism } } set_variable = { success_factor_biggest = party_popularity@communism } set_temp_variable = { success_influence_multiplier = influence_communism } multiply_temp_variable = { success_influence_multiplier = 0.01 } multiply_variable = { success_factor_biggest = success_influence_multiplier } #storing biggest party set_temp_variable = { prevmax_temp = 0 } if = { limit = { has_variable = party_pop_array^4 check_variable = { party_pop_array^4 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^4 } } if = { limit = { has_variable = party_pop_array^6 check_variable = { party_pop_array^6 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^6 } } if = { limit = { has_variable = party_pop_array^7 check_variable = { party_pop_array^7 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^7 } } if = { limit = { has_variable = party_pop_array^9 check_variable = { party_pop_array^9 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^9 } } if = { limit = { has_variable = party_pop_array^8 check_variable = { party_pop_array^8 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^8 } } if = { limit = { has_variable = party_pop_array^5 check_variable = { party_pop_array^5 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^5 } } #Set for highest value if = { limit = { check_variable = { prevmax_temp = party_pop_array^4 } } set_variable = { influence_coup_party = 4 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^6 } } set_variable = { influence_coup_party = 6 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^7 } } set_variable = { influence_coup_party = 7 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^9 } } set_variable = { influence_coup_party = 9 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^8 } } set_variable = { influence_coup_party = 8 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^5 } } set_variable = { influence_coup_party = 5 } } } else_if = { limit = { event_target:influence_sender = { has_government = nationalist } } set_variable = { success_factor_biggest = party_popularity@nationalist } set_temp_variable = { success_influence_multiplier = influence_nationalist } multiply_temp_variable = { success_influence_multiplier = 0.01 } multiply_variable = { success_factor_biggest = success_influence_multiplier } #storing biggest party set_temp_variable = { prevmax_temp = 0 } if = { limit = { has_variable = party_pop_array^22 check_variable = { party_pop_array^22 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^22 } } if = { limit = { has_variable = party_pop_array^21 check_variable = { party_pop_array^21 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^21 } } if = { limit = { has_variable = party_pop_array^20 check_variable = { party_pop_array^20 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^20 } } if = { limit = { has_variable = party_pop_array^23 check_variable = { party_pop_array^23 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^23 } } #Set for highest value if = { limit = { check_variable = { prevmax_temp = party_pop_array^22 } } set_variable = { influence_coup_party = 22 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^21 } } set_variable = { influence_coup_party = 21 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^20 } } set_variable = { influence_coup_party = 20 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^23 } } set_variable = { influence_coup_party = 23 } } } else_if = { limit = { event_target:influence_sender = { has_government = fascism } } set_variable = { success_factor_biggest = party_popularity@fascism } set_temp_variable = { success_influence_multiplier = influence_fascism } multiply_temp_variable = { success_influence_multiplier = 0.01 } multiply_variable = { success_factor_biggest = success_influence_multiplier } #storing biggest party set_temp_variable = { prevmax_temp = 0 } if = { limit = { has_variable = party_pop_array^10 check_variable = { party_pop_array^10 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^10 } } if = { limit = { has_variable = party_pop_array^11 check_variable = { party_pop_array^11 > prevmax_temp } } set_temp_variable = { prevmax_temp = party_pop_array^11 } } #Set for highest value if = { limit = { check_variable = { prevmax_temp = party_pop_array^10 } } set_variable = { influence_coup_party = 10 } } else_if = { limit = { check_variable = { prevmax_temp = party_pop_array^11 } } set_variable = { influence_coup_party = 11 } } } set_temp_variable = { influence_defense_modifier = 1 } add_to_temp_variable = { influence_defense_modifier = modifier@foreign_influence_defense_modifier } event_target:influence_sender = { add_to_temp_variable = { influence_defense_modifier = modifier@foreign_influence_modifier } add_to_temp_variable = { influence_defense_modifier = modifier@influence_coup_modifier } } multiply_variable = { success_factor_biggest = influence_defense_modifier } ### Chance of civil war ### #Base chance is from the popularity of all other Outlooks except defending and attacking #More pluralistic -> higher chance of civil war set_variable = { civil_war_factor = stability } multiply_variable = { civil_war_factor = -1 } add_to_variable = { civil_war_factor = 1 } #Modify civil war chance based on the influence of "neutral" Outlooks set_temp_variable = { civil_war_influence_multiplier = 100 } if = { limit = { NOT = { has_government = democratic } NOT = { event_target:influence_sender = { has_government = democratic } } } add_to_temp_variable = { civil_war_influence_multiplier = influence_democratic } } if = { limit = { NOT = { has_government = neutrality } NOT = { event_target:influence_sender = { has_government = neutrality } } } add_to_temp_variable = { civil_war_influence_multiplier = influence_neutrality } } if = { limit = { NOT = { has_government = communism } NOT = { event_target:influence_sender = { has_government = communism } } } add_to_temp_variable = { civil_war_influence_multiplier = influence_communism } } if = { limit = { NOT = { has_government = nationalist } NOT = { event_target:influence_sender = { has_government = nationalist } } } add_to_temp_variable = { civil_war_influence_multiplier = influence_nationalist } } if = { limit = { NOT = { has_government = fascism } NOT = { event_target:influence_sender = { has_government = fascism } } } add_to_temp_variable = { civil_war_influence_multiplier = influence_fascism } } multiply_temp_variable = { civil_war_influence_multiplier = 0.01 } multiply_variable = { civil_war_factor = civil_war_influence_multiplier } event_target:influence_sender = { country_event = influence.5 } } } # The Actual Coup Event country_event = { id = influence.5 title = influence.5.t desc = influence.5.d picture = GFX_politics_surveillence is_triggered_only = yes #target outlook - biggest party option = { name = influence.5.a log = "[GetDateText]: [This.GetName]: influence.5.a executed" add_political_power = -200 add_threat = 2 random_list = { #success var:FROM.success_factor_biggest = { custom_effect_tooltip = influence_coup_largest_success_TT #add tooltip FROM = { hidden_effect = { set_temp_variable = { rul_party_temp = influence_coup_party } change_ruling_party_effect = yes set_temp_variable = { outlook_party_index = rul_party_temp } set_outlook_from_party_index = yes set_temp_variable = { outlook_popularity_change = 0.2 } change_outlook_popularity = yes recalculate_party = yes hold_elections = yes add_opinion_modifier = { target = ROOT modifier = succeded_coup } news_event = News_influence.3 } } #add 20% to ROOT influence set_temp_variable = { percent_change = 10 } set_temp_variable = { influence_target = FROM.id } change_influence_percentage = yes # NATO member couped by hostile power — fire dilemma on the current NATO faction leader (USA, or any other if USA is gone) NATO_coup_response_pulse = yes # Other major influencers get a chance to contest the coup if = { limit = { has_game_rule = { rule = rule_disable_coup_contest option = no } } save_event_target_as = coup_contest_sender FROM = { save_event_target_as = coup_contest_victim } # Largest foreign influencer (if over 10% and not the sender) if = { limit = { FROM = { has_variable = influence_array^0 check_variable = { influence_array_val^0 > 9.999 } NOT = { check_variable = { influence_array^0 = ROOT.id } } } } var:FROM.influence_array^0 = { country_event = { id = influence.60 days = 2 } } } # Second largest foreign influencer (if over 20% and not the sender) if = { limit = { FROM = { has_variable = influence_array^1 check_variable = { influence_array_val^1 > 19.999 } NOT = { check_variable = { influence_array^1 = ROOT.id } } NOT = { check_variable = { influence_array^1 = influence_array^0 } } } } var:FROM.influence_array^1 = { country_event = { id = influence.60 days = 2 } } } } #add event to country and world hidden_effect = { every_country = { limit = { is_ai = no } news_event = { days = 1 id = News_influence.4 } } } } #discovered var:FROM.fail_factor_biggest = { custom_effect_tooltip = influence_coup_largest_discovered_TT FROM = { add_opinion_modifier = { target = ROOT modifier = failed_coup } } #remove a LOT of influence set_temp_variable = { percent_change = -15 } set_temp_variable = { influence_target = FROM.id } change_influence_percentage = yes #add event to country and world hidden_effect = { every_country = { limit = { is_ai = no } news_event = { days = 1 id = News_influence.5 } } } } #civil_war var:FROM.civil_war_factor = { FROM = { #kill player influence for_loop_effect = { end = influence_array^num value = v if = { limit = { check_variable = { influence_array^v = ROOT } } set_variable = { current_influence = influence_array_val^v } remove_from_array = { array = influence_array index = v } remove_from_array = { array = influence_array_val index = v } } } #damage relations with original gov hidden_effect = { add_opinion_modifier = { target = ROOT modifier = failed_coup } } recalculate_influence = yes } #democratic if = { limit = { has_government = democratic } FROM = { start_civil_war = { ideology = democratic size = 0.5 } #first setup some things for original tag hidden_effect = { add_popularity = { ideology = democratic popularity = -0.5 } } recalculate_party = yes update_majority_threshold = yes } random_other_country = { limit = { original_tag = FROM has_government = democratic } start_politics_input = yes install_influence_coup_rebel_party = yes #New TAG so need to set some generic politics set_popularities = { democratic = 70 communism = 10 neutrality = 10 fascism = 0 nationalist = 10 } set_politics = { ruling_party = democratic elections_allowed = no } hidden_effect = { startup_politics = yes set_leader = yes recalculate_party = yes hold_elections = yes } #influence transfer init_influence = yes set_variable = { domestic_influence_amount = FROM.current_influence } add_to_array = { influence_array = ROOT } add_to_array = { influence_array_val = FROM.current_influence } sort_influence = yes add_opinion_modifier = { target = ROOT modifier = supported_us_in_the_coup } } } #communism if = { limit = { has_government = communism } FROM = { start_civil_war = { ideology = communism size = 0.5 } #first setup some things for original tag hidden_effect = { add_popularity = { ideology = communism popularity = -0.5 } } recalculate_party = yes update_majority_threshold = yes } random_other_country = { limit = { original_tag = FROM has_government = communism } start_politics_input = yes install_influence_coup_rebel_party = yes #New TAG so need to set some generic politics set_popularities = { democratic = 10 communism = 75 neutrality = 5 fascism = 0 nationalist = 10 } set_politics = { ruling_party = communism elections_allowed = no } hidden_effect = { startup_politics = yes set_leader = yes recalculate_party = yes hold_elections = yes } #influence transfer init_influence = yes set_variable = { domestic_influence_amount = FROM.current_influence } add_to_array = { influence_array = ROOT } add_to_array = { influence_array_val = FROM.current_influence } sort_influence = yes add_opinion_modifier = { target = ROOT modifier = supported_us_in_the_coup } } } #fascism if = { limit = { has_government = fascism } FROM = { start_civil_war = { ideology = fascism size = 0.5 } #first setup some things for original tag hidden_effect = { add_popularity = { ideology = fascism popularity = -0.5 } } recalculate_party = yes update_majority_threshold = yes } random_other_country = { limit = { original_tag = FROM has_government = fascism } start_politics_input = yes install_influence_coup_rebel_party = yes #New TAG so need to set some generic politics set_popularities = { democratic = 0 communism = 5 neutrality = 5 fascism = 80 nationalist = 10 } set_politics = { ruling_party = fascism elections_allowed = no } hidden_effect = { startup_politics = yes set_leader = yes recalculate_party = yes hold_elections = yes } #influence transfer init_influence = yes set_variable = { domestic_influence_amount = FROM.current_influence } add_to_array = { influence_array = ROOT } add_to_array = { influence_array_val = FROM.current_influence } sort_influence = yes add_opinion_modifier = { target = ROOT modifier = supported_us_in_the_coup } } } #neutrality if = { limit = { has_government = neutrality } FROM = { start_civil_war = { ideology = neutrality size = 0.5 } #first setup some things for original tag hidden_effect = { add_popularity = { ideology = neutrality popularity = -0.5 } } recalculate_party = yes update_majority_threshold = yes } random_other_country = { limit = { original_tag = FROM has_government = neutrality } start_politics_input = yes install_influence_coup_rebel_party = yes #New TAG so need to set some generic politics set_popularities = { democratic = 10 communism = 10 neutrality = 70 fascism = 0 nationalist = 10 } set_politics = { ruling_party = neutrality elections_allowed = no } hidden_effect = { startup_politics = yes set_leader = yes recalculate_party = yes hold_elections = yes } #influence transfer init_influence = yes set_variable = { domestic_influence_amount = FROM.current_influence } add_to_array = { influence_array = ROOT } add_to_array = { influence_array_val = FROM.current_influence } sort_influence = yes add_opinion_modifier = { target = ROOT modifier = supported_us_in_the_coup } } } #nationalist civil war if = { limit = { has_government = nationalist } FROM = { start_civil_war = { ideology = nationalist size = 0.5 } #first setup some things for original tag hidden_effect = { add_popularity = { ideology = nationalist popularity = -0.2 } } recalculate_party = yes update_majority_threshold = yes } random_other_country = { limit = { original_tag = FROM has_government = nationalist } start_politics_input = yes install_influence_coup_rebel_party = yes #New TAG so need to set some generic politics set_popularities = { democratic = 10 communism = 10 neutrality = 10 fascism = 0 nationalist = 70 } set_politics = { ruling_party = nationalist elections_allowed = no } hidden_effect = { startup_politics = yes set_leader = yes recalculate_party = yes hold_elections = yes } #influence transfer init_influence = yes set_variable = { domestic_influence_amount = FROM.current_influence } add_to_array = { influence_array = ROOT } add_to_array = { influence_array_val = FROM.current_influence } sort_influence = yes add_opinion_modifier = { target = ROOT modifier = supported_us_in_the_coup } } } # Major foreign influencers get a chance to back the old regime if = { limit = { has_game_rule = { rule = rule_disable_coup_contest option = no } } save_event_target_as = coup_contest_sender FROM = { save_event_target_as = coup_contest_victim } if = { limit = { FROM = { has_variable = influence_array^0 check_variable = { influence_array_val^0 > 19.999 } NOT = { check_variable = { influence_array^0 = ROOT.id } } } } var:FROM.influence_array^0 = { country_event = { id = influence.61 days = 2 } } } if = { limit = { FROM = { has_variable = influence_array^1 check_variable = { influence_array_val^1 > 19.999 } NOT = { check_variable = { influence_array^1 = ROOT.id } } NOT = { check_variable = { influence_array^1 = influence_array^0 } } } } var:FROM.influence_array^1 = { country_event = { id = influence.61 days = 2 } } } } #add event to country and world hidden_effect = { every_country = { limit = { is_ai = no } news_event = News_influence.6 } } } } } #abort planning option = { name = influence.5.c log = "[GetDateText]: [This.GetName]: influence.5.c executed" FROM = { clear_variable = influence_coup_party } } option = { name = influence.5.d1 log = "[GetDateText]: [This.GetName]: influence.5.d1 executed" trigger = { original_tag = ENG FROM = { has_country_flag = european_nation_flag } has_completed_focus = ENG_glory_of_pax_britannica NOT = { check_variable = { ENG_uses_for_ads > 3 } } } add_to_variable = { ENG_uses_for_ads = 1 } hidden_effect = { ADS = { set_autonomy = { target = FROM autonomy_state = autonomy_constituent_country_very_low_devolution } } FROM = { set_temp_variable = { party_index = 22 } set_temp_variable = { party_popularity_increase = 1 } set_temp_variable = { temp_outlook_increase = 1 } change_relative_party_popularity = yes set_temp_variable = { rul_party_temp = 22 } set_temp_variable = { disable_elections = 1 } change_ruling_party_effect = yes } } } } news_event = { id = News_influence.3 title = News_influence.3.t desc = News_influence.3.d picture = GFX_news_crime_fighting is_triggered_only = yes immediate = { } option = { name = News_influence.3.a } } news_event = { id = News_influence.4 title = News_influence.4.t desc = News_influence.4.d picture = GFX_news_crime_fighting is_triggered_only = yes immediate = { } option = { name = News_influence.4.a } } news_event = { id = News_influence.5 title = News_influence.5.t desc = News_influence.5.d picture = GFX_news_crime_fighting is_triggered_only = yes immediate = { } option = { name = News_influence.5.a } } news_event = { id = News_influence.6 title = News_influence.6.t desc = News_influence.6.d picture = GFX_news_crime_fighting is_triggered_only = yes immediate = { } option = { name = News_influence.6.a } } # World condemns the coup-sender after a contester denounces them news_event = { id = News_influence.7 title = News_influence.7.t desc = News_influence.7.d picture = GFX_news_crime_fighting is_triggered_only = yes option = { name = News_influence.7.a } } # Contester backs the old opposition in a post-coup power struggle news_event = { id = News_influence.8 title = News_influence.8.t desc = News_influence.8.d picture = GFX_news_crime_fighting is_triggered_only = yes option = { name = News_influence.8.a } } # Contester openly arms the old regime after the coup sparked a civil war news_event = { id = News_influence.9 title = News_influence.9.t desc = News_influence.9.d picture = GFX_news_crime_fighting is_triggered_only = yes option = { name = News_influence.9.a } } # Contester opens a full-scale military intervention over the coup news_event = { id = News_influence.10 title = News_influence.10.t desc = News_influence.10.d picture = GFX_news_crime_fighting is_triggered_only = yes option = { name = News_influence.10.a } } # Major conventional arms transfer announced (large package, infantry/vehicles) news_event = { id = News_influence.11 title = News_influence.11.t desc = News_influence.11.d picture = GFX_news_crime_fighting is_triggered_only = yes option = { name = News_influence.11.a } } # Modern equipment transfer announced (heavy AT, SAM, drones — more provocative) news_event = { id = News_influence.12 title = News_influence.12.t desc = News_influence.12.d picture = GFX_news_crime_fighting is_triggered_only = yes option = { name = News_influence.12.a } } # Coup Contest — Major influencer gets to respond to a successful foreign coup country_event = { id = influence.60 title = influence.60.t desc = influence.60.d picture = GFX_politics_surveillence is_triggered_only = yes trigger = { event_target:coup_contest_sender = { exists = yes } event_target:coup_contest_victim = { exists = yes } NOT = { has_country_flag = collapsed_nation } # Skip if this is already handled as a NATO coup response NOT = { OR = { has_idea = NATO_member is_faction_leader = yes event_target:coup_contest_victim = { has_idea = NATO_member } event_target:coup_contest_sender = { OR = { original_tag = CHI original_tag = SOV original_tag = PER } } } } } # Denounce publicly and sanction the coup-sender option = { name = influence.60.a log = "[GetDateText]: [This.GetName]: influence.60.a executed" add_opinion_modifier = { target = event_target:coup_contest_sender modifier = attacked_our_influence } event_target:coup_contest_sender = { add_opinion_modifier = { target = PREV modifier = attacked_our_influence } } add_political_power = -50 hidden_effect = { every_country = { limit = { is_ai = no } news_event = { id = News_influence.7 days = 1 } } } ai_chance = { base = 40 modifier = { add = 30 has_opinion = { target = event_target:coup_contest_sender value < 0 } } modifier = { add = 20 has_government = democratic } modifier = { add = 10 has_government = neutrality } modifier = { factor = 0.7 has_government = nationalist } modifier = { factor = 0.7 has_government = fascism } modifier = { factor = 1.3 num_of_factories < 30 } modifier = { factor = 0.5 has_war = yes } } } # Impose targeted economic sanctions on the coup-sender option = { name = influence.60.f log = "[GetDateText]: [This.GetName]: influence.60.f executed" add_opinion_modifier = { target = event_target:coup_contest_sender modifier = attacked_our_influence } event_target:coup_contest_sender = { add_opinion_modifier = { target = PREV modifier = attacked_our_influence } decrease_economic_growth = yes } set_temp_variable = { percent_change = -5 } set_temp_variable = { tag_index = event_target:coup_contest_sender.id } set_temp_variable = { influence_target = event_target:coup_contest_victim.id } change_influence_percentage = yes add_political_power = -75 hidden_effect = { every_country = { limit = { is_ai = no } news_event = { id = News_influence.7 days = 1 } } } ai_chance = { base = 25 modifier = { add = 25 has_opinion = { target = event_target:coup_contest_sender value < -20 } } modifier = { add = 15 has_idea = great_power } modifier = { add = 20 has_idea = super_power } modifier = { factor = 1.5 has_government = democratic } modifier = { factor = 1.2 has_government = communism } modifier = { factor = 0.5 has_government = nationalist } modifier = { factor = 0.7 num_of_factories < 30 } modifier = { factor = 0.5 is_in_faction_with = event_target:coup_contest_sender } } } # Clandestine support for the previous government — try to reverse the coup option = { name = influence.60.b log = "[GetDateText]: [This.GetName]: influence.60.b executed" set_temp_variable = { percent_change = 10 } set_temp_variable = { tag_index = THIS.id } set_temp_variable = { influence_target = event_target:coup_contest_victim.id } change_influence_percentage = yes set_temp_variable = { percent_change = -10 } set_temp_variable = { tag_index = event_target:coup_contest_sender.id } set_temp_variable = { influence_target = event_target:coup_contest_victim.id } change_influence_percentage = yes event_target:coup_contest_victim = { set_temp_variable = { contester_influence = 0 } for_each_loop = { array = influence_array value = v index = i if = { limit = { check_variable = { v = PREV.id } } set_temp_variable = { contester_influence = influence_array_val^i } } } if = { limit = { check_variable = { contester_influence > 59.999 } } set_temp_variable = { party_popularity_increase = 0.15 } } else_if = { limit = { check_variable = { contester_influence > 39.999 } } set_temp_variable = { party_popularity_increase = 0.10 } } else_if = { limit = { check_variable = { contester_influence > 19.999 } } set_temp_variable = { party_popularity_increase = 0.06 } } else = { set_temp_variable = { party_popularity_increase = 0.03 } } change_relative_party_popularity = yes add_political_power = -50 } add_political_power = -50 hidden_effect = { every_country = { limit = { is_ai = no } news_event = { id = News_influence.8 days = 1 } } } ai_chance = { base = 20 modifier = { add = 25 has_opinion = { target = event_target:coup_contest_sender value < -20 } } modifier = { add = 15 has_idea = great_power } modifier = { add = 20 has_idea = super_power } modifier = { factor = 1.5 has_government = democratic } modifier = { factor = 1.3 has_government = communism } modifier = { factor = 0.5 has_government = nationalist } modifier = { factor = 1.2 has_country_leader = { name = "Donald Trump" } } modifier = { factor = 0 has_war = yes } } } # Open military intervention — posture against the coup-sender and arm the exiled resistance option = { name = influence.60.e log = "[GetDateText]: [This.GetName]: influence.60.e executed" add_relation_modifier = { target = event_target:coup_contest_sender modifier = generic_military_intervention } add_opinion_modifier = { target = event_target:coup_contest_sender modifier = attacked_our_influence } event_target:coup_contest_sender = { add_opinion_modifier = { target = PREV modifier = attacked_our_influence } } event_target:coup_contest_victim = { set_temp_variable = { contester_influence = 0 } for_each_loop = { array = influence_array value = v index = i if = { limit = { check_variable = { v = PREV.id } } set_temp_variable = { contester_influence = influence_array_val^i } } } if = { limit = { check_variable = { contester_influence > 39.999 } } set_temp_variable = { party_popularity_increase = 0.12 } } else = { set_temp_variable = { party_popularity_increase = 0.06 } } change_relative_party_popularity = yes add_political_power = -100 } set_temp_variable = { percent_change = 15 } set_temp_variable = { tag_index = THIS.id } set_temp_variable = { influence_target = event_target:coup_contest_victim.id } change_influence_percentage = yes set_temp_variable = { percent_change = -15 } set_temp_variable = { tag_index = event_target:coup_contest_sender.id } set_temp_variable = { influence_target = event_target:coup_contest_victim.id } change_influence_percentage = yes add_political_power = -150 add_war_support = 0.05 add_threat = 3 hidden_effect = { every_country = { limit = { is_ai = no } news_event = { id = News_influence.10 days = 1 } } } ai_chance = { base = 5 modifier = { add = 20 event_target:coup_contest_sender = { OR = { original_tag = CHI original_tag = SOV original_tag = PER } } } modifier = { add = 10 event_target:coup_contest_sender = { has_added_tension_amount > 30 } } modifier = { add = 15 has_government = democratic event_target:coup_contest_victim = { has_government = democratic } } modifier = { add = 10 has_idea = super_power } modifier = { factor = 1.3 has_country_leader = { name = "Donald Trump" } } modifier = { factor = 0.5 has_government = neutrality } modifier = { factor = 0 has_war = yes } modifier = { factor = 0.3 threat > 0.70 } modifier = { factor = 0 num_of_military_factories < 50 } modifier = { factor = 0 is_in_faction_with = event_target:coup_contest_sender } } } # Accept the new reality — move on option = { name = influence.60.c log = "[GetDateText]: [This.GetName]: influence.60.c executed" add_stability = -0.02 ai_chance = { base = 30 modifier = { add = 30 has_war = yes } modifier = { add = 25 has_government = nationalist } modifier = { add = 15 has_government = fascism } modifier = { add = 10 num_of_factories < 30 } modifier = { add = 20 has_opinion = { target = event_target:coup_contest_sender value > 0 } } } } } # Coup Contest (civil war variant) — major influencer can back the old regime country_event = { id = influence.61 title = influence.61.t desc = influence.61.d picture = GFX_politics_surveillence is_triggered_only = yes trigger = { event_target:coup_contest_sender = { exists = yes } event_target:coup_contest_victim = { exists = yes has_civil_war = yes } NOT = { has_country_flag = collapsed_nation } } # Arm the old regime with equipment, volunteers, and diplomatic backing option = { name = influence.61.a log = "[GetDateText]: [This.GetName]: influence.61.a executed" send_equipment = { amount = 3000 type = infantry_weapons_1 target = event_target:coup_contest_victim } send_equipment = { amount = 200 type = util_vehicle_type target = event_target:coup_contest_victim } add_relation_modifier = { target = event_target:coup_contest_victim modifier = generic_increased_military_support } event_target:coup_contest_victim = { add_stability = 0.03 add_war_support = 0.05 } add_political_power = -75 hidden_effect = { every_country = { limit = { is_ai = no } news_event = { id = News_influence.9 days = 1 } } } ai_chance = { base = 40 modifier = { add = 30 has_opinion = { target = event_target:coup_contest_sender value < -20 } } modifier = { add = 20 has_government = democratic event_target:coup_contest_victim = { has_government = democratic } } modifier = { add = 15 has_idea = great_power } modifier = { add = 20 has_idea = super_power } modifier = { factor = 1.3 has_government = communism event_target:coup_contest_victim = { has_government = communism } } modifier = { factor = 0.6 has_government = nationalist } modifier = { factor = 0.6 num_of_military_factories < 25 } modifier = { factor = 0 has_war = yes } } } # Provide economic aid only — keep the regime afloat without getting our hands dirty option = { name = influence.61.b log = "[GetDateText]: [This.GetName]: influence.61.b executed" event_target:coup_contest_victim = { set_temp_variable = { treasury_change = 100 } modify_treasury_effect = yes add_stability = 0.02 } add_relation_modifier = { target = event_target:coup_contest_victim modifier = generic_increased_cooperation } set_temp_variable = { treasury_change = -100 } modify_treasury_effect = yes add_political_power = -40 ai_chance = { base = 30 modifier = { add = 15 has_opinion = { target = event_target:coup_contest_sender value < 0 } } modifier = { add = 10 num_of_military_factories < 30 } modifier = { add = 10 has_war = yes } modifier = { factor = 1.4 has_government = democratic } modifier = { factor = 1.3 has_government = neutrality } modifier = { factor = 0.7 has_government = communism } } } # Full military intervention — commit to the old regime's victory option = { name = influence.61.e log = "[GetDateText]: [This.GetName]: influence.61.e executed" add_relation_modifier = { target = event_target:coup_contest_victim modifier = generic_military_intervention } send_equipment = { amount = 5000 type = infantry_weapons_1 target = event_target:coup_contest_victim } send_equipment = { amount = 400 type = util_vehicle_type target = event_target:coup_contest_victim } event_target:coup_contest_victim = { add_stability = 0.05 add_war_support = 0.08 } add_opinion_modifier = { target = event_target:coup_contest_sender modifier = attacked_our_influence } event_target:coup_contest_sender = { add_opinion_modifier = { target = PREV modifier = attacked_our_influence } } set_temp_variable = { percent_change = 20 } set_temp_variable = { tag_index = THIS.id } set_temp_variable = { influence_target = event_target:coup_contest_victim.id } change_influence_percentage = yes add_political_power = -150 add_war_support = 0.05 add_threat = 3 hidden_effect = { every_country = { limit = { is_ai = no } news_event = { id = News_influence.10 days = 1 } } } ai_chance = { base = 8 modifier = { add = 20 event_target:coup_contest_sender = { OR = { original_tag = CHI original_tag = SOV original_tag = PER } } } modifier = { add = 10 event_target:coup_contest_sender = { has_added_tension_amount > 30 } } modifier = { add = 15 has_government = democratic event_target:coup_contest_victim = { has_government = democratic } } modifier = { add = 15 has_idea = super_power } modifier = { add = 8 has_idea = great_power } modifier = { factor = 1.3 has_country_leader = { name = "Donald Trump" } } modifier = { factor = 0.5 has_government = neutrality } modifier = { factor = 0 has_war = yes } modifier = { factor = 0.3 threat > 0.70 } modifier = { factor = 0 num_of_military_factories < 50 } modifier = { factor = 0 is_in_faction_with = event_target:coup_contest_sender } } } # Stay out option = { name = influence.61.c ai_chance = { base = 30 modifier = { add = 30 has_war = yes } modifier = { add = 25 has_government = nationalist } modifier = { add = 15 has_government = fascism } modifier = { add = 10 num_of_factories < 30 } modifier = { add = 15 has_idea = no_military } modifier = { factor = 0.7 has_government = democratic } } } } country_event = { id = influence.50 hidden = yes is_triggered_only = yes immediate = { save_event_target_as = military_aid_target event_target:influence_sender = { country_event = influence.51 } } } #Send Military Aid to [FROM.GetName] country_event = { id = influence.51 title = influence.51.t desc = influence.51.d picture = GFX_handgun is_triggered_only = yes #Consider the Military Offer option = { name = influence.51.a log = "[GetDateText]: [THIS.GetName]: influence.51.a executed" custom_effect_tooltip = influence.51.a_tt country_event = influence.52 ai_chance = { base = 2 # Recipient situation modifier = { add = 3 event_target:military_aid_target = { has_war = yes } } modifier = { add = 2 event_target:military_aid_target = { surrender_progress > 0.10 } } modifier = { add = 2 is_in_faction_with = event_target:military_aid_target } modifier = { add = 1 has_opinion = { target = event_target:military_aid_target value > 20 } } modifier = { add = 2 has_opinion = { target = event_target:military_aid_target value > 50 } } modifier = { add = 2 event_target:military_aid_target = { OR = { has_war_with = CHI has_war_with = SOV has_war_with = PER } } } # Sender personality modifier = { factor = 1.3 has_government = democratic } modifier = { factor = 1.2 has_government = communism } modifier = { factor = 0.7 has_government = nationalist } modifier = { factor = 0.5 has_government = fascism } # Power projection modifier = { factor = 1.4 has_idea = super_power } modifier = { factor = 1.2 has_idea = great_power } # Strategic constraints modifier = { factor = 1.3 threat > 0.40 } modifier = { factor = 0.7 has_war = yes } modifier = { factor = 0.5 num_of_military_factories < 20 } modifier = { factor = 0.5 has_idea = no_military } # Hard floors modifier = { factor = 0 has_opinion = { target = event_target:military_aid_target value < -20 } } modifier = { factor = 0 has_war_with = event_target:military_aid_target } #Macabre Alliance modifier = { factor = 9 ENG = { has_idea = ENG_the_macabre_alliance } original_tag = COL } } } option = { name = influence.51.b log = "[GetDateText]: [This.GetName]: influence.51.b executed" custom_effect_tooltip = influence.51.b_tt event_target:military_aid_target = { ROOT = { clr_country_flag = recently_sent_military_aid@PREV } } ai_chance = { base = 2 modifier = { add = 3 has_opinion = { target = event_target:military_aid_target value < 0 } } modifier = { add = 2 has_opinion = { target = event_target:military_aid_target value < -30 } } modifier = { add = 3 has_war = yes } modifier = { add = 2 num_of_military_factories < 15 } modifier = { add = 2 has_idea = no_military } # Personality modifier = { factor = 1.5 has_government = nationalist } modifier = { factor = 1.5 has_government = fascism } modifier = { factor = 0.7 has_government = democratic } # Hard floors modifier = { factor = 0 event_target:military_aid_target = { has_war = yes } has_opinion = { target = event_target:military_aid_target value > 30 } } modifier = { factor = 0 is_in_faction_with = event_target:military_aid_target event_target:military_aid_target = { has_war = yes } } } } } #What weapons do you want to send? country_event = { id = influence.52 title = influence.52.t desc = influence.52.d picture = GFX_handgun is_triggered_only = yes #Small Arms / Anti-Tank / AA package — pick a size next option = { name = influence.52.a trigger = { OR = { has_equipment = { infantry_weapons_type > 250 } has_equipment = { L_AT_Equipment > 10 } has_equipment = { AA_Equipment > 10 } } } log = "[GetDateText]: [This.GetName]: influence.52.a executed" set_country_flag = shipment_of_infantry_weapons custom_effect_tooltip = influence.52.a_preview_tt country_event = influence.57 ai_chance = { base = 3 modifier = { add = 2 event_target:military_aid_target = { has_war = yes } } modifier = { add = 2 event_target:military_aid_target = { has_equipment = { infantry_weapons_type < 1000 } } } modifier = { factor = 1.3 has_equipment = { infantry_weapons_type > 5000 } } modifier = { factor = 0.7 has_government = communism } modifier = { factor = 0.7 has_government = democratic } modifier = { factor = 1.2 has_government = nationalist } } } #Vehicles & Armor (now includes regular MBT chassis) option = { name = influence.52.b trigger = { OR = { has_equipment = { medium_tank_chassis > 10 } has_equipment = { medium_tank_amphibious_chassis > 10 } has_equipment = { medium_tank_flame_chassis > 10 } has_equipment = { util_vehicle_type > 10 } } } log = "[GetDateText]: [This.GetName]: influence.52.b executed" set_country_flag = forwarding_light_armor_vehicles custom_effect_tooltip = influence.52.b_preview_tt country_event = influence.57 ai_chance = { base = 2 modifier = { add = 2 event_target:military_aid_target = { has_war = yes } } modifier = { add = 1 event_target:military_aid_target = { has_equipment = { medium_tank_chassis < 200 } } } modifier = { factor = 1.3 has_equipment = { medium_tank_chassis > 500 } } modifier = { factor = 1.2 has_government = democratic } modifier = { factor = 1.2 has_government = communism } modifier = { factor = 0.8 num_of_military_factories < 30 } } } #Modern Equipment Package (Heavy AT, SAM, drones) option = { name = influence.52.e trigger = { OR = { has_equipment = { H_AT_Equipment > 10 } has_equipment = { sam_missile_equipment > 5 } has_equipment = { land_drone_equipment_type > 5 } } } log = "[GetDateText]: [This.GetName]: influence.52.e executed" set_country_flag = sending_modern_equipment_package custom_effect_tooltip = influence.52.e_preview_tt country_event = influence.57 ai_chance = { base = 1 modifier = { add = 3 event_target:military_aid_target = { has_war = yes } is_in_faction_with = event_target:military_aid_target } modifier = { add = 2 event_target:military_aid_target = { OR = { has_war_with = CHI has_war_with = SOV has_war_with = PER } } } modifier = { add = 2 has_idea = super_power } modifier = { add = 1 has_idea = great_power } modifier = { factor = 1.5 has_government = democratic } modifier = { factor = 1.3 has_government = communism } modifier = { factor = 0.6 has_government = nationalist } modifier = { factor = 0.5 num_of_military_factories < 25 } modifier = { factor = 0 has_opinion = { target = event_target:military_aid_target value < 0 } } } } option = { name = influence.52.c log = "[GetDateText]: [This.GetName]: influence.52.c executed" event_target:military_aid_target = { ROOT = { clr_country_flag = recently_sent_military_aid@PREV } } ai_chance = { base = 1 modifier = { factor = 3 has_war = yes } modifier = { factor = 2 num_of_military_factories < 15 } modifier = { factor = 0.5 event_target:military_aid_target = { surrender_progress > 0.10 } } } } } #Pick the size of the aid package country_event = { id = influence.57 title = influence.57.t desc = influence.57.d picture = GFX_handgun is_triggered_only = yes #Small package option = { name = influence.57.a log = "[GetDateText]: [This.GetName]: influence.57.a executed" add_political_power = -25 event_target:military_aid_target = { country_event = influence.53 } custom_effect_tooltip = TT_IF_THEY_ACCEPT if = { limit = { has_country_flag = shipment_of_infantry_weapons } effect_tooltip = { send_equipment = { type = infantry_weapons_type amount = 250 target = event_target:military_aid_target } send_equipment = { type = L_AT_Equipment amount = 10 target = event_target:military_aid_target } send_equipment = { type = AA_Equipment amount = 10 target = event_target:military_aid_target } } } else_if = { limit = { has_country_flag = forwarding_light_armor_vehicles } effect_tooltip = { send_equipment = { type = medium_tank_chassis amount = 10 target = event_target:military_aid_target } send_equipment = { type = medium_tank_amphibious_chassis amount = 10 target = event_target:military_aid_target } send_equipment = { type = medium_tank_flame_chassis amount = 10 target = event_target:military_aid_target } send_equipment = { type = util_vehicle_type amount = 10 target = event_target:military_aid_target } } } else_if = { limit = { has_country_flag = sending_modern_equipment_package } effect_tooltip = { send_equipment = { type = H_AT_Equipment amount = 10 target = event_target:military_aid_target } send_equipment = { type = sam_missile_equipment amount = 5 target = event_target:military_aid_target } send_equipment = { type = land_drone_equipment_type amount = 5 target = event_target:military_aid_target } } } ai_chance = { base = 5 modifier = { add = 2 has_opinion = { target = event_target:military_aid_target value < 30 } } modifier = { add = 1 num_of_military_factories < 30 } modifier = { factor = 1.5 has_government = democratic } modifier = { factor = 1.3 has_government = neutrality } modifier = { factor = 0.7 has_government = communism } modifier = { factor = 0.7 has_idea = super_power } } } #Medium package option = { name = influence.57.b log = "[GetDateText]: [This.GetName]: influence.57.b executed" set_country_flag = aid_package_medium add_political_power = -75 add_threat = 1 event_target:military_aid_target = { country_event = influence.53 } custom_effect_tooltip = TT_IF_THEY_ACCEPT if = { limit = { has_country_flag = shipment_of_infantry_weapons } effect_tooltip = { send_equipment = { type = infantry_weapons_type amount = 750 target = event_target:military_aid_target } send_equipment = { type = L_AT_Equipment amount = 30 target = event_target:military_aid_target } send_equipment = { type = AA_Equipment amount = 30 target = event_target:military_aid_target } } } else_if = { limit = { has_country_flag = forwarding_light_armor_vehicles } effect_tooltip = { send_equipment = { type = medium_tank_chassis amount = 30 target = event_target:military_aid_target } send_equipment = { type = medium_tank_amphibious_chassis amount = 30 target = event_target:military_aid_target } send_equipment = { type = medium_tank_flame_chassis amount = 30 target = event_target:military_aid_target } send_equipment = { type = util_vehicle_type amount = 30 target = event_target:military_aid_target } } } else_if = { limit = { has_country_flag = sending_modern_equipment_package } effect_tooltip = { send_equipment = { type = H_AT_Equipment amount = 30 target = event_target:military_aid_target } send_equipment = { type = sam_missile_equipment amount = 15 target = event_target:military_aid_target } send_equipment = { type = land_drone_equipment_type amount = 15 target = event_target:military_aid_target } } } ai_chance = { base = 3 modifier = { add = 4 event_target:military_aid_target = { has_war = yes } } modifier = { add = 2 is_in_faction_with = event_target:military_aid_target } modifier = { add = 2 has_opinion = { target = event_target:military_aid_target value > 40 } } modifier = { add = 1 has_idea = great_power } modifier = { factor = 1.3 has_government = democratic } modifier = { factor = 1.2 has_government = communism } modifier = { factor = 0.5 num_of_military_factories < 20 } } } #Large package option = { name = influence.57.c log = "[GetDateText]: [This.GetName]: influence.57.c executed" set_country_flag = aid_package_large add_political_power = -150 add_threat = 2 event_target:military_aid_target = { country_event = influence.53 } custom_effect_tooltip = TT_IF_THEY_ACCEPT if = { limit = { has_country_flag = shipment_of_infantry_weapons } effect_tooltip = { send_equipment = { type = infantry_weapons_type amount = 1250 target = event_target:military_aid_target } send_equipment = { type = L_AT_Equipment amount = 50 target = event_target:military_aid_target } send_equipment = { type = AA_Equipment amount = 50 target = event_target:military_aid_target } } } else_if = { limit = { has_country_flag = forwarding_light_armor_vehicles } effect_tooltip = { send_equipment = { type = medium_tank_chassis amount = 50 target = event_target:military_aid_target } send_equipment = { type = medium_tank_amphibious_chassis amount = 50 target = event_target:military_aid_target } send_equipment = { type = medium_tank_flame_chassis amount = 50 target = event_target:military_aid_target } send_equipment = { type = util_vehicle_type amount = 50 target = event_target:military_aid_target } } } else_if = { limit = { has_country_flag = sending_modern_equipment_package } effect_tooltip = { send_equipment = { type = H_AT_Equipment amount = 50 target = event_target:military_aid_target } send_equipment = { type = sam_missile_equipment amount = 25 target = event_target:military_aid_target } send_equipment = { type = land_drone_equipment_type amount = 25 target = event_target:military_aid_target } } } ai_chance = { base = 1 modifier = { add = 5 event_target:military_aid_target = { has_war = yes } is_in_faction_with = event_target:military_aid_target } modifier = { add = 3 event_target:military_aid_target = { surrender_progress > 0.20 } } modifier = { add = 2 event_target:military_aid_target = { OR = { has_war_with = CHI has_war_with = SOV has_war_with = PER } } } modifier = { add = 2 has_idea = super_power } modifier = { factor = 1.5 has_government = communism } modifier = { factor = 1.3 has_government = democratic } modifier = { factor = 0 NOT = { is_in_faction_with = event_target:military_aid_target } } modifier = { factor = 0 has_war = yes } modifier = { factor = 0 num_of_military_factories < 30 } } } option = { name = influence.57.e log = "[GetDateText]: [This.GetName]: influence.57.e executed" clr_country_flag = shipment_of_infantry_weapons clr_country_flag = forwarding_light_armor_vehicles clr_country_flag = sending_modern_equipment_package event_target:military_aid_target = { ROOT = { clr_country_flag = recently_sent_military_aid@PREV } } ai_chance = { base = 1 modifier = { add = 3 num_of_military_factories < 20 } modifier = { add = 2 has_war = yes } } } } #Receiver Event — accepts or rejects a military aid package, scaled by package type and size flags country_event = { id = influence.53 title = influence.53.t desc = influence.53.d picture = GFX_handgun is_triggered_only = yes immediate = { # Compute the size multiplier from the size flag set in influence.57 set_variable = { aid_size_mult = 1 } if = { limit = { FROM = { has_country_flag = aid_package_medium } } set_variable = { aid_size_mult = 3 } } else_if = { limit = { FROM = { has_country_flag = aid_package_large } } set_variable = { aid_size_mult = 5 } } # Capture whether modern equipment was sent, before flags are cleared in the option set_variable = { aid_was_modern = 0 } if = { limit = { FROM = { has_country_flag = sending_modern_equipment_package } } set_variable = { aid_was_modern = 1 } } } # Accept the package option = { name = influence.53.a log = "[GetDateText]: [This.GetName]: influence.53.a executed" # Infantry package — small arms, light AT, AA if = { limit = { FROM = { has_country_flag = shipment_of_infantry_weapons } } FROM = { clr_country_flag = shipment_of_infantry_weapons } set_temp_variable = { infantry_amount = 250 } multiply_temp_variable = { infantry_amount = aid_size_mult } set_temp_variable = { support_amount = 10 } multiply_temp_variable = { support_amount = aid_size_mult } FROM = { if = { limit = { has_equipment = { infantry_weapons_type > 250 } } send_equipment = { type = infantry_weapons_type amount = infantry_amount target = PREV } } if = { limit = { has_equipment = { L_AT_Equipment > 10 } } send_equipment = { type = L_AT_Equipment amount = support_amount target = PREV } } if = { limit = { has_equipment = { AA_Equipment > 10 } } send_equipment = { type = AA_Equipment amount = support_amount target = PREV } } } set_temp_variable = { percent_change = 1.5 } set_temp_variable = { tag_index = FROM.id } change_influence_percentage = yes } # Vehicle package — MBT, amphibious, flame, utility if = { limit = { FROM = { has_country_flag = forwarding_light_armor_vehicles } } FROM = { clr_country_flag = forwarding_light_armor_vehicles } set_temp_variable = { vehicle_amount = 10 } multiply_temp_variable = { vehicle_amount = aid_size_mult } FROM = { if = { limit = { has_equipment = { medium_tank_chassis > 10 } } send_equipment = { type = medium_tank_chassis amount = vehicle_amount target = PREV } } if = { limit = { has_equipment = { medium_tank_amphibious_chassis > 10 } } send_equipment = { type = medium_tank_amphibious_chassis amount = vehicle_amount target = PREV } } if = { limit = { has_equipment = { medium_tank_flame_chassis > 10 } } send_equipment = { type = medium_tank_flame_chassis amount = vehicle_amount target = PREV } } if = { limit = { has_equipment = { util_vehicle_type > 10 } } send_equipment = { type = util_vehicle_type amount = vehicle_amount target = PREV } } } set_temp_variable = { percent_change = 2 } set_temp_variable = { tag_index = FROM.id } change_influence_percentage = yes } # Modern equipment package — heavy AT, SAMs, drones if = { limit = { FROM = { has_country_flag = sending_modern_equipment_package } } FROM = { clr_country_flag = sending_modern_equipment_package } set_temp_variable = { modern_amount = 10 } multiply_temp_variable = { modern_amount = aid_size_mult } set_temp_variable = { drone_amount = 5 } multiply_temp_variable = { drone_amount = aid_size_mult } FROM = { if = { limit = { has_equipment = { H_AT_Equipment > 10 } } send_equipment = { type = H_AT_Equipment amount = modern_amount target = PREV } } if = { limit = { has_equipment = { sam_missile_equipment > 5 } } send_equipment = { type = sam_missile_equipment amount = drone_amount target = PREV } } if = { limit = { has_equipment = { land_drone_equipment_type > 5 } } send_equipment = { type = land_drone_equipment_type amount = drone_amount target = PREV } } } set_temp_variable = { percent_change = 3 } set_temp_variable = { tag_index = FROM.id } change_influence_percentage = yes } # Cleanup size flags FROM = { clr_country_flag = aid_package_medium clr_country_flag = aid_package_large } set_country_flag = { flag = received_military_aid_recently@FROM days = 90 value = 1 } # Every nation we are at war with takes a serious diplomatic hit at the donor every_enemy_country = { add_opinion_modifier = { target = FROM modifier = armed_our_enemy } } # News event for major arms transfers — differentiated by package type if = { limit = { OR = { check_variable = { aid_was_modern = 1 } check_variable = { aid_size_mult > 4 } } } # Modern equipment package gets its own (more provocative) news flavor if = { limit = { check_variable = { aid_was_modern = 1 } } hidden_effect = { every_country = { limit = { is_ai = no } news_event = { id = News_influence.12 days = 1 } } } } else = { # Large conventional package hidden_effect = { every_country = { limit = { is_ai = no } news_event = { id = News_influence.11 days = 1 } } } } } # Clear persistent helper variables after news event checks clear_variable = aid_size_mult clear_variable = aid_was_modern FROM = { country_event = diplomatic_response.1 } ai_chance = { base = 1 modifier = { #Sacrifice Influence for free guns OR = { has_equipment = { infantry_weapons_type < 250 } has_equipment = { L_AT_Equipment < 10 } has_equipment = { AA_Equipment < 10 } } factor = 100 } modifier = { factor = 0.01 has_government = nationalist } modifier = { any_enemy_country = { num_of_factories > num_of_factories@ROOT } factor = 10 } modifier = { factor = 10 num_of_military_factories < 10 } modifier = { has_war = yes factor = 1.5 } modifier = { any_neighbor_country = { is_justifying_wargoal_against = THIS } factor = 2.0 } modifier = { factor = 0.01 has_government = fascism ROOT = { NOT = { has_government = fascism } } } modifier = { factor = 0.90 has_opinion = { target = FROM value < 10 } } modifier = { factor = 0.80 has_opinion = { target = FROM value < -10 } } modifier = { factor = 0.65 has_opinion = { target = FROM value < -30 } } modifier = { factor = 0.40 has_opinion = { target = FROM value < -60 } } modifier = { factor = 0.30 has_opinion = { target = FROM value < -80 } } modifier = { factor = 0.10 has_opinion = { target = FROM value < -90 } } modifier = { factor = 0 has_opinion = { target = FROM value < -100 } } } } # Refusal option = { name = influence.53.c log = "[GetDateText]: [This.GetName]: influence.53.c executed" FROM = { clr_country_flag = shipment_of_infantry_weapons clr_country_flag = forwarding_light_armor_vehicles clr_country_flag = sending_modern_equipment_package clr_country_flag = aid_package_medium clr_country_flag = aid_package_large } if = { limit = { NOT = { has_country_flag = refused_military_aid } } set_temp_variable = { percent_change = 2 } change_domestic_influence_percentage = yes set_country_flag = { flag = refused_military_aid value = 1 days = 180 } custom_effect_tooltip = domestic_influence_six_months_TT } else = { custom_effect_tooltip = domestic_timer_military_aid_tt } FROM = { country_event = diplomatic_response.2 } ai_chance = { #Should be more likely to reject if they don't need it base = 5 modifier = { factor = 100 has_idea = no_military } modifier = { OR = { has_government = nationalist has_government = fascism } factor = 1.5 } modifier = { factor = 0.1 has_war = yes } modifier = { factor = 0.1 num_of_military_factories < 10 } } } } # Auto-Influencer Report country_event = { id = influence.54 title = influence.54.t desc = influence.54.d picture = GFX_politics_talks is_triggered_only = yes trigger = { NOT = { has_country_flag = disable_auto_influence_notification } } immediate = { clear_array = auto_influence_target_val for_each_loop = { array = auto_influence_target_array value = report_target set_variable = { ROOT.found_influence_val = 0 } var:report_target = { set_temp_variable = { influencer_index = -1 } for_loop_effect = { end = influence_array^num value = v if = { limit = { check_variable = { influence_array^v = ROOT } } set_temp_variable = { influencer_index = v } } } if = { limit = { NOT = { check_variable = { influencer_index = -1 } } } set_variable = { ROOT.found_influence_val = influence_array_val^influencer_index } } } add_to_array = { auto_influence_target_val = found_influence_val } } clear_variable = found_influence_val } option = { name = influence.54.a log = "[GetDateText]: [This.GetName]: influence.54.a executed" clear_variable = nations_influenced } } #Send Military Supply to [THIS.GetName] country_event = { id = influence.56 title = influence.56.t desc = influence.56.d picture = GFX_weapons_arms1 is_triggered_only = yes #Send a Shipment around on Target size power etc option = { name = influence.56.a log = "[GetDateText]: [This.GetName]: influence.56.a executed" trigger = { PREV = { original_tag = PER has_equipment = { infantry_weapons_type > 250 } } } PER_scripted_effect_update_palestine_arms_via_land = yes ai_chance = { base = 1 } } option = { name = influence.56.b log = "[GetDateText]: [This.GetName]: influence.56.b executed" trigger = { PREV = { original_tag = PER has_equipment = { infantry_weapons_type > 250 } } event_target:military_supply_target = { any_owned_state = { is_coastal = yes } } } PER_scripted_effect_update_palestine_arms_via_sea = yes ai_chance = { base = 1 } } #Maybe its better not option = { name = influence.56.c log = "[GetDateText]: [This.GetName]: influence.56.c executed" custom_effect_tooltip = influence.51.b_tt event_target:military_supply_target = { ROOT = { clr_country_flag = recently_sent_military_aid@PREV } } ai_chance = { base = 0 } } } # Influence Master Event country_event = { id = influence.500 hidden = yes is_triggered_only = yes trigger = { is_ai = yes has_political_power > 200 # Do not influence in the situation you are in a looming bankruptcy NOT = { has_active_mission = bankruptcy_incoming_collapse } # Do not influence in the instance you are a subject is_subject = no } immediate = { if = { limit = { is_debug = yes } log = "[GetDateText]: [THIS.GetName]: DEBUG: AI Influence Pulse" } save_event_target_as = influence_sender AI_select_influence_target = yes # Check Investing Country if = { limit = { OR = { check_variable = { AI_best_country_score = -1 } check_variable = { AI_best_country_score < AI_minimum_influence } } } log = "[GetDateText]: [This.GetName]: Influence Failed. No valid influence country. Skipping this influence pulse." } else = { log = "[GetDateText]: [This.GetName]: Influence Country Succeeded. [?var:AI_best_country.GetName] scored a [?AI_best_country_score]" var:AI_best_country = { spread_influence = yes } } } } #Foreign lobbying has locked our government out of combating one influencer country_event = { id = influence.62 title = influence.62.t desc = influence.62.d picture = GFX_politics_negotiations is_triggered_only = yes option = { name = influence.62.a } }