update_bos_internal_factions_dirty_variable = { if = { limit = { check_variable = { global.BOS_internal_factions_dirty_update_var < 10000 } } add_to_variable = { global.BOS_internal_factions_dirty_update_var = 1 } } else = { set_variable = { global.BOS_internal_factions_dirty_update_var = 1 } } } BOS_refresh_internal_faction_modifiers_effect = { set_variable = { BOS_internal_faction_stability_factor = 0 } set_variable = { BOS_internal_faction_manpower_factor = 0 } if = { limit = { check_variable = { BOS_bosniak_trust < 25 } } add_to_variable = { BOS_internal_faction_stability_factor = -0.15 } } else_if = { limit = { check_variable = { BOS_bosniak_trust > 50 } } add_to_variable = { BOS_internal_faction_stability_factor = 0.05 } if = { limit = { check_variable = { BOS_bosniak_trust > 74 } } add_to_variable = { BOS_internal_faction_stability_factor = 0.05 } } } if = { limit = { check_variable = { BOS_croat_trust < 25 } } add_to_variable = { BOS_internal_faction_stability_factor = -0.15 } } else_if = { limit = { check_variable = { BOS_croat_trust > 50 } } add_to_variable = { BOS_internal_faction_stability_factor = 0.05 } if = { limit = { check_variable = { BOS_croat_trust > 74 } } add_to_variable = { BOS_internal_faction_stability_factor = 0.05 } } } if = { limit = { check_variable = { BOS_srpska_trust < 25 } } add_to_variable = { BOS_internal_faction_stability_factor = -0.15 } } else_if = { limit = { check_variable = { BOS_srpska_trust > 50 } } add_to_variable = { BOS_internal_faction_stability_factor = 0.05 } if = { limit = { check_variable = { BOS_srpska_trust > 74 } } add_to_variable = { BOS_internal_faction_stability_factor = 0.05 } } } if = { limit = { check_variable = { BOS_bosniak_manpower < 25 } } add_to_variable = { BOS_internal_faction_manpower_factor = -0.15 } } else_if = { limit = { check_variable = { BOS_bosniak_manpower > 50 } } add_to_variable = { BOS_internal_faction_manpower_factor = 0.15 } if = { limit = { check_variable = { BOS_bosniak_manpower > 74 } } add_to_variable = { BOS_internal_faction_manpower_factor = 0.05 } } } if = { limit = { check_variable = { BOS_croat_manpower < 25 } } add_to_variable = { BOS_internal_faction_manpower_factor = -0.15 } } else_if = { limit = { check_variable = { BOS_croat_manpower > 50 } } add_to_variable = { BOS_internal_faction_manpower_factor = 0.15 } if = { limit = { check_variable = { BOS_croat_manpower > 74 } } add_to_variable = { BOS_internal_faction_manpower_factor = 0.05 } } } if = { limit = { check_variable = { BOS_srpska_manpower < 25 } } add_to_variable = { BOS_internal_faction_manpower_factor = -0.15 } } else_if = { limit = { check_variable = { BOS_srpska_manpower > 50 } } add_to_variable = { BOS_internal_faction_manpower_factor = 0.15 } if = { limit = { check_variable = { BOS_srpska_manpower > 74 } } add_to_variable = { BOS_internal_faction_manpower_factor = 0.05 } } } if = { limit = { NOT = { has_dynamic_modifier = { modifier = BOS_internal_faction_balance } } } add_dynamic_modifier = { modifier = BOS_internal_faction_balance } } if = { limit = { is_ai = no } update_bos_internal_factions_dirty_variable = yes } } BOS_initialize_internal_factions_effect = { set_variable = { BOS_bosniak_trust = 62 } set_variable = { BOS_croat_trust = 40 } set_variable = { BOS_srpska_trust = 15 } set_variable = { BOS_bosniak_manpower = 62 } set_variable = { BOS_croat_manpower = 40 } set_variable = { BOS_srpska_manpower = 15 } set_variable = { BOS_emigration_pressure = 40 } BOS_refresh_internal_faction_modifiers_effect = yes } BOS_set_civil_war_internal_factions_effect = { # capture pre-war manpower before the reset; war-start spawn counts read these set_variable = { BOS_cw_bosniak_manpower = BOS_bosniak_manpower } set_variable = { BOS_cw_croat_manpower = BOS_croat_manpower } set_variable = { BOS_cw_srpska_manpower = BOS_srpska_manpower } set_variable = { BOS_srpska_trust = 15 } set_variable = { BOS_bosniak_trust = 40 } set_variable = { BOS_croat_trust = 15 } set_variable = { BOS_srpska_manpower = 15 } set_variable = { BOS_bosniak_manpower = 40 } set_variable = { BOS_croat_manpower = 15 } BOS_refresh_internal_faction_modifiers_effect = yes } # Trust and manpower are 0-100 tracks (Hostile 0-24, Inconsequential 25-50, Friendly 51-74, Loyal 75-100). # The arithmetic lives once in the *_apply_effect cores below; the *_add_effect public wrappers add a # generic tooltip for future content, and the legacy step effects set the temp delta and delegate to a core. BOS_bosniak_trust_apply_effect = { add_to_variable = { var = BOS_bosniak_trust value = temp_trust_change } clamp_variable = { var = BOS_bosniak_trust min = 0 max = 100 } BOS_refresh_internal_faction_modifiers_effect = yes } BOS_croat_trust_apply_effect = { add_to_variable = { var = BOS_croat_trust value = temp_trust_change } clamp_variable = { var = BOS_croat_trust min = 0 max = 100 } BOS_refresh_internal_faction_modifiers_effect = yes } BOS_srpska_trust_apply_effect = { add_to_variable = { var = BOS_srpska_trust value = temp_trust_change } clamp_variable = { var = BOS_srpska_trust min = 0 max = 100 } BOS_refresh_internal_faction_modifiers_effect = yes } BOS_bosniak_manpower_apply_effect = { add_to_variable = { var = BOS_bosniak_manpower value = temp_manpower_change } clamp_variable = { var = BOS_bosniak_manpower min = 0 max = 100 } BOS_refresh_internal_faction_modifiers_effect = yes } BOS_croat_manpower_apply_effect = { add_to_variable = { var = BOS_croat_manpower value = temp_manpower_change } clamp_variable = { var = BOS_croat_manpower min = 0 max = 100 } BOS_refresh_internal_faction_modifiers_effect = yes } BOS_srpska_manpower_apply_effect = { add_to_variable = { var = BOS_srpska_manpower value = temp_manpower_change } clamp_variable = { var = BOS_srpska_manpower min = 0 max = 100 } BOS_refresh_internal_faction_modifiers_effect = yes } BOS_bosniak_trust_add_effect = { custom_effect_tooltip = bos_bosniak_trust_change_tt BOS_bosniak_trust_apply_effect = yes } BOS_croat_trust_add_effect = { custom_effect_tooltip = bos_croat_trust_change_tt BOS_croat_trust_apply_effect = yes } BOS_srpska_trust_add_effect = { custom_effect_tooltip = bos_srpska_trust_change_tt BOS_srpska_trust_apply_effect = yes } BOS_bosniak_manpower_add_effect = { custom_effect_tooltip = bos_bosniak_manpower_change_tt BOS_bosniak_manpower_apply_effect = yes } BOS_croat_manpower_add_effect = { custom_effect_tooltip = bos_croat_manpower_change_tt BOS_croat_manpower_apply_effect = yes } BOS_srpska_manpower_add_effect = { custom_effect_tooltip = bos_srpska_manpower_change_tt BOS_srpska_manpower_apply_effect = yes } BOS_bosniak_attitude_increase_effect = { set_temp_variable = { temp_trust_change = 8 } custom_effect_tooltip = bos_Bosniak_attitude_towards_us_will_rise_tt BOS_bosniak_trust_apply_effect = yes } BOS_bosniak_attitude_decrease_effect = { set_temp_variable = { temp_trust_change = -8 } custom_effect_tooltip = bos_Bosniak_attitude_towards_us_will_lower_tt BOS_bosniak_trust_apply_effect = yes } BOS_bosniak_stability_increase_effect = { set_temp_variable = { temp_trust_change = 5 } custom_effect_tooltip = bos_bosniak_stability_will_rise_tt BOS_bosniak_trust_apply_effect = yes } BOS_bosniak_stability_decrease_effect = { set_temp_variable = { temp_trust_change = -5 } custom_effect_tooltip = bos_bosniak_stability_will_lower_tt BOS_bosniak_trust_apply_effect = yes } BOS_bosniak_manpower_decrease_effect = { set_temp_variable = { temp_manpower_change = -10 } custom_effect_tooltip = bos_bosniak_manpower_will_lower_tt BOS_bosniak_manpower_apply_effect = yes } BOS_croat_attitude_increase_effect = { set_temp_variable = { temp_trust_change = 8 } custom_effect_tooltip = bos_croat_attitude_towards_us_will_rise_tt BOS_croat_trust_apply_effect = yes } BOS_croat_attitude_decrease_effect = { set_temp_variable = { temp_trust_change = -8 } custom_effect_tooltip = bos_croat_attitude_towards_us_will_lower_tt BOS_croat_trust_apply_effect = yes } BOS_croat_stability_increase_effect = { set_temp_variable = { temp_trust_change = 5 } custom_effect_tooltip = bos_croat_stability_will_rise_tt BOS_croat_trust_apply_effect = yes } BOS_croat_stability_decrease_effect = { set_temp_variable = { temp_trust_change = -5 } custom_effect_tooltip = bos_croat_stability_will_lower_tt BOS_croat_trust_apply_effect = yes } BOS_croat_manpower_decrease_effect = { set_temp_variable = { temp_manpower_change = -10 } custom_effect_tooltip = bos_croat_manpower_will_lower_tt BOS_croat_manpower_apply_effect = yes } BOS_srpska_attitude_increase_effect = { set_temp_variable = { temp_trust_change = 8 } custom_effect_tooltip = bos_srpska_attitude_towards_us_will_rise_tt BOS_srpska_trust_apply_effect = yes } BOS_srpska_attitude_decrease_effect = { set_temp_variable = { temp_trust_change = -8 } custom_effect_tooltip = bos_srpska_attitude_towards_us_will_lower_tt BOS_srpska_trust_apply_effect = yes } BOS_srpska_stability_increase_effect = { set_temp_variable = { temp_trust_change = 5 } custom_effect_tooltip = bos_srpska_stability_will_rise_tt BOS_srpska_trust_apply_effect = yes } BOS_srpska_stability_decrease_effect = { set_temp_variable = { temp_trust_change = -5 } custom_effect_tooltip = bos_srpska_stability_will_lower_tt BOS_srpska_trust_apply_effect = yes } BOS_srpska_manpower_increase_effect = { set_temp_variable = { temp_manpower_change = 10 } custom_effect_tooltip = bos_srpska_manpower_will_rise_tt BOS_srpska_manpower_apply_effect = yes } BOS_srpska_manpower_decrease_effect = { set_temp_variable = { temp_manpower_change = -10 } custom_effect_tooltip = bos_srpska_manpower_will_lower_tt BOS_srpska_manpower_apply_effect = yes } BOS_bosniak_manpower_increase_effect = { set_temp_variable = { temp_manpower_change = 10 } custom_effect_tooltip = bos_bosniak_manpower_will_rise_tt BOS_bosniak_manpower_apply_effect = yes } BOS_croat_manpower_increase_effect = { set_temp_variable = { temp_manpower_change = 10 } custom_effect_tooltip = bos_croat_manpower_will_rise_tt BOS_croat_manpower_apply_effect = yes } BOS_all_faction_stability_decrease_effect = { set_temp_variable = { temp_trust_change = -5 } custom_effect_tooltip = bos_bosniak_stability_will_lower_tt custom_effect_tooltip = bos_croat_stability_will_lower_tt custom_effect_tooltip = bos_srpska_stability_will_lower_tt BOS_bosniak_trust_apply_effect = yes BOS_croat_trust_apply_effect = yes BOS_srpska_trust_apply_effect = yes } BOS_all_faction_trust_increase_effect = { set_temp_variable = { temp_trust_change = 5 } custom_effect_tooltip = bos_bosniak_stability_will_rise_tt custom_effect_tooltip = bos_croat_stability_will_rise_tt custom_effect_tooltip = bos_srpska_stability_will_rise_tt BOS_bosniak_trust_apply_effect = yes BOS_croat_trust_apply_effect = yes BOS_srpska_trust_apply_effect = yes } BOS_add_sfor_volunteer_support_effect = { if = { limit = { NOT = { OR = { has_idea = intervention_regional_interventionism has_idea = intervention_global_interventionism has_idea = intervention_neo_imperialism } } } add_ideas = intervention_regional_interventionism set_country_flag = BOS_sfor_interventionism_granted } add_ideas = BOS_sfor_vol_troops } BOS_remove_sfor_volunteer_support_effect = { remove_ideas = BOS_sfor_vol_troops if = { limit = { has_country_flag = BOS_sfor_interventionism_granted } remove_ideas = intervention_regional_interventionism clr_country_flag = BOS_sfor_interventionism_granted } } BOS_begin_internal_war_effect = { set_country_flag = civil_war_bosnia set_country_flag = civil_war_bos_two set_country_flag = civil_war_focus add_ideas = BOS_aggressive_nation } BOS_begin_srpska_civil_war_effect = { BOS_begin_internal_war_effect = yes set_country_flag = BOS_defeat_all_serbs news_event = news.83 release = RSK add_named_threat = { threat = 5 name = bos_war_civil_war } RSK = { set_country_flag = civil_war_bosnia set_country_flag = civil_war_bos_two add_ideas = BOS_srpska_balkan_aspiration add_ideas = BOS_aggressive_nation declare_war_on = { target = BOS type = civil_war } if = { limit = { country_exists = HZG } declare_war_on = { target = HZG type = civil_war } } } add_state_core = 1054 add_state_core = 1053 add_state_core = 129 if = { limit = { SER = { NOT = { OR = { has_idea = intervention_regional_interventionism has_idea = intervention_global_interventionism has_idea = intervention_neo_imperialism } } } } SER = { add_ideas = intervention_regional_interventionism } } if = { limit = { TUR = { NOT = { OR = { has_idea = intervention_regional_interventionism has_idea = intervention_global_interventionism has_idea = intervention_neo_imperialism } } } } TUR = { add_ideas = intervention_regional_interventionism } } } BOS_finish_civil_war_recovery_effect = { set_country_flag = BOS_civil_war_over clr_country_flag = civil_war_focus clr_country_flag = civil_war_bosnia clr_country_flag = civil_war_bos_two remove_ideas = BOS_bosniak_balkan_aspiration remove_ideas = BOS_bosniak_balkan_aspiration2 remove_ideas = BOS_croat_balkan_aspiration remove_ideas = BOS_aggressive_nation clr_country_flag = BOS_defeat_all_serbs clr_country_flag = defeat_all_croats clr_country_flag = BOS_hzg_civil_war_recovery_pending # Recovery length is set by the caller via BOS_recovery_days; callers that leave it unset get the default 5 years. if = { limit = { NOT = { check_variable = { BOS_recovery_days > 0 } } } set_variable = { BOS_recovery_days = 1826 } } add_timed_idea = { idea = BOS_civil_war_recovery days = BOS_recovery_days } set_temp_variable = { treasury_change = -25.00 } modify_treasury_effect = yes 128 = { if = { limit = { infrastructure > 0 } damage_building = { type = infrastructure damage = 1 } } } delete_units = { division_template = "Milicija Divizija" disband = yes } } BOS_set_presidency_rotation_cooldown_effect = { clr_country_flag = BOS_presidency_rotation_cooldown set_country_flag = { flag = BOS_presidency_rotation_cooldown days = 240 value = 1 } # Overdue window (360d) outlasts the 240d cooldown by 120d; once both have lapsed with no rotation the waiting faction sours (on_weekly_BOS). Started flag suppresses the check until the player has engaged rotation at least once. clr_country_flag = BOS_presidency_overdue_window set_country_flag = { flag = BOS_presidency_overdue_window days = 360 value = 1 } set_country_flag = BOS_presidency_rotation_started } BOS_srpska_reconciliation_full_effect = { custom_effect_tooltip = bos_srpska_reconciliation_full_tt set_variable = { BOS_srpska_trust = 15 } BOS_refresh_internal_faction_modifiers_effect = yes } BOS_srpska_negotiated_autonomy_effect = { custom_effect_tooltip = bos_srpska_negotiated_autonomy_tt set_variable = { BOS_srpska_trust = 62 } BOS_refresh_internal_faction_modifiers_effect = yes } BOS_update_national_reconciliation_effect = { if = { limit = { NOT = { has_idea = BOS_national_reconciliation } NOT = { has_country_flag = civil_war_bosnia } check_variable = { BOS_bosniak_trust > 50 } check_variable = { BOS_croat_trust > 50 } check_variable = { BOS_srpska_trust > 50 } } add_ideas = BOS_national_reconciliation } else_if = { limit = { has_idea = BOS_national_reconciliation OR = { has_country_flag = civil_war_bosnia check_variable = { BOS_bosniak_trust < 51 } check_variable = { BOS_croat_trust < 51 } check_variable = { BOS_srpska_trust < 51 } } } remove_ideas = BOS_national_reconciliation } } BOS_update_governing_partner_effect = { if = { limit = { NOT = { has_idea = BOS_bosniak_governing_partner } BOS_bosniak_leads_government_trigger = yes BOS_bosniak_attitude_loyal_trigger = yes } add_ideas = BOS_bosniak_governing_partner } else_if = { limit = { has_idea = BOS_bosniak_governing_partner OR = { NOT = { BOS_bosniak_leads_government_trigger = yes } NOT = { BOS_bosniak_attitude_loyal_trigger = yes } } } remove_ideas = BOS_bosniak_governing_partner } if = { limit = { NOT = { has_idea = BOS_croat_governing_partner } BOS_croat_leads_government_trigger = yes BOS_croat_attitude_loyal_trigger = yes } add_ideas = BOS_croat_governing_partner } else_if = { limit = { has_idea = BOS_croat_governing_partner OR = { NOT = { BOS_croat_leads_government_trigger = yes } NOT = { BOS_croat_attitude_loyal_trigger = yes } } } remove_ideas = BOS_croat_governing_partner } if = { limit = { NOT = { has_idea = BOS_srpska_governing_partner } BOS_srpska_leads_government_trigger = yes BOS_srpska_attitude_loyal_trigger = yes } add_ideas = BOS_srpska_governing_partner } else_if = { limit = { has_idea = BOS_srpska_governing_partner OR = { NOT = { BOS_srpska_leads_government_trigger = yes } NOT = { BOS_srpska_attitude_loyal_trigger = yes } } } remove_ideas = BOS_srpska_governing_partner } } # A crisis compounds where trust is already lowest: whichever Hostile community sits at the bottom loses a further 3 trust. BOS_corruption_scandal_weakest_hit_effect = { if = { limit = { BOS_bosniak_attitude_hostile_trigger = yes check_variable = { var = BOS_bosniak_trust value = BOS_croat_trust compare = less_than_or_equals } check_variable = { var = BOS_bosniak_trust value = BOS_srpska_trust compare = less_than_or_equals } } custom_effect_tooltip = BOS_corruption_hits_weakest_tt set_temp_variable = { temp_trust_change = -3 } BOS_bosniak_trust_add_effect = yes } else_if = { limit = { BOS_croat_attitude_hostile_trigger = yes check_variable = { var = BOS_croat_trust value = BOS_srpska_trust compare = less_than_or_equals } } custom_effect_tooltip = BOS_corruption_hits_weakest_tt set_temp_variable = { temp_trust_change = -3 } BOS_croat_trust_add_effect = yes } else_if = { limit = { BOS_srpska_attitude_hostile_trigger = yes } custom_effect_tooltip = BOS_corruption_hits_weakest_tt set_temp_variable = { temp_trust_change = -3 } BOS_srpska_trust_add_effect = yes } }