SIA_increase_military_approval = { if = { limit = { NOT = { has_country_flag = SIA_turn_off_the_khana_ratsadon } } #custom_effect_tooltip = SIA_increase_military_support_tt if = { limit = { has_idea = idea_SIA_military_rebellious } swap_ideas = { remove_idea = idea_SIA_military_rebellious add_idea = idea_SIA_military_opposition } } else_if = { limit = { has_idea = idea_SIA_military_opposition } swap_ideas = { remove_idea = idea_SIA_military_opposition add_idea = idea_SIA_military_neutral } } else_if = { limit = { has_idea = idea_SIA_military_neutral } swap_ideas = { remove_idea = idea_SIA_military_neutral add_idea = idea_SIA_military_slight_support } } else_if = { limit = { has_idea = idea_SIA_military_slight_support } swap_ideas = { remove_idea = idea_SIA_military_slight_support add_idea = idea_SIA_military_full_support } } else_if = { limit = { has_idea = idea_SIA_military_full_support } } } } SIA_decrease_military_approval = { if = { limit = { NOT = { has_country_flag = SIA_turn_off_the_khana_ratsadon } } #custom_effect_tooltip = SIA_decrease_military_approval_tt if = { limit = { has_idea = idea_SIA_military_rebellious } } else_if = { limit = { has_idea = idea_SIA_military_opposition } swap_ideas = { remove_idea = idea_SIA_military_opposition add_idea = idea_SIA_military_rebellious } } else_if = { limit = { has_idea = idea_SIA_military_neutral } swap_ideas = { remove_idea = idea_SIA_military_neutral add_idea = idea_SIA_military_opposition } } else_if = { limit = { has_idea = idea_SIA_military_slight_support } swap_ideas = { remove_idea = idea_SIA_military_slight_support add_idea = idea_SIA_military_neutral } } else_if = { limit = { has_idea = idea_SIA_military_full_support } swap_ideas = { remove_idea = idea_SIA_military_full_support add_idea = idea_SIA_military_slight_support } } } } SIA_increase_civilian_approval = { if = { limit = { NOT = { has_country_flag = SIA_turn_off_the_khana_ratsadon } } #custom_effect_tooltip = SIA_increase_civilian_approval_tt if = { limit = { has_idea = idea_SIA_civilian_rebellious } swap_ideas = { remove_idea = idea_SIA_civilian_rebellious add_idea = idea_SIA_civilian_opposition } } else_if = { limit = { has_idea = idea_SIA_civilian_opposition } swap_ideas = { remove_idea = idea_SIA_civilian_opposition add_idea = idea_SIA_civilian_neutral } } else_if = { limit = { has_idea = idea_SIA_civilian_neutral } swap_ideas = { remove_idea = idea_SIA_civilian_neutral add_idea = idea_SIA_civilian_slight_support } } else_if = { limit = { has_idea = idea_SIA_civilian_slight_support } swap_ideas = { remove_idea = idea_SIA_civilian_slight_support add_idea = idea_SIA_civilian_full_support } } else_if = { limit = { has_idea = idea_SIA_civilian_full_support } } } } SIA_decrease_civilian_approval = { if = { limit = { NOT = { has_country_flag = SIA_turn_off_the_khana_ratsadon } } #custom_effect_tooltip = SIA_decrease_civilian_approval_tt if = { limit = { has_idea = idea_SIA_civilian_rebellious } } else_if = { limit = { has_idea = idea_SIA_civilian_opposition } swap_ideas = { remove_idea = idea_SIA_civilian_opposition add_idea = idea_SIA_civilian_rebellious } } else_if = { limit = { has_idea = idea_SIA_civilian_neutral } swap_ideas = { remove_idea = idea_SIA_civilian_neutral add_idea = idea_SIA_civilian_opposition } } else_if = { limit = { has_idea = idea_SIA_civilian_slight_support } swap_ideas = { remove_idea = idea_SIA_civilian_slight_support add_idea = idea_SIA_civilian_neutral } } else_if = { limit = { has_idea = idea_SIA_civilian_full_support } swap_ideas = { remove_idea = idea_SIA_civilian_full_support add_idea = idea_SIA_civilian_slight_support } } } } #2 support increase/decrease SIA_increase_military_approval_2 = { if = { limit = { NOT = { has_country_flag = SIA_turn_off_the_khana_ratsadon } } #custom_effect_tooltip = SIA_increase_military_approval_2_tt if = { limit = { has_idea = idea_SIA_military_rebellious } swap_ideas = { remove_idea = idea_SIA_military_rebellious add_idea = idea_SIA_military_neutral } } else_if = { limit = { has_idea = idea_SIA_military_opposition } swap_ideas = { remove_idea = idea_SIA_military_opposition add_idea = idea_SIA_military_slight_support } } else_if = { limit = { has_idea = idea_SIA_military_neutral } swap_ideas = { remove_idea = idea_SIA_military_neutral add_idea = idea_SIA_military_full_support } } else_if = { limit = { has_idea = idea_SIA_military_slight_support } swap_ideas = { remove_idea = idea_SIA_military_slight_support add_idea = idea_SIA_military_full_support } } else_if = { limit = { has_idea = idea_SIA_military_full_support } } } } SIA_decrease_military_approval_2 = { if = { limit = { NOT = { has_country_flag = SIA_turn_off_the_khana_ratsadon } } #custom_effect_tooltip = SIA_decrease_military_approval_2_tt if = { limit = { has_idea = idea_SIA_military_rebellious } add_stability = -0.33 } else_if = { limit = { has_idea = idea_SIA_military_opposition } swap_ideas = { remove_idea = idea_SIA_military_opposition add_idea = idea_SIA_military_rebellious } } else_if = { limit = { has_idea = idea_SIA_military_neutral } swap_ideas = { remove_idea = idea_SIA_military_neutral add_idea = idea_SIA_military_rebellious } } else_if = { limit = { has_idea = idea_SIA_military_slight_support } swap_ideas = { remove_idea = idea_SIA_military_slight_support add_idea = idea_SIA_military_opposition } } else_if = { limit = { has_idea = idea_SIA_military_full_support } swap_ideas = { remove_idea = idea_SIA_military_full_support add_idea = idea_SIA_military_neutral } } } } SIA_increase_civilian_approval_2 = { if = { limit = { NOT = { has_country_flag = SIA_turn_off_the_khana_ratsadon } } #custom_effect_tooltip = SIA_increase_civilian_approval_2_tt if = { limit = { has_idea = idea_SIA_civilian_rebellious } swap_ideas = { remove_idea = idea_SIA_civilian_rebellious add_idea = idea_SIA_civilian_neutral } } else_if = { limit = { has_idea = idea_SIA_civilian_opposition } swap_ideas = { remove_idea = idea_SIA_civilian_opposition add_idea = idea_SIA_civilian_slight_support } } else_if = { limit = { has_idea = idea_SIA_civilian_neutral } swap_ideas = { remove_idea = idea_SIA_civilian_neutral add_idea = idea_SIA_civilian_full_support } } else_if = { limit = { has_idea = idea_SIA_civilian_slight_support } swap_ideas = { remove_idea = idea_SIA_civilian_slight_support add_idea = idea_SIA_civilian_full_support } } else_if = { limit = { has_idea = idea_SIA_civilian_full_support } add_stability = 0.06 } } } SIA_decrease_civilian_approval_2 = { if = { limit = { NOT = { has_country_flag = SIA_turn_off_the_khana_ratsadon } } #custom_effect_tooltip = SIA_decrease_civilian_approval_2_tt if = { limit = { has_idea = idea_SIA_civilian_rebellious } add_stability = -0.33 } else_if = { limit = { has_idea = idea_SIA_civilian_opposition } swap_ideas = { remove_idea = idea_SIA_civilian_opposition add_idea = idea_SIA_civilian_rebellious } } else_if = { limit = { has_idea = idea_SIA_civilian_neutral } swap_ideas = { remove_idea = idea_SIA_civilian_neutral add_idea = idea_SIA_civilian_rebellious } } else_if = { limit = { has_idea = idea_SIA_civilian_slight_support } swap_ideas = { remove_idea = idea_SIA_civilian_slight_support add_idea = idea_SIA_civilian_opposition } } else_if = { limit = { has_idea = idea_SIA_civilian_full_support } swap_ideas = { remove_idea = idea_SIA_civilian_full_support add_idea = idea_SIA_civilian_neutral } } } } #3 support increase/decrease SIA_increase_military_approval_3 = { if = { limit = { NOT = { has_country_flag = SIA_turn_off_the_khana_ratsadon } } #custom_effect_tooltip = SIA_increase_military_approval_3_tt if = { limit = { has_idea = idea_SIA_military_rebellious } swap_ideas = { remove_idea = idea_SIA_military_rebellious add_idea = idea_SIA_military_slight_support } } else_if = { limit = { has_idea = idea_SIA_military_opposition } swap_ideas = { remove_idea = idea_SIA_military_opposition add_idea = idea_SIA_military_full_support } } else_if = { limit = { has_idea = idea_SIA_military_neutral } swap_ideas = { remove_idea = idea_SIA_military_neutral add_idea = idea_SIA_military_full_support } } else_if = { limit = { has_idea = idea_SIA_military_slight_support } swap_ideas = { remove_idea = idea_SIA_military_slight_support add_idea = idea_SIA_military_full_support } army_experience = 20 } else_if = { limit = { has_idea = idea_SIA_military_full_support } army_experience = 40 } } } SIA_decrease_military_approval_3 = { if = { limit = { NOT = { has_country_flag = SIA_turn_off_the_khana_ratsadon } } #custom_effect_tooltip = SIA_decrease_military_approval_3_tt if = { limit = { has_idea = idea_SIA_military_rebellious } add_stability = -0.5 add_war_support = -0.5 } else_if = { limit = { has_idea = idea_SIA_military_opposition } swap_ideas = { remove_idea = idea_SIA_military_opposition add_idea = idea_SIA_military_rebellious } } else_if = { limit = { has_idea = idea_SIA_military_neutral } swap_ideas = { remove_idea = idea_SIA_military_neutral add_idea = idea_SIA_military_rebellious } } else_if = { limit = { has_idea = idea_SIA_military_slight_support } swap_ideas = { remove_idea = idea_SIA_military_slight_support add_idea = idea_SIA_military_rebellious } } else_if = { limit = { has_idea = idea_SIA_military_full_support } swap_ideas = { remove_idea = idea_SIA_military_full_support add_idea = idea_SIA_military_opposition } } } } SIA_increase_civilian_approval_3 = { if = { limit = { NOT = { has_country_flag = SIA_turn_off_the_khana_ratsadon } } #custom_effect_tooltip = SIA_increase_civilian_approval_3_tt if = { limit = { has_idea = idea_SIA_civilian_rebellious } swap_ideas = { remove_idea = idea_SIA_civilian_rebellious add_idea = idea_SIA_civilian_slight_support } } else_if = { limit = { has_idea = idea_SIA_civilian_opposition } swap_ideas = { remove_idea = idea_SIA_civilian_opposition add_idea = idea_SIA_civilian_full_support } } else_if = { limit = { has_idea = idea_SIA_civilian_neutral } swap_ideas = { remove_idea = idea_SIA_civilian_neutral add_idea = idea_SIA_civilian_full_support } } else_if = { limit = { has_idea = idea_SIA_civilian_slight_support } swap_ideas = { remove_idea = idea_SIA_civilian_slight_support add_idea = idea_SIA_civilian_full_support } add_stability = 0.04 } else_if = { limit = { has_idea = idea_SIA_civilian_full_support } add_stability = 0.08 } } } SIA_decrease_civilian_approval_3 = { if = { limit = { NOT = { has_country_flag = SIA_turn_off_the_khana_ratsadon } } #custom_effect_tooltip = SIA_decrease_civilian_approval_3_tt if = { limit = { has_idea = idea_SIA_civilian_rebellious } add_stability = -0.5 add_war_support = -0.5 } else_if = { limit = { has_idea = idea_SIA_civilian_opposition } swap_ideas = { remove_idea = idea_SIA_civilian_opposition add_idea = idea_SIA_civilian_rebellious } } else_if = { limit = { has_idea = idea_SIA_civilian_neutral } swap_ideas = { remove_idea = idea_SIA_civilian_neutral add_idea = idea_SIA_civilian_rebellious } } else_if = { limit = { has_idea = idea_SIA_civilian_slight_support } swap_ideas = { remove_idea = idea_SIA_civilian_slight_support add_idea = idea_SIA_civilian_rebellious } } else_if = { limit = { has_idea = idea_SIA_civilian_full_support } swap_ideas = { remove_idea = idea_SIA_civilian_full_support add_idea = idea_SIA_civilian_opposition } } } } SIA_start_opposing_civil_war = { if = { limit = { has_civil_war = no } if = { limit = { has_government = fascism } start_civil_war = { ideology = democratic ruling_party = fascism size = 0.45 keep_all_characters = yes } } else_if = { limit = { has_government = neutrality } start_civil_war = { ideology = democratic ruling_party = neutrality size = 0.45 keep_all_characters = yes } } else_if = { limit = { has_government = democratic } start_civil_war = { ideology = fascism ruling_party = democratic size = 0.45 keep_all_characters = yes } } else_if = { limit = { has_government = communism } #This should realistically never happen in normal gameplay start_civil_war = { ideology = fascism ruling_party = communism size = 0.45 keep_all_characters = yes } } } else = { add_stability = -0.4 add_war_support = -0.4 } } SIA_add_cultural_mandate_modifier_if_i_dont_have_it = { if = { limit = { NOT = { has_dynamic_modifier = { modifier = idea_SIA_thai_cultural_mandates } } } add_dynamic_modifier = { modifier = idea_SIA_thai_cultural_mandates } } set_variable = { SIA_thai_cultural_mandates_pp_cost = SIA_thai_cultural_mandates_pp_cost_base } #first one is free } ### Limited War SIA_refresh_indochina_controllers = { clear_array = SIA.indochina_controllers for_each_scope_loop = { array = SIA.indochina_states if = { limit = { NOT = { controller = { is_in_array = { array = SIA.indochina_controllers value = THIS } } } } controller = { add_to_array = { array = SIA.indochina_controllers value = THIS } } } } } SIA_refresh_malaysia_burma_controllers = { clear_array = SIA.malaysia_burma_controllers for_each_scope_loop = { array = SIA.malaysia_burma_states if = { limit = { NOT = { controller = { is_in_array = { array = SIA.malaysia_burma_controllers value = THIS } } } } controller = { add_to_array = { array = SIA.malaysia_burma_controllers value = THIS } } } } } #Reset all variables related to limited wars SIA_clear_limited_war_variables = { hidden_effect = { clear_variable = SIA.limited_war_lost_state_concession clear_array = SIA.limited_war_states clear_array = SIA.limited_war_target_allies clear_variable = SIA.pre_limited_war_faction_leader clear_variable = SIA.limited_war_target SIA_refresh_indochina_controllers = yes SIA_refresh_malaysia_burma_controllers = yes set_rule = { can_join_factions = yes } } } #Re-Ads Siam to the old faction it was in pre-limited war if it was in one SIA_re_add_to_old_faction = { if = { limit = { has_variable = pre_limited_war_faction_leader NOT = { has_war_with = var:pre_limited_war_faction_leader } var:pre_limited_war_faction_leader = { exists = yes is_subject = no has_capitulated = no is_faction_leader = yes } } set_rule = { can_join_factions = yes } var:pre_limited_war_faction_leader = { add_to_faction = ROOT } } } SIA_pick_propaganda_campaign_slot_effect = { hidden_effect = { if = { limit = { check_variable = { SIA_poster_left_icon_frame = constant:propaganda.SIA.propaganda_empty_slot_index } } set_variable = { SIA_poster_left_icon_frame = SIA_new_propaganda_campaign } set_variable = { SIA_new_propaganda_campaign_duration_left = SIA_new_propaganda_campaign_duration } #Ageing posters set_variable = { SIA_propaganda_left_poster_to_age = SIA_poster_left_icon_frame } #This is used to prevent the system to break if a propaganda campaign is cancelled hidden_effect = { country_event = { id = TAOG_siam_movie_campaign_events.101 days = constant:propaganda.SIA.default_propaganda_campaign_old_days } if = { #Debug -> Faster time limit = { has_country_flag = SIA_debug_fast_propaganda_campaigns_flag } set_country_flag = { flag = SIA_propaganda_left_days_remaining_flag days = 5 } } else = { #Regular time if = { limit = { check_variable = { SIA_new_propaganda_campaign_duration_left = 0 } } set_variable = { SIA_new_propaganda_campaign_duration_left = constant:propaganda.SIA.default_propaganda_campaign_duration } } set_country_flag = { flag = SIA_propaganda_left_days_remaining_flag days = var:SIA_new_propaganda_campaign_duration_left } } } } else_if = { limit = { check_variable = { SIA_poster_center_icon_frame = constant:propaganda.SIA.propaganda_empty_slot_index } } set_variable = { SIA_poster_center_icon_frame = SIA_new_propaganda_campaign } set_variable = { SIA_new_propaganda_campaign_duration_center = SIA_new_propaganda_campaign_duration } #Ageing posters set_variable = { SIA_propaganda_center_poster_to_age = SIA_poster_center_icon_frame } #This is used to prevent the system to break if a propaganda campaign is cancelled hidden_effect = { country_event = { id = TAOG_siam_movie_campaign_events.102 days = constant:propaganda.SIA.default_propaganda_campaign_old_days } if = { #Debug -> Faster time limit = { has_country_flag = SIA_debug_fast_propaganda_campaigns_flag } set_country_flag = { flag = SIA_propaganda_center_days_remaining_flag days = 5 } } else = { #Regular time if = { limit = { check_variable = { SIA_new_propaganda_campaign_duration_center = 0 } } set_variable = { SIA_new_propaganda_campaign_duration_center = constant:propaganda.SIA.default_propaganda_campaign_duration } } set_country_flag = { flag = SIA_propaganda_center_days_remaining_flag days = var:SIA_new_propaganda_campaign_duration_center } } } } else_if = { limit = { check_variable = { SIA_poster_right_icon_frame = constant:propaganda.SIA.propaganda_empty_slot_index } } set_variable = { SIA_poster_right_icon_frame = SIA_new_propaganda_campaign } set_variable = { SIA_new_propaganda_campaign_duration_right = SIA_new_propaganda_campaign_duration } #Ageing posters set_variable = { SIA_propaganda_right_poster_to_age = SIA_poster_right_icon_frame } #This is used to prevent the system to break if a propaganda campaign is cancelled hidden_effect = { country_event = { id = TAOG_siam_movie_campaign_events.103 days = constant:propaganda.SIA.default_propaganda_campaign_old_days } if = { #Debug -> Faster time limit = { has_country_flag = SIA_debug_fast_propaganda_campaigns_flag } set_country_flag = { flag = SIA_propaganda_right_days_remaining_flag days = 5 } } else = { #Regular time if = { limit = { check_variable = { SIA_new_propaganda_campaign_duration_right = 0 } } set_variable = { SIA_new_propaganda_campaign_duration_right = constant:propaganda.SIA.default_propaganda_campaign_duration } } set_country_flag = { flag = SIA_propaganda_right_days_remaining_flag days = var:SIA_new_propaganda_campaign_duration_right } } } } set_variable = { SIA_new_propaganda_campaign = 0 } # Reset var add_to_variable = { SIA_propaganda_campaigns_taken = 1 } #Update propaganda campaigns counter } } SIA_reset_propaganda_campaign_slot_effect = { hidden_effect = { if = { limit = { check_variable = { SIA_poster_left_icon_frame = SIA_propaganda_campaign_to_remove } } set_variable = { SIA_poster_left_icon_frame = constant:propaganda.SIA.propaganda_empty_slot_index } #Clear aged posters clear_variable = SIA_propaganda_left_poster_to_age clr_country_flag = SIA_propaganda_left_slot_is_old_flag } else_if = { limit = { check_variable = { SIA_poster_center_icon_frame = SIA_propaganda_campaign_to_remove } } set_variable = { SIA_poster_center_icon_frame = constant:propaganda.SIA.propaganda_empty_slot_index } #Clear aged posters clear_variable = SIA_propaganda_center_poster_to_age clr_country_flag = SIA_propaganda_center_slot_is_old_flag } else_if = { #This could be turned into an else, but leaving it like this to hopefully make it easier to see limit = { check_variable = { SIA_poster_right_icon_frame = SIA_propaganda_campaign_to_remove } } set_variable = { SIA_poster_right_icon_frame = constant:propaganda.SIA.propaganda_empty_slot_index } #Clear aged posters clear_variable = SIA_propaganda_right_poster_to_age clr_country_flag = SIA_propaganda_right_slot_is_old_flag } set_variable = { SIA_propaganda_campaign_to_remove = 0 } # Reset var } } SIA_unlock_propaganda_campaign_slot_effect = { hidden_effect = { if = { limit = { check_variable = { SIA_poster_left_icon_frame = constant:propaganda.SIA.propaganda_locked_slot_index } } set_variable = { SIA_poster_left_icon_frame = constant:propaganda.SIA.propaganda_empty_slot_index } } else_if = { limit = { check_variable = { SIA_poster_center_icon_frame = constant:propaganda.SIA.propaganda_locked_slot_index } } set_variable = { SIA_poster_center_icon_frame = constant:propaganda.SIA.propaganda_empty_slot_index } } else = { set_variable = { SIA_poster_right_icon_frame = constant:propaganda.SIA.propaganda_empty_slot_index } } } } SIA_increase_propaganda_campaign_cost_effect = { multiply_variable = { SIA_propaganda_cost = constant:propaganda.SIA.propaganda_cost_increase } #Using generic var SIA_propaganda_cost so that we only need to change this operation to tweak all propagandas' cost escalation clamp_variable = { var = SIA_propaganda_cost max = 180 } } SIA_peace_out = { for_each_scope_loop = { array = SIA.limited_war_target_allies if = { limit = { has_war_with = SIA } white_peace = { tag = SIA } every_subject_country = { limit = { has_war_with = SIA } white_peace = { tag = SIA } } } } if = { limit = { has_variable = SIA.limited_war_target } white_peace = { tag = var:SIA.limited_war_target } } } SIA_add_foreign_diplomatic_relationships_if_i_dont_have_it = { if = { limit = { NOT = { has_dynamic_modifier = { modifier = idea_SIA_foreign_diplomatic_relationships } } } add_dynamic_modifier = { modifier = idea_SIA_foreign_diplomatic_relationships } } } SIA_refresh_nsb_spirit = { #NSB as in national_savings_bond not NSB as in no step back hidden_effect = { if = { limit = { has_idea = idea_SIA_nsb_disarmed_nation } remove_ideas = idea_SIA_nsb_disarmed_nation } if = { limit = { has_idea = idea_SIA_nsb_volunteer_only } remove_ideas = idea_SIA_nsb_volunteer_only } if = { limit = { has_idea = idea_SIA_nsb_limited_conscription } remove_ideas = idea_SIA_nsb_limited_conscription } if = { limit = { has_idea = idea_SIA_nsb_extensive_conscription } remove_ideas = idea_SIA_nsb_extensive_conscription } if = { limit = { has_idea = idea_SIA_nsb_service_by_requirement } remove_ideas = idea_SIA_nsb_service_by_requirement } if = { limit = { has_idea = idea_SIA_nsb_all_adults_serve } remove_ideas = idea_SIA_nsb_all_adults_serve } if = { limit = { has_idea = idea_SIA_nsb_scraping_the_barrel } remove_ideas = idea_SIA_nsb_scraping_the_barrel } } } SIA_generate_anandas_trait = { # X axis: # left = scholar # right = industry # # Y axis: # down = military # up = administration # # SIA_ananda_title_x = SIA_ananda_industry - SIA_ananda_scholar # SIA_ananda_title_y = SIA_ananda_administrator - SIA_ananda_military if = { limit = { check_variable = { SIA_ananda_title_x = 0 } check_variable = { SIA_ananda_title_y = 0 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_unproven # The Unproven ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = 0 } check_variable = { SIA_ananda_title_y = 3 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_ordered # The Ordered ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = -1 } check_variable = { SIA_ananda_title_y = 2 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_enlightened # The Enlightened ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = 1 } check_variable = { SIA_ananda_title_y = 2 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_reforming # The Reforming ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = -2 } check_variable = { SIA_ananda_title_y = 1 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_learned # The Learned ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = 0 } check_variable = { SIA_ananda_title_y = 1 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_dutiful # The Dutiful ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = 2 } check_variable = { SIA_ananda_title_y = 1 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_industrious # The Industrious ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = -3 } check_variable = { SIA_ananda_title_y = 0 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_erudite # The Erudite ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = -1 } check_variable = { SIA_ananda_title_y = 0 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_reflective # The Reflective ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = 1 } check_variable = { SIA_ananda_title_y = 0 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_pragmatic # The Pragmatic ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = 3 } check_variable = { SIA_ananda_title_y = 0 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_builder # The Builder ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = -2 } check_variable = { SIA_ananda_title_y = -1 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_stern # The Stern ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = 0 } check_variable = { SIA_ananda_title_y = -1 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_resolute # The Resolute ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = 2 } check_variable = { SIA_ananda_title_y = -1 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_iron_willed # The Iron-Willed ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = -1 } check_variable = { SIA_ananda_title_y = -2 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_unbending # The Unbending ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = 1 } check_variable = { SIA_ananda_title_y = -2 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_relentless # The Relentless ideology = despotism } } else_if = { limit = { check_variable = { SIA_ananda_title_x = 0 } check_variable = { SIA_ananda_title_y = -3 } } add_trait = { character = SIA_ananda_mahidol trait = SIA_the_iron_handed # The Iron-Handed ideology = despotism } } else = { add_trait = { character = SIA_ananda_mahidol trait = SIA_the_unbreakable ideology = despotism } } } SIA_update_adc = { if = { limit = { is_faction_leader = yes } hidden_effect = { if = { limit = { NOT = { has_dynamic_modifier = { modifier = idea_SIA_asian_democratic_compact } } } add_dynamic_modifier = { modifier = idea_SIA_asian_democratic_compact } } } # Scale by independent members only, so releasing puppets can't inflate the bonus set_variable = { SIA_adc_member_count = 0 } for_each_scope_loop = { array = faction_members if = { limit = { is_subject = no } PREV = { add_to_variable = { SIA_adc_member_count = 1 } } } } for_each_scope_loop = { # PREV is the faction leader (SIA) this effect runs in; valid for both focus and on_join/on_leave callers array = faction_members clear_variable = SIA_adc_land_mastery_gain_factor clear_variable = SIA_adc_research_speed_factor clear_variable = SIA_adc_max_command_power_mult clear_variable = SIA_adc_army_defence_factor clear_variable = SIA_adc_army_org_factor clear_variable = SIA_adc_max_dig_in_factor clear_variable = SIA_acd_industrial_capacity_dockyard clear_variable = SIA_acd_industrial_capacity_factory clear_variable = SIA_adc_equipment_conversion_speed clear_variable = SIA_adc_production_lack_of_resource_penalty_factor clear_variable = SIA_adc_production_factory_max_efficiency_factor if = { limit = { NOT = { has_dynamic_modifier = { modifier = idea_SIA_asian_democratic_compact } } } add_dynamic_modifier = { modifier = idea_SIA_asian_democratic_compact } } if = { limit = { PREV = { has_completed_focus = SIA_southeast_asia_joint_command } } set_variable = { SIA_adc_land_mastery_gain_factor = PREV.SIA_adc_member_count } multiply_variable = { SIA_adc_land_mastery_gain_factor = PREV.SIA_adc_land_mastery_gain_factor_per_country } set_variable = { SIA_adc_research_speed_factor = PREV.SIA_adc_member_count } multiply_variable = { SIA_adc_research_speed_factor = PREV.SIA_adc_research_speed_factor_per_country } set_variable = { SIA_adc_max_command_power_mult = PREV.SIA_adc_member_count } multiply_variable = { SIA_adc_max_command_power_mult = PREV.SIA_adc_max_command_power_mult_per_country } } if = { limit = { PREV = { has_completed_focus = SIA_pan_asian_weapon_standardization } } set_variable = { SIA_adc_equipment_conversion_speed = PREV.SIA_adc_member_count } multiply_variable = { SIA_adc_equipment_conversion_speed = PREV.SIA_adc_equipment_conversion_speed_per_country } set_variable = { SIA_adc_production_lack_of_resource_penalty_factor = PREV.SIA_adc_member_count } multiply_variable = { SIA_adc_production_lack_of_resource_penalty_factor = PREV.SIA_adc_production_lack_of_resource_penalty_factor_per_country } set_variable = { SIA_adc_production_factory_max_efficiency_factor = PREV.SIA_adc_member_count } multiply_variable = { SIA_adc_production_factory_max_efficiency_factor = PREV.SIA_adc_production_factory_max_efficiency_factor_per_country } } if = { limit = { PREV = { has_completed_focus = SIA_united_against_aggression } } set_variable = { SIA_adc_army_defence_factor = PREV.SIA_adc_member_count } multiply_variable = { SIA_adc_army_defence_factor = PREV.SIA_adc_army_defence_factor_per_country } set_variable = { SIA_adc_army_org_factor = PREV.SIA_adc_member_count } multiply_variable = { SIA_adc_army_org_factor = PREV.SIA_adc_army_org_factor_per_country } set_variable = { SIA_adc_max_dig_in_factor = PREV.SIA_adc_member_count } multiply_variable = { SIA_adc_max_dig_in_factor = PREV.SIA_adc_max_dig_in_factor_per_country } } if = { limit = { PREV = { has_completed_focus = SIA_the_hammers_that_strike } } set_variable = { SIA_acd_industrial_capacity_dockyard = PREV.SIA_adc_member_count } multiply_variable = { SIA_acd_industrial_capacity_dockyard = PREV.SIA_acd_industrial_capacity_dockyard_per_country } set_variable = { SIA_acd_industrial_capacity_factory = PREV.SIA_adc_member_count } multiply_variable = { SIA_acd_industrial_capacity_factory = PREV.SIA_acd_industrial_capacity_factory_per_country } } } } } check_cheating_before_civil_war = { if = { limit = { ##starting divs is 4 check_variable = { num_armies < 4 } is_ai = no } if = { #little cheating limit = { amount_manpower_in_deployment_queue > 0 amount_manpower_in_deployment_queue < 1999 } set_country_flag = little_cheater } else_if = { #more cheating limit = { amount_manpower_in_deployment_queue > 1999 } set_country_flag = cheater } } } spawn_pret_in_cw_if_cheating = { if = { limit = { OR = { has_country_flag = little_cheater has_country_flag = cheater } } every_other_country = { limit = { original_tag = SIA } division_template = { name = "Pret" is_locked = yes template_counter = 12 # optional regiments = { mountaineers = { x = 0 y = 0 } mountaineers = { x = 0 y = 1 } mountaineers = { x = 0 y = 2 } mountaineers = { x = 0 y = 3 } mountaineers = { x = 0 y = 4 } mountaineers = { x = 0 y = 5 } mountaineers = { x = 1 y = 0 } mountaineers = { x = 1 y = 1 } mountaineers = { x = 1 y = 2 } mountaineers = { x = 1 y = 3 } mountaineers = { x = 1 y = 4 } mountaineers = { x = 1 y = 5 } mountaineers = { x = 2 y = 0 } mountaineers = { x = 2 y = 1 } mountaineers = { x = 2 y = 2 } mountaineers = { x = 2 y = 3 } mountaineers = { x = 2 y = 4 } mountaineers = { x = 2 y = 5 } } support = { artillery = { x = 0 y = 0 } } } if = { limit = { NOT = { has_tech = tech_trucks } } set_technology = { tech_trucks = 1 popup = no } } if = { limit = { NOT = { has_tech = basic_train } } set_technology = { basic_train = 1 popup = no } } add_equipment_to_stockpile = { type = motorized_equipment amount = 400 producer = THIS } add_equipment_to_stockpile = { type = train_equipment_1 amount = 15 producer = THIS } } } if = { limit = { has_country_flag = little_cheater } every_other_country = { limit = { original_tag = SIA } random_controlled_state = { limit = { is_capital = no } create_unit = { division = "name = \"Pret\" division_template = \"Pret\" start_experience_factor = 1 start_equipment_factor = 1 start_manpower_factor = 1" #Hungry owner = PREV allow_spawning_on_enemy_provs = yes count = 3 } } random_controlled_state = { limit = { is_capital = yes } create_unit = { division = "name = \"Pret\" division_template = \"Pret\" start_experience_factor = 1 start_equipment_factor = 1 start_manpower_factor = 1" owner = PREV allow_spawning_on_enemy_provs = yes count = 3 } } } } else_if = { limit = { has_country_flag = cheater } every_other_country = { limit = { original_tag = SIA } random_controlled_state = { limit = { is_capital = no } create_unit = { division = "name = \"Pret\" division_template = \"Pret\" start_experience_factor = 1 start_equipment_factor = 1 start_manpower_factor = 1" #Itchy Itchy Tasty owner = PREV allow_spawning_on_enemy_provs = yes country_score = {} # optional count = 6 } } random_controlled_state = { limit = { is_capital = yes } create_unit = { division = "name = \"Pret\" division_template = \"Pret\" start_experience_factor = 1 start_equipment_factor = 1 start_manpower_factor = 1" owner = PREV allow_spawning_on_enemy_provs = yes country_score = {} # optional count = 6 } } } } } SIA_military_coup = { set_variable = { t_cw_size = 0.35 } set_variable_to_random = { var = t_cw_size_noise min = -0.1 max = 0.25 integer = no } add_to_variable = { t_cw_size = t_cw_size_noise } if = { limit = { is_debug = yes tag = SIA } log = "Coup Strength for Siam is [?var:t_cw_size]" } if = { limit = { has_country_leader = { character = SIA_plaek_phibunsongkhram } } start_civil_war = { ideology = neutrality ruling_party = fascism size = var:t_cw_size keep_all_characters = yes set_variable = { ROOT.SIA_other_cw_country = THIS } } } else_if = { limit = { OR = { has_country_leader = { character = SIA_phraya_phahon } has_country_leader = { character = SIA_phraya_songsuradet } has_country_leader = { character = SIA_ananda_mahidol } has_country_leader = { character = SIA_rambai_barni } has_country_leader = { character = SIA_prajadhipok } has_country_leader = { character = SIA_bowardej } has_country_leader = { character = SIA_rangsit_prayurasakdi } } } start_civil_war = { ideology = fascism ruling_party = neutrality size = var:t_cw_size keep_all_characters = yes set_variable = { ROOT.SIA_other_cw_country = THIS } } } else_if = { limit = { has_country_leader = { character = SIA_pridi_banomyong } } start_civil_war = { ideology = fascism ruling_party = democratic size = var:t_cw_size keep_all_characters = yes set_variable = { ROOT.SIA_other_cw_country = THIS } } } else = { #fallback start_civil_war= { ideology = communism ruling_party = SIA size = var:t_cw_size keep_all_characters = yes set_variable = { ROOT.SIA_other_cw_country = THIS } } } if = { limit = { has_variable = SIA_other_cw_country } random_army_leader = { limit = { NOT = { OR = { is_character = SIA_plaek_phibunsongkhram is_character = SIA_pridi_banomyong is_character = SIA_phraya_phahon is_character = SIA_phraya_songsuradet is_character = SIA_ananda_mahidol is_character = SIA_rambai_barni is_character = SIA_prajadhipok is_character = SIA_bowardej is_character = SIA_rangsit_prayurasakdi is_character = SIA_adul_aduldejajaras } } } set_nationality = ROOT.SIA_other_cw_country if = { limit = { PREV.var:SIA_other_cw_country = { has_government = fascism } } add_country_leader_role = { promote_leader = yes country_leader = { ideology = fascism_ideology } } } else_if = { limit = { PREV.var:SIA_other_cw_country = { has_government = neutrality } } add_country_leader_role = { promote_leader = yes country_leader = { ideology = despotism } } } } } } SIA_civilian_coup = { set_variable = { t_cw_size = 0.35 } set_variable_to_random = { var = t_cw_size_noise min = -0.1 max = 0.25 integer = no } add_to_variable = { t_cw_size = t_cw_size_noise } if = { limit = { has_country_leader = { character = SIA_plaek_phibunsongkhram } } start_civil_war = { ideology = democratic ruling_party = fascism size = var:t_cw_size keep_all_characters = yes set_variable = { ROOT.SIA_other_cw_country = THIS } } } else_if = { limit = { OR = { has_country_leader = { character = SIA_phraya_phahon } has_country_leader = { character = SIA_phraya_songsuradet } has_country_leader = { character = SIA_ananda_mahidol } has_country_leader = { character = SIA_rambai_barni } has_country_leader = { character = SIA_prajadhipok } has_country_leader = { character = SIA_bowardej } has_country_leader = { character = SIA_rangsit_prayurasakdi } } } start_civil_war = { ideology = democratic ruling_party = neutrality size = var:t_cw_size keep_all_characters = yes set_variable = { ROOT.SIA_other_cw_country = THIS } } } else_if = { limit = { has_country_leader = { character = SIA_pridi_banomyong } } start_civil_war = { ideology = neutrality ruling_party = democratic size = var:t_cw_size keep_all_characters = yes set_variable = { ROOT.SIA_other_cw_country = THIS } } } else = { #fallback start_civil_war= { ideology = communism ruling_party = SIA size = var:t_cw_size keep_all_characters = yes set_variable = { ROOT.SIA_other_cw_country = THIS } } } if = { limit = { has_variable = SIA_other_cw_country } random_army_leader = { limit = { NOT = { OR = { is_character = SIA_plaek_phibunsongkhram is_character = SIA_pridi_banomyong is_character = SIA_phraya_phahon is_character = SIA_phraya_songsuradet is_character = SIA_ananda_mahidol is_character = SIA_rambai_barni is_character = SIA_prajadhipok is_character = SIA_bowardej is_character = SIA_rangsit_prayurasakdi is_character = SIA_adul_aduldejajaras } } } set_nationality = ROOT.SIA_other_cw_country if = { limit = { PREV.var:SIA_other_cw_country = { has_government = democratic } } add_country_leader_role = { promote_leader = yes country_leader = { ideology = socialism } } } else_if = { limit = { PREV.var:SIA_other_cw_country = { has_government = neutrality } } add_country_leader_role = { promote_leader = yes country_leader = { ideology = despotism } } } } } } SIA_calc_dem_cw = { set_variable = { SIA_dem_event_count_cw_scale = 0.75 } multiply_variable = { SIA_dem_event_count_cw_scale = SIA_dem_event_count } set_variable = { SIA_dem_party_popularity_cw_scale = party_popularity@democratic } multiply_variable = { SIA_dem_party_popularity_cw_scale = 0.25 } add_to_variable = { SIA_dem_event_count_cw_scale = SIA_dem_party_popularity_cw_scale } } SIA_thai_students_in_the_oss_effect = { if = { limit = { has_dlc = "La Resistance" } create_intelligence_agency = yes upgrade_intelligence_agency = upgrade_form_department upgrade_intelligence_agency = upgrade_commando_training upgrade_intelligence_agency = upgrade_army_department custom_effect_tooltip = newline_tt USA = { create_intelligence_agency = yes upgrade_intelligence_agency = upgrade_form_department upgrade_intelligence_agency = upgrade_commando_training upgrade_intelligence_agency = upgrade_army_department add_decryption = { target = JAP ratio = 0.5 } } custom_effect_tooltip = newline_tt add_decryption = { target = JAP ratio = 0.5 } } else = { add_tech_bonus = { name = SIA_thai_students_in_the_oss bonus = 2 uses = 2 category = encryption_tech } } add_intel = { target = JAP civilian_intel = 20 army_intel = 20 navy_intel = 20 airforce_intel = 20 } custom_effect_tooltip = newline_tt USA = { add_intel = { target = JAP civilian_intel = 20 army_intel = 20 navy_intel = 20 airforce_intel = 20 } } add_offsite_building = { type = industrial_complex level = 2 } }