SAU_clear_gulf_doctrines = { if = { limit = { has_idea = SAU_gulf_war_lessons } remove_ideas = SAU_gulf_war_lessons } if = { limit = { has_idea = SAU_doctrine_american } remove_ideas = SAU_doctrine_american } if = { limit = { has_idea = SAU_doctrine_gcc } remove_ideas = SAU_doctrine_gcc } if = { limit = { has_idea = SAU_doctrine_nato } remove_ideas = SAU_doctrine_nato } if = { limit = { has_idea = SAU_doctrine_domestic } remove_ideas = SAU_doctrine_domestic } } SAU_clear_sang = { if = { limit = { has_idea = SAU_sp_sang_regime } remove_ideas = SAU_sp_sang_regime } if = { limit = { has_idea = SAU_sp_sang_tribal } remove_ideas = SAU_sp_sang_tribal } if = { limit = { has_idea = SAU_sp_sang_security } remove_ideas = SAU_sp_sang_security } } SAU_clear_abrams = { if = { limit = { has_idea = SAU_sp_abrams_shock } remove_ideas = SAU_sp_abrams_shock } if = { limit = { has_idea = SAU_sp_abrams_combined } remove_ideas = SAU_sp_abrams_combined } if = { limit = { has_idea = SAU_sp_abrams_defensive } remove_ideas = SAU_sp_abrams_defensive } } SAU_clear_arty = { if = { limit = { has_idea = SAU_sp_arty_mass } remove_ideas = SAU_sp_arty_mass } if = { limit = { has_idea = SAU_sp_arty_precision } remove_ideas = SAU_sp_arty_precision } if = { limit = { has_idea = SAU_sp_arty_mobile } remove_ideas = SAU_sp_arty_mobile } } SAU_clear_apache = { if = { limit = { has_idea = SAU_sp_apache_antiarmor } remove_ideas = SAU_sp_apache_antiarmor } if = { limit = { has_idea = SAU_sp_apache_closeair } remove_ideas = SAU_sp_apache_closeair } if = { limit = { has_idea = SAU_sp_apache_recon } remove_ideas = SAU_sp_apache_recon } } SAU_clear_sf = { if = { limit = { has_idea = SAU_sp_sf_counterterror } remove_ideas = SAU_sp_sf_counterterror } if = { limit = { has_idea = SAU_sp_sf_raiders } remove_ideas = SAU_sp_sf_raiders } if = { limit = { has_idea = SAU_sp_sf_recon } remove_ideas = SAU_sp_sf_recon } } SAU_clear_fleet = { if = { limit = { has_idea = SAU_sp_fleet_gulf } remove_ideas = SAU_sp_fleet_gulf } if = { limit = { has_idea = SAU_sp_fleet_bluewater } remove_ideas = SAU_sp_fleet_bluewater } if = { limit = { has_idea = SAU_sp_fleet_coastal } remove_ideas = SAU_sp_fleet_coastal } } SAU_clear_redflag = { if = { limit = { has_idea = SAU_sp_redflag_dogfight } remove_ideas = SAU_sp_redflag_dogfight } if = { limit = { has_idea = SAU_sp_redflag_bvr } remove_ideas = SAU_sp_redflag_bvr } if = { limit = { has_idea = SAU_sp_redflag_defensive } remove_ideas = SAU_sp_redflag_defensive } } SAU_clear_awacs = { if = { limit = { has_idea = SAU_sp_awacs_control } remove_ideas = SAU_sp_awacs_control } if = { limit = { has_idea = SAU_sp_awacs_groundlink } remove_ideas = SAU_sp_awacs_groundlink } if = { limit = { has_idea = SAU_sp_awacs_earlywarn } remove_ideas = SAU_sp_awacs_earlywarn } } SAU_clear_pgm = { if = { limit = { has_idea = SAU_sp_pgm_strike } remove_ideas = SAU_sp_pgm_strike } if = { limit = { has_idea = SAU_sp_pgm_sead } remove_ideas = SAU_sp_pgm_sead } if = { limit = { has_idea = SAU_sp_pgm_interdiction } remove_ideas = SAU_sp_pgm_interdiction } } SAU_clear_reform = { if = { limit = { has_idea = SAU_sp_reform_crash } remove_ideas = SAU_sp_reform_crash } if = { limit = { has_idea = SAU_sp_reform_steady } remove_ideas = SAU_sp_reform_steady } if = { limit = { has_idea = SAU_sp_reform_foreign } remove_ideas = SAU_sp_reform_foreign } } SAU_clear_combat = { if = { limit = { has_idea = SAU_sp_combat_armor } remove_ideas = SAU_sp_combat_armor } if = { limit = { has_idea = SAU_sp_combat_firepower } remove_ideas = SAU_sp_combat_firepower } if = { limit = { has_idea = SAU_sp_combat_infantry } remove_ideas = SAU_sp_combat_infantry } } SAU_clear_posture = { if = { limit = { has_idea = SAU_sp_posture_projection } remove_ideas = SAU_sp_posture_projection } if = { limit = { has_idea = SAU_sp_posture_deterrence } remove_ideas = SAU_sp_posture_deterrence } if = { limit = { has_idea = SAU_sp_posture_homeland } remove_ideas = SAU_sp_posture_homeland } } SAU_clear_vision_ideas = { if = { limit = { has_idea = SAU_vision_2030_expectations } remove_ideas = SAU_vision_2030_expectations } if = { limit = { has_idea = SAU_vision_2030_progress } remove_ideas = SAU_vision_2030_progress } if = { limit = { has_idea = SAU_vision_2030_delivered } remove_ideas = SAU_vision_2030_delivered } if = { limit = { has_idea = SAU_vision_2030_white_elephant } remove_ideas = SAU_vision_2030_white_elephant } } # Re-evaluate the Vision 2030 national mood each month from projects delivered SAU_update_vision2030 = { set_temp_variable = { v2030_eff = SAU_giga_projects_built } subtract_from_temp_variable = { v2030_eff = SAU_giga_projects_failed } if = { limit = { check_variable = { v2030_eff > 11 } } if = { limit = { NOT = { has_idea = SAU_vision_2030_delivered } } SAU_clear_vision_ideas = yes add_ideas = SAU_vision_2030_delivered news_event = { id = SAU_events.82 days = 1 } } } else_if = { limit = { OR = { AND = { date > 2030.1.1 check_variable = { v2030_eff < 6 } } check_variable = { SAU_giga_projects_failed > 7 } } } if = { limit = { NOT = { has_idea = SAU_vision_2030_white_elephant } } SAU_clear_vision_ideas = yes add_ideas = SAU_vision_2030_white_elephant country_event = { id = SAU_events.83 days = 1 } } } else_if = { limit = { check_variable = { v2030_eff > 5 } } if = { limit = { NOT = { has_idea = SAU_vision_2030_progress } } SAU_clear_vision_ideas = yes add_ideas = SAU_vision_2030_progress } } else = { if = { limit = { NOT = { has_idea = SAU_vision_2030_expectations } } SAU_clear_vision_ideas = yes add_ideas = SAU_vision_2030_expectations } } } # Weekly countdown for every undelivered Vision 2030 project; misses fire the penalty SAU_tick_vision_deadlines = { if = { limit = { NOT = { has_country_flag = SAU_committed_neom } NOT = { has_country_flag = SAU_built_neom } NOT = { has_country_flag = SAU_failed_neom } } subtract_from_variable = { SAU_remain_neom = 7 } if = { limit = { check_variable = { SAU_remain_neom < 1 } } set_variable = { SAU_remain_neom = 0 } set_country_flag = SAU_failed_neom add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 932 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_the_line } NOT = { has_country_flag = SAU_built_the_line } NOT = { has_country_flag = SAU_failed_the_line } } subtract_from_variable = { SAU_remain_the_line = 7 } if = { limit = { check_variable = { SAU_remain_the_line < 1 } } set_variable = { SAU_remain_the_line = 0 } set_country_flag = SAU_failed_the_line add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 932 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_oxagon } NOT = { has_country_flag = SAU_built_oxagon } NOT = { has_country_flag = SAU_failed_oxagon } } subtract_from_variable = { SAU_remain_oxagon = 7 } if = { limit = { check_variable = { SAU_remain_oxagon < 1 } } set_variable = { SAU_remain_oxagon = 0 } set_country_flag = SAU_failed_oxagon add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 932 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_trojena } NOT = { has_country_flag = SAU_built_trojena } NOT = { has_country_flag = SAU_failed_trojena } } subtract_from_variable = { SAU_remain_trojena = 7 } if = { limit = { check_variable = { SAU_remain_trojena < 1 } } set_variable = { SAU_remain_trojena = 0 } set_country_flag = SAU_failed_trojena add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 932 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_sindalah } NOT = { has_country_flag = SAU_built_sindalah } NOT = { has_country_flag = SAU_failed_sindalah } } subtract_from_variable = { SAU_remain_sindalah = 7 } if = { limit = { check_variable = { SAU_remain_sindalah < 1 } } set_variable = { SAU_remain_sindalah = 0 } set_country_flag = SAU_failed_sindalah add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 932 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_red_sea } NOT = { has_country_flag = SAU_built_red_sea } NOT = { has_country_flag = SAU_failed_red_sea } } subtract_from_variable = { SAU_remain_red_sea = 7 } if = { limit = { check_variable = { SAU_remain_red_sea < 1 } } set_variable = { SAU_remain_red_sea = 0 } set_country_flag = SAU_failed_red_sea add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 932 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_amaala } NOT = { has_country_flag = SAU_built_amaala } NOT = { has_country_flag = SAU_failed_amaala } } subtract_from_variable = { SAU_remain_amaala = 7 } if = { limit = { check_variable = { SAU_remain_amaala < 1 } } set_variable = { SAU_remain_amaala = 0 } set_country_flag = SAU_failed_amaala add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 932 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_qiddiya } NOT = { has_country_flag = SAU_built_qiddiya } NOT = { has_country_flag = SAU_failed_qiddiya } } subtract_from_variable = { SAU_remain_qiddiya = 7 } if = { limit = { check_variable = { SAU_remain_qiddiya < 1 } } set_variable = { SAU_remain_qiddiya = 0 } set_country_flag = SAU_failed_qiddiya add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 176 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_diriyah } NOT = { has_country_flag = SAU_built_diriyah } NOT = { has_country_flag = SAU_failed_diriyah } } subtract_from_variable = { SAU_remain_diriyah = 7 } if = { limit = { check_variable = { SAU_remain_diriyah < 1 } } set_variable = { SAU_remain_diriyah = 0 } set_country_flag = SAU_failed_diriyah add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 176 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_alula } NOT = { has_country_flag = SAU_built_alula } NOT = { has_country_flag = SAU_failed_alula } } subtract_from_variable = { SAU_remain_alula = 7 } if = { limit = { check_variable = { SAU_remain_alula < 1 } } set_variable = { SAU_remain_alula = 0 } set_country_flag = SAU_failed_alula add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 177 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_new_murabba } NOT = { has_country_flag = SAU_built_new_murabba } NOT = { has_country_flag = SAU_failed_new_murabba } } subtract_from_variable = { SAU_remain_new_murabba = 7 } if = { limit = { check_variable = { SAU_remain_new_murabba < 1 } } set_variable = { SAU_remain_new_murabba = 0 } set_country_flag = SAU_failed_new_murabba add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 176 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_king_salman_park } NOT = { has_country_flag = SAU_built_king_salman_park } NOT = { has_country_flag = SAU_failed_king_salman_park } } subtract_from_variable = { SAU_remain_king_salman_park = 7 } if = { limit = { check_variable = { SAU_remain_king_salman_park < 1 } } set_variable = { SAU_remain_king_salman_park = 0 } set_country_flag = SAU_failed_king_salman_park add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 176 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_sports_blvd } NOT = { has_country_flag = SAU_built_sports_blvd } NOT = { has_country_flag = SAU_failed_sports_blvd } } subtract_from_variable = { SAU_remain_sports_blvd = 7 } if = { limit = { check_variable = { SAU_remain_sports_blvd < 1 } } set_variable = { SAU_remain_sports_blvd = 0 } set_country_flag = SAU_failed_sports_blvd add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 176 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_green_riyadh } NOT = { has_country_flag = SAU_built_green_riyadh } NOT = { has_country_flag = SAU_failed_green_riyadh } } subtract_from_variable = { SAU_remain_green_riyadh = 7 } if = { limit = { check_variable = { SAU_remain_green_riyadh < 1 } } set_variable = { SAU_remain_green_riyadh = 0 } set_country_flag = SAU_failed_green_riyadh add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 176 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_jeddah_central } NOT = { has_country_flag = SAU_built_jeddah_central } NOT = { has_country_flag = SAU_failed_jeddah_central } } subtract_from_variable = { SAU_remain_jeddah_central = 7 } if = { limit = { check_variable = { SAU_remain_jeddah_central < 1 } } set_variable = { SAU_remain_jeddah_central = 0 } set_country_flag = SAU_failed_jeddah_central add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 177 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_soudah_peaks } NOT = { has_country_flag = SAU_built_soudah_peaks } NOT = { has_country_flag = SAU_failed_soudah_peaks } } subtract_from_variable = { SAU_remain_soudah_peaks = 7 } if = { limit = { check_variable = { SAU_remain_soudah_peaks < 1 } } set_variable = { SAU_remain_soudah_peaks = 0 } set_country_flag = SAU_failed_soudah_peaks add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 178 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } if = { limit = { NOT = { has_country_flag = SAU_committed_roshn } NOT = { has_country_flag = SAU_built_roshn } NOT = { has_country_flag = SAU_failed_roshn } } subtract_from_variable = { SAU_remain_roshn = 7 } if = { limit = { check_variable = { SAU_remain_roshn < 1 } } set_variable = { SAU_remain_roshn = 0 } set_country_flag = SAU_failed_roshn add_to_variable = { SAU_giga_projects_failed = 1 } set_temp_variable = { treasury_change = -20 } modify_treasury_effect = yes add_stability = -0.01 176 = { add_building_construction = { type = industrial_complex level = -1 instant_build = yes } } country_event = { id = SAU_events.84 days = 1 } } } } # Crown Prince succession influence race (share-of-the-pie model). # Raw support points accumulate; each prince's displayed share = points / total * 100. # SAU_crown_choice: 0 = undecided, 1 = Salman, 2 = Mohammed bin Nayef, 3 = Mutaib. SAU_init_succession_race = { set_variable = { SAU_salman_points = 45 } set_variable = { SAU_mbn_points = 30 } set_variable = { SAU_mutaib_points = 25 } set_variable = { SAU_crown_choice = 0 } set_country_flag = SAU_succession_race_active SAU_recompute_crown_shares = yes } SAU_recompute_crown_shares = { set_temp_variable = { SAU_crown_total = SAU_salman_points } add_to_temp_variable = { var = SAU_crown_total value = SAU_mbn_points } add_to_temp_variable = { var = SAU_crown_total value = SAU_mutaib_points } if = { limit = { check_variable = { SAU_crown_total < 1 } } set_temp_variable = { SAU_crown_total = 1 } } # Hold the pool at 100. The princes' free monthly manoeuvres used to inflate the total # as fast as anyone climbed, so paid gains were divided away and the share barely moved. multiply_variable = { SAU_salman_points = 100 } divide_variable = { var = SAU_salman_points value = SAU_crown_total } clamp_variable = { var = SAU_salman_points min = 1 } multiply_variable = { SAU_mbn_points = 100 } divide_variable = { var = SAU_mbn_points value = SAU_crown_total } clamp_variable = { var = SAU_mbn_points min = 1 } multiply_variable = { SAU_mutaib_points = 100 } divide_variable = { var = SAU_mutaib_points value = SAU_crown_total } clamp_variable = { var = SAU_mutaib_points min = 1 } set_variable = { SAU_salman_share = SAU_salman_points } set_variable = { SAU_mbn_share = SAU_mbn_points } set_variable = { SAU_mutaib_share = SAU_mutaib_points } } # temp args: prince (1/2/3), amount (may be negative). Points clamp at a floor of 1 so the pie is never empty. SAU_add_crown_points = { if = { limit = { check_variable = { prince = 1 } } add_to_variable = { var = SAU_salman_points value = amount } clamp_variable = { var = SAU_salman_points min = 1 } } else_if = { limit = { check_variable = { prince = 2 } } add_to_variable = { var = SAU_mbn_points value = amount } clamp_variable = { var = SAU_mbn_points min = 1 } } else_if = { limit = { check_variable = { prince = 3 } } add_to_variable = { var = SAU_mutaib_points value = amount } clamp_variable = { var = SAU_mutaib_points min = 1 } } SAU_recompute_crown_shares = yes } # Crown the prince with the most points. Ties resolve to Salman (most senior). Installs via the generic leader system. SAU_resolve_succession = { if = { limit = { check_variable = { SAU_mbn_points > SAU_salman_points } check_variable = { SAU_mbn_points > SAU_mutaib_points } } set_variable = { Kingdom_leader = 1 } } else_if = { limit = { check_variable = { SAU_mutaib_points > SAU_salman_points } check_variable = { SAU_mutaib_points > SAU_mbn_points } } set_variable = { Kingdom_leader = 4 } } else = { set_variable = { Kingdom_leader = 0 } } set_leader = yes # Hand the Reigning Monarch decisions to the winner: 2 Salman, 3 MBN, 4 Mutaib. if = { limit = { check_variable = { SAU_mbn_points > SAU_salman_points } check_variable = { SAU_mbn_points > SAU_mutaib_points } } set_variable = { SAU_current_king = 3 } } else_if = { limit = { check_variable = { SAU_mutaib_points > SAU_salman_points } check_variable = { SAU_mutaib_points > SAU_mbn_points } } set_variable = { SAU_current_king = 4 } } else = { set_variable = { SAU_current_king = 2 } # Only Salman's reign opens the contest over who follows him. SAU_init_crown_prince_race = yes set_variable = { SAU_salman_health = 100 } SAU_salman_health_set_tier = yes } clr_country_flag = SAU_succession_race_active } # Second race, under King Salman: MBS against MBN for Crown Prince. SAU_mbn_points is reused # on purpose so the standing he built in the Abdullah-era race carries into this one. # SAU_heir_choice: 0 = undecided, 1 = MBS, 2 = MBN. SAU_init_crown_prince_race = { set_variable = { SAU_mbs_points = 40 } clamp_variable = { var = SAU_mbn_points min = 20 } set_variable = { SAU_heir_choice = 0 } set_country_flag = SAU_crown_prince_race_active SAU_recompute_heir_shares = yes } SAU_recompute_heir_shares = { set_temp_variable = { SAU_heir_total = SAU_mbs_points } add_to_temp_variable = { var = SAU_heir_total value = SAU_mbn_points } if = { limit = { check_variable = { SAU_heir_total < 1 } } set_temp_variable = { SAU_heir_total = 1 } } # Same reason as the three-way race: keep the pool at 100. multiply_variable = { SAU_mbs_points = 100 } divide_variable = { var = SAU_mbs_points value = SAU_heir_total } clamp_variable = { var = SAU_mbs_points min = 1 } multiply_variable = { SAU_mbn_points = 100 } divide_variable = { var = SAU_mbn_points value = SAU_heir_total } clamp_variable = { var = SAU_mbn_points min = 1 } set_variable = { SAU_heir_mbs_share = SAU_mbs_points } set_variable = { SAU_heir_mbn_share = SAU_mbn_points } } # temp args: heir (1 MBS / 2 MBN), amount (may be negative). Floor of 1 keeps the pie non-empty. SAU_add_heir_points = { if = { limit = { check_variable = { heir = 1 } } add_to_variable = { var = SAU_mbs_points value = amount } clamp_variable = { var = SAU_mbs_points min = 1 } } else_if = { limit = { check_variable = { heir = 2 } } add_to_variable = { var = SAU_mbn_points value = amount } clamp_variable = { var = SAU_mbn_points min = 1 } } SAU_recompute_heir_shares = yes } # Names the Crown Prince using the same ids the Reigning Monarch decisions read: 5 MBS, 3 MBN. # MBS is the fallthrough so an untouched race gives the historical 2017 outcome, mirroring # Salman's position in SAU_resolve_succession. SAU_resolve_crown_prince = { if = { limit = { check_variable = { SAU_mbn_points > SAU_mbs_points } } set_variable = { SAU_crown_prince = 3 } } else = { set_variable = { SAU_crown_prince = 5 } } clr_country_flag = SAU_crown_prince_race_active set_country_flag = SAU_crown_prince_named } # King Salman's health, 100 down to 0. Decline accelerates with age so he passes of his own # accord around 2030, aged 94; SAU_on_actions forces the issue in 2032 if he has been propped up. SAU_salman_health_tick = { if = { limit = { date < 2020.1.1 } subtract_from_variable = { SAU_salman_health = 0.3 } } else_if = { limit = { date < 2025.1.1 } subtract_from_variable = { SAU_salman_health = 0.5 } } else_if = { limit = { date < 2028.1.1 } subtract_from_variable = { SAU_salman_health = 0.8 } } else = { subtract_from_variable = { SAU_salman_health = 1 } } clamp_variable = { var = SAU_salman_health min = 0 max = 100 } SAU_salman_health_set_tier = yes } SAU_salman_health_set_tier = { SAU_salman_health_clear = yes if = { limit = { check_variable = { SAU_salman_health > 80 } } add_ideas = SAU_salman_health_stable } else_if = { limit = { check_variable = { SAU_salman_health > 60 } } add_ideas = SAU_salman_health_declining } else_if = { limit = { check_variable = { SAU_salman_health > 40 } } add_ideas = SAU_salman_health_serious } else_if = { limit = { check_variable = { SAU_salman_health > 20 } } add_ideas = SAU_salman_health_critical } else = { add_ideas = SAU_salman_health_near_death } } SAU_salman_health_clear = { if = { limit = { has_idea = SAU_salman_health_stable } remove_ideas = SAU_salman_health_stable } if = { limit = { has_idea = SAU_salman_health_declining } remove_ideas = SAU_salman_health_declining } if = { limit = { has_idea = SAU_salman_health_serious } remove_ideas = SAU_salman_health_serious } if = { limit = { has_idea = SAU_salman_health_critical } remove_ideas = SAU_salman_health_critical } if = { limit = { has_idea = SAU_salman_health_near_death } remove_ideas = SAU_salman_health_near_death } } # Salman passes; the named Crown Prince takes the throne. Kingdom_leader: 2 MBS, 1 MBN. SAU_crown_prince_accedes = { SAU_salman_health_clear = yes set_variable = { SAU_current_king = SAU_crown_prince } if = { limit = { check_variable = { SAU_crown_prince = 5 } } set_variable = { Kingdom_leader = 2 } } else = { set_variable = { Kingdom_leader = 1 } } set_leader = yes clr_country_flag = SAU_crown_prince_named } # Pipeline tier-management effects (SAU pipeline feature) SAU_yemen_set_tier = { if = { limit = { has_idea = SAU_yemen_pipeline_t1 } remove_ideas = SAU_yemen_pipeline_t1 } if = { limit = { has_idea = SAU_yemen_pipeline_t2 } remove_ideas = SAU_yemen_pipeline_t2 } if = { limit = { has_idea = SAU_yemen_pipeline_t3 } remove_ideas = SAU_yemen_pipeline_t3 } if = { limit = { country_exists = YEM } YEM = { if = { limit = { has_idea = SAU_pipeline_transit_YEM_t1 } remove_ideas = SAU_pipeline_transit_YEM_t1 } if = { limit = { has_idea = SAU_pipeline_transit_YEM_t2 } remove_ideas = SAU_pipeline_transit_YEM_t2 } if = { limit = { has_idea = SAU_pipeline_transit_YEM_t3 } remove_ideas = SAU_pipeline_transit_YEM_t3 } set_variable = { additional_income_SAU_pipeline_transit = 0 } } } if = { limit = { check_variable = { SAU_yemen_tier = 1 } } add_ideas = SAU_yemen_pipeline_t1 if = { limit = { country_exists = YEM } YEM = { add_ideas = SAU_pipeline_transit_YEM_t1 } } } if = { limit = { check_variable = { SAU_yemen_tier = 2 } } add_ideas = SAU_yemen_pipeline_t2 if = { limit = { country_exists = YEM } YEM = { add_ideas = SAU_pipeline_transit_YEM_t2 } } } if = { limit = { check_variable = { SAU_yemen_tier = 3 } } add_ideas = SAU_yemen_pipeline_t3 if = { limit = { country_exists = YEM } YEM = { add_ideas = SAU_pipeline_transit_YEM_t3 } } } } SAU_yemen_tier_down = { if = { limit = { has_idea = SAU_yemen_pipeline_t3 } set_temp_variable = { SAU_yemen_tier = 2 } SAU_yemen_set_tier = yes } else_if = { limit = { has_idea = SAU_yemen_pipeline_t2 } set_temp_variable = { SAU_yemen_tier = 1 } SAU_yemen_set_tier = yes } else_if = { limit = { has_idea = SAU_yemen_pipeline_t1 } set_temp_variable = { SAU_yemen_tier = 0 } SAU_yemen_set_tier = yes clr_country_flag = SAU_yemen_pipeline_open set_variable = { SAU_yemen_saved_tier = 0 } if = { limit = { has_idea = SAU_pipeline_empire } remove_ideas = SAU_pipeline_empire } } } SAU_yemen_tier_up = { if = { limit = { has_idea = SAU_yemen_pipeline_t1 } set_temp_variable = { SAU_yemen_tier = 2 } SAU_yemen_set_tier = yes } else_if = { limit = { has_idea = SAU_yemen_pipeline_t2 } set_temp_variable = { SAU_yemen_tier = 3 } SAU_yemen_set_tier = yes } } SAU_syria_set_tier = { if = { limit = { has_idea = SAU_syria_pipeline_t1 } remove_ideas = SAU_syria_pipeline_t1 } if = { limit = { has_idea = SAU_syria_pipeline_t2 } remove_ideas = SAU_syria_pipeline_t2 } if = { limit = { has_idea = SAU_syria_pipeline_t3 } remove_ideas = SAU_syria_pipeline_t3 } if = { limit = { country_exists = JOR } JOR = { if = { limit = { has_idea = SAU_pipeline_transit_JOR_t1 } remove_ideas = SAU_pipeline_transit_JOR_t1 } if = { limit = { has_idea = SAU_pipeline_transit_JOR_t2 } remove_ideas = SAU_pipeline_transit_JOR_t2 } if = { limit = { has_idea = SAU_pipeline_transit_JOR_t3 } remove_ideas = SAU_pipeline_transit_JOR_t3 } set_variable = { additional_income_SAU_pipeline_transit = 0 } } } if = { limit = { country_exists = SYR } SYR = { if = { limit = { has_idea = SAU_pipeline_transit_SYR_t1 } remove_ideas = SAU_pipeline_transit_SYR_t1 } if = { limit = { has_idea = SAU_pipeline_transit_SYR_t2 } remove_ideas = SAU_pipeline_transit_SYR_t2 } if = { limit = { has_idea = SAU_pipeline_transit_SYR_t3 } remove_ideas = SAU_pipeline_transit_SYR_t3 } set_variable = { additional_income_SAU_pipeline_transit = 0 } } } if = { limit = { country_exists = FSA } FSA = { if = { limit = { has_idea = SAU_pipeline_transit_SYR_t1 } remove_ideas = SAU_pipeline_transit_SYR_t1 } if = { limit = { has_idea = SAU_pipeline_transit_SYR_t2 } remove_ideas = SAU_pipeline_transit_SYR_t2 } if = { limit = { has_idea = SAU_pipeline_transit_SYR_t3 } remove_ideas = SAU_pipeline_transit_SYR_t3 } set_variable = { additional_income_SAU_pipeline_transit = 0 } } } if = { limit = { check_variable = { SAU_syria_tier = 1 } } add_ideas = SAU_syria_pipeline_t1 if = { limit = { country_exists = JOR } JOR = { add_ideas = SAU_pipeline_transit_JOR_t1 } } if = { limit = { country_exists = SYR } SYR = { add_ideas = SAU_pipeline_transit_SYR_t1 } } if = { limit = { country_exists = FSA } FSA = { add_ideas = SAU_pipeline_transit_SYR_t1 } } } if = { limit = { check_variable = { SAU_syria_tier = 2 } } add_ideas = SAU_syria_pipeline_t2 if = { limit = { country_exists = JOR } JOR = { add_ideas = SAU_pipeline_transit_JOR_t2 } } if = { limit = { country_exists = SYR } SYR = { add_ideas = SAU_pipeline_transit_SYR_t2 } } if = { limit = { country_exists = FSA } FSA = { add_ideas = SAU_pipeline_transit_SYR_t2 } } } if = { limit = { check_variable = { SAU_syria_tier = 3 } } add_ideas = SAU_syria_pipeline_t3 if = { limit = { country_exists = JOR } JOR = { add_ideas = SAU_pipeline_transit_JOR_t3 } } if = { limit = { country_exists = SYR } SYR = { add_ideas = SAU_pipeline_transit_SYR_t3 } } if = { limit = { country_exists = FSA } FSA = { add_ideas = SAU_pipeline_transit_SYR_t3 } } } } SAU_syria_tier_down = { if = { limit = { has_idea = SAU_syria_pipeline_t3 } set_temp_variable = { SAU_syria_tier = 2 } SAU_syria_set_tier = yes } else_if = { limit = { has_idea = SAU_syria_pipeline_t2 } set_temp_variable = { SAU_syria_tier = 1 } SAU_syria_set_tier = yes } else_if = { limit = { has_idea = SAU_syria_pipeline_t1 } set_temp_variable = { SAU_syria_tier = 0 } SAU_syria_set_tier = yes clr_country_flag = SAU_syria_pipeline_open set_variable = { SAU_syria_saved_tier = 0 } if = { limit = { has_idea = SAU_pipeline_empire } remove_ideas = SAU_pipeline_empire } } } SAU_syria_tier_up = { if = { limit = { has_idea = SAU_syria_pipeline_t1 } set_temp_variable = { SAU_syria_tier = 2 } SAU_syria_set_tier = yes } else_if = { limit = { has_idea = SAU_syria_pipeline_t2 } set_temp_variable = { SAU_syria_tier = 3 } SAU_syria_set_tier = yes } } SAU_iraq_set_tier = { if = { limit = { has_idea = SAU_iraq_pipeline_t1 } remove_ideas = SAU_iraq_pipeline_t1 } if = { limit = { has_idea = SAU_iraq_pipeline_t2 } remove_ideas = SAU_iraq_pipeline_t2 } if = { limit = { has_idea = SAU_iraq_pipeline_t3 } remove_ideas = SAU_iraq_pipeline_t3 } if = { limit = { country_exists = IRQ } IRQ = { if = { limit = { has_idea = SAU_pipeline_transit_IRQ_t1 } remove_ideas = SAU_pipeline_transit_IRQ_t1 } if = { limit = { has_idea = SAU_pipeline_transit_IRQ_t2 } remove_ideas = SAU_pipeline_transit_IRQ_t2 } if = { limit = { has_idea = SAU_pipeline_transit_IRQ_t3 } remove_ideas = SAU_pipeline_transit_IRQ_t3 } set_variable = { additional_income_SAU_pipeline_transit = 0 } } } if = { limit = { check_variable = { SAU_iraq_tier = 1 } } add_ideas = SAU_iraq_pipeline_t1 if = { limit = { country_exists = IRQ } IRQ = { add_ideas = SAU_pipeline_transit_IRQ_t1 } } } if = { limit = { check_variable = { SAU_iraq_tier = 2 } } add_ideas = SAU_iraq_pipeline_t2 if = { limit = { country_exists = IRQ } IRQ = { add_ideas = SAU_pipeline_transit_IRQ_t2 } } } if = { limit = { check_variable = { SAU_iraq_tier = 3 } } add_ideas = SAU_iraq_pipeline_t3 if = { limit = { country_exists = IRQ } IRQ = { add_ideas = SAU_pipeline_transit_IRQ_t3 } } } } SAU_iraq_tier_down = { if = { limit = { has_idea = SAU_iraq_pipeline_t3 } set_temp_variable = { SAU_iraq_tier = 2 } SAU_iraq_set_tier = yes } else_if = { limit = { has_idea = SAU_iraq_pipeline_t2 } set_temp_variable = { SAU_iraq_tier = 1 } SAU_iraq_set_tier = yes } else_if = { limit = { has_idea = SAU_iraq_pipeline_t1 } set_temp_variable = { SAU_iraq_tier = 0 } SAU_iraq_set_tier = yes clr_country_flag = SAU_iraq_pipeline_open set_variable = { SAU_iraq_saved_tier = 0 } if = { limit = { has_idea = SAU_pipeline_empire } remove_ideas = SAU_pipeline_empire } clr_country_flag = SAU_turkey_pipeline_open if = { limit = { country_exists = TUR } TUR = { if = { limit = { has_idea = SAU_pipeline_transit_TUR_t1 } remove_ideas = SAU_pipeline_transit_TUR_t1 } if = { limit = { has_idea = SAU_pipeline_transit_TUR_t2 } remove_ideas = SAU_pipeline_transit_TUR_t2 } if = { limit = { has_idea = SAU_pipeline_transit_TUR_t3 } remove_ideas = SAU_pipeline_transit_TUR_t3 } set_variable = { additional_income_SAU_pipeline_transit = 0 } } } } } SAU_iraq_tier_up = { if = { limit = { has_idea = SAU_iraq_pipeline_t1 } set_temp_variable = { SAU_iraq_tier = 2 } SAU_iraq_set_tier = yes } else_if = { limit = { has_idea = SAU_iraq_pipeline_t2 } set_temp_variable = { SAU_iraq_tier = 3 } SAU_iraq_set_tier = yes } } # Reopening a route the Kingdom shut down itself resumes at the tier it was closed at, so # shutdown-and-reopen cannot stand in for the repair decisions after sabotage. SAU_restore_route_yemen = { set_temp_variable = { SAU_yemen_tier = 3 } if = { limit = { check_variable = { SAU_yemen_saved_tier > 0 } } set_temp_variable = { SAU_yemen_tier = SAU_yemen_saved_tier } set_variable = { SAU_yemen_saved_tier = 0 } } SAU_yemen_set_tier = yes } SAU_restore_route_syria = { set_temp_variable = { SAU_syria_tier = 3 } if = { limit = { check_variable = { SAU_syria_saved_tier > 0 } } set_temp_variable = { SAU_syria_tier = SAU_syria_saved_tier } set_variable = { SAU_syria_saved_tier = 0 } } SAU_syria_set_tier = yes } SAU_restore_route_iraq = { set_temp_variable = { SAU_iraq_tier = 3 } if = { limit = { check_variable = { SAU_iraq_saved_tier > 0 } } set_temp_variable = { SAU_iraq_tier = SAU_iraq_saved_tier } set_variable = { SAU_iraq_saved_tier = 0 } } SAU_iraq_set_tier = yes } # Pipeline shutdown effects - tier 0 tears the route down through the same set_tier path # that built it, so SAU's spirit and every transit partner's come off together. SAU_close_route_yemen = { if = { limit = { has_idea = SAU_yemen_pipeline_t1 } set_variable = { SAU_yemen_saved_tier = 1 } } else_if = { limit = { has_idea = SAU_yemen_pipeline_t2 } set_variable = { SAU_yemen_saved_tier = 2 } } else = { set_variable = { SAU_yemen_saved_tier = 3 } } set_temp_variable = { SAU_yemen_tier = 0 } SAU_yemen_set_tier = yes clr_country_flag = SAU_yemen_pipeline_open if = { limit = { has_idea = SAU_pipeline_empire } remove_ideas = SAU_pipeline_empire } add_to_variable = { oil_dependence = -5 } custom_effect_tooltip = SAU_tt_pipeline_shutdown_dependence if = { limit = { country_exists = YEM } YEM = { add_opinion_modifier = { target = ROOT modifier = SAU_pipeline_shutdown } } } } SAU_close_route_syria = { if = { limit = { has_idea = SAU_syria_pipeline_t1 } set_variable = { SAU_syria_saved_tier = 1 } } else_if = { limit = { has_idea = SAU_syria_pipeline_t2 } set_variable = { SAU_syria_saved_tier = 2 } } else = { set_variable = { SAU_syria_saved_tier = 3 } } set_temp_variable = { SAU_syria_tier = 0 } SAU_syria_set_tier = yes clr_country_flag = SAU_syria_pipeline_open if = { limit = { has_idea = SAU_pipeline_empire } remove_ideas = SAU_pipeline_empire } add_to_variable = { oil_dependence = -5 } custom_effect_tooltip = SAU_tt_pipeline_shutdown_dependence if = { limit = { country_exists = JOR } JOR = { add_opinion_modifier = { target = ROOT modifier = SAU_pipeline_shutdown } } } if = { limit = { country_exists = SYR } SYR = { add_opinion_modifier = { target = ROOT modifier = SAU_pipeline_shutdown } } } if = { limit = { country_exists = FSA } FSA = { add_opinion_modifier = { target = ROOT modifier = SAU_pipeline_shutdown } } } } SAU_close_route_iraq = { SAU_close_route_turkey = yes if = { limit = { has_idea = SAU_iraq_pipeline_t1 } set_variable = { SAU_iraq_saved_tier = 1 } } else_if = { limit = { has_idea = SAU_iraq_pipeline_t2 } set_variable = { SAU_iraq_saved_tier = 2 } } else = { set_variable = { SAU_iraq_saved_tier = 3 } } set_temp_variable = { SAU_iraq_tier = 0 } SAU_iraq_set_tier = yes clr_country_flag = SAU_iraq_pipeline_open if = { limit = { has_idea = SAU_pipeline_empire } remove_ideas = SAU_pipeline_empire } add_to_variable = { oil_dependence = -5 } custom_effect_tooltip = SAU_tt_pipeline_shutdown_dependence if = { limit = { country_exists = IRQ } IRQ = { add_opinion_modifier = { target = ROOT modifier = SAU_pipeline_shutdown } } } } # Called on its own from the Turkey decision and folded into the Iraq teardown, since the # extension has nothing to carry once the trunk line through Iraq is shut. SAU_close_route_turkey = { if = { limit = { has_country_flag = SAU_turkey_pipeline_open } clr_country_flag = SAU_turkey_pipeline_open add_to_variable = { oil_dependence = -3 } custom_effect_tooltip = SAU_tt_pipeline_shutdown_dependence if = { limit = { country_exists = TUR } TUR = { if = { limit = { has_idea = SAU_pipeline_transit_TUR_t1 } remove_ideas = SAU_pipeline_transit_TUR_t1 } if = { limit = { has_idea = SAU_pipeline_transit_TUR_t2 } remove_ideas = SAU_pipeline_transit_TUR_t2 } if = { limit = { has_idea = SAU_pipeline_transit_TUR_t3 } remove_ideas = SAU_pipeline_transit_TUR_t3 } add_opinion_modifier = { target = ROOT modifier = SAU_pipeline_shutdown } } } } } SAU_purge_monarchy_parties = { set_partyall_allowed = yes add_popularity = { ideology = fascism popularity = -1 } set_variable = { party_pop_array^10 = 0 } #Kingdom (House of Saud) set_variable = { party_pop_array^11 = 0 } #Caliphate (Al-Qaeda) set_temp_variable = { party_index = 9 } ban_party_scripted_call = yes set_temp_variable = { party_index = 10 } ban_party_scripted_call = yes recalculate_party = yes } SAU_attach_baath_state = { set_country_flag = SAU_baath_state_active if = { limit = { NOT = { has_variable = SAU_baath_pp } } set_variable = { SAU_baath_pp = 0 } } if = { limit = { NOT = { has_variable = SAU_baath_stab } } set_variable = { SAU_baath_stab = 0 } } if = { limit = { NOT = { has_variable = SAU_baath_ws } } set_variable = { SAU_baath_ws = 0 } } if = { limit = { NOT = { has_variable = SAU_baath_attack } } set_variable = { SAU_baath_attack = 0 } } if = { limit = { NOT = { has_variable = SAU_baath_consc } } set_variable = { SAU_baath_consc = 0 } } add_dynamic_modifier = { modifier = SAU_baath_state } } # Debug only (see SAU_debug_category). Wipes the reign-dependent state so a jump between # monarchs cannot leave a stale health tier, decree lock or half-finished succession race. SAU_debug_reset_reign = { SAU_salman_health_clear = yes clr_country_flag = SAU_succession_race_active clr_country_flag = SAU_crown_prince_race_active clr_country_flag = SAU_crown_prince_named clr_country_flag = SAU_royal_decree_active } SAU_faisalite_clear_spirits = { if = { limit = { has_idea = SAU_faisalite_interventionist_dominant } remove_ideas = SAU_faisalite_interventionist_dominant } if = { limit = { has_idea = SAU_faisalite_interventionist_leaning } remove_ideas = SAU_faisalite_interventionist_leaning } if = { limit = { has_idea = SAU_faisalite_balanced } remove_ideas = SAU_faisalite_balanced } if = { limit = { has_idea = SAU_faisalite_isolationist_leaning } remove_ideas = SAU_faisalite_isolationist_leaning } if = { limit = { has_idea = SAU_faisalite_isolationist_dominant } remove_ideas = SAU_faisalite_isolationist_dominant } } # Interventionist minus isolationist decides the spirit. Called by every decision, focus # and event that moves either count. SAU_faisalite_update_balance = { clamp_variable = { var = SAU_faisalite_interventionist min = 0 } clamp_variable = { var = SAU_faisalite_isolationist min = 0 } set_temp_variable = { SAU_faisalite_diff = SAU_faisalite_interventionist } subtract_from_temp_variable = { SAU_faisalite_diff = SAU_faisalite_isolationist } SAU_faisalite_clear_spirits = yes if = { limit = { check_variable = { SAU_faisalite_diff > 7 } } add_ideas = SAU_faisalite_interventionist_dominant } else_if = { limit = { check_variable = { SAU_faisalite_diff > 2 } } add_ideas = SAU_faisalite_interventionist_leaning } else_if = { limit = { check_variable = { SAU_faisalite_diff > -3 } } add_ideas = SAU_faisalite_balanced } else_if = { limit = { check_variable = { SAU_faisalite_diff > -8 } } add_ideas = SAU_faisalite_isolationist_leaning } else = { add_ideas = SAU_faisalite_isolationist_dominant } } # Mirror of the tier walk inside SAU_tadawul_tier_up, one step down. Ordered low-to-high so a # single call cannot cascade a tier past its neighbour. SAU_tadawul_demote = { if = { limit = { has_idea = SAU_tadawul_market_t1 } swap_ideas = { remove_idea = SAU_tadawul_market_t1 add_idea = SAU_tadawul_market } } if = { limit = { has_idea = SAU_tadawul_market_t2 } swap_ideas = { remove_idea = SAU_tadawul_market_t2 add_idea = SAU_tadawul_market_t1 } } if = { limit = { has_idea = SAU_tadawul_market_t3 } swap_ideas = { remove_idea = SAU_tadawul_market_t3 add_idea = SAU_tadawul_market_t2 } } if = { limit = { has_idea = SAU_tadawul_market_t4 } swap_ideas = { remove_idea = SAU_tadawul_market_t4 add_idea = SAU_tadawul_market_t3 } } if = { limit = { has_idea = SAU_tadawul_market_t5 } swap_ideas = { remove_idea = SAU_tadawul_market_t5 add_idea = SAU_tadawul_market_t4 } } if = { limit = { has_idea = SAU_tadawul_market_t6 } swap_ideas = { remove_idea = SAU_tadawul_market_t6 add_idea = SAU_tadawul_market_t5 } } if = { limit = { has_idea = SAU_tadawul_market_t7 } swap_ideas = { remove_idea = SAU_tadawul_market_t7 add_idea = SAU_tadawul_market_t6 } } if = { limit = { has_idea = SAU_tadawul_market_t8 } swap_ideas = { remove_idea = SAU_tadawul_market_t8 add_idea = SAU_tadawul_market_t7 } } if = { limit = { has_idea = SAU_tadawul_market_t9 } swap_ideas = { remove_idea = SAU_tadawul_market_t9 add_idea = SAU_tadawul_market_t8 } } if = { limit = { has_idea = SAU_tadawul_market_t10 } swap_ideas = { remove_idea = SAU_tadawul_market_t10 add_idea = SAU_tadawul_market_t9 } } } SAU_army_grievance_clear = { if = { limit = { has_idea = SAU_grievance_contained } remove_ideas = SAU_grievance_contained } if = { limit = { has_idea = SAU_grievance_restive } remove_ideas = SAU_grievance_restive } if = { limit = { has_idea = SAU_grievance_bitter } remove_ideas = SAU_grievance_bitter } if = { limit = { has_idea = SAU_grievance_mutinous } remove_ideas = SAU_grievance_mutinous } if = { limit = { has_idea = SAU_grievance_brink } remove_ideas = SAU_grievance_brink } } # Hidden badge for the officer corps' resentment. Read out by GetSAUArmyGrievance. SAU_army_grievance_set_tier = { clamp_variable = { var = SAU_army_grievance min = 0 max = 100 } SAU_army_grievance_clear = yes if = { limit = { check_variable = { SAU_army_grievance > 79 } } add_ideas = SAU_grievance_brink } else_if = { limit = { check_variable = { SAU_army_grievance > 59 } } add_ideas = SAU_grievance_mutinous } else_if = { limit = { check_variable = { SAU_army_grievance > 39 } } add_ideas = SAU_grievance_bitter } else_if = { limit = { check_variable = { SAU_army_grievance > 19 } } add_ideas = SAU_grievance_restive } else = { add_ideas = SAU_grievance_contained } } # Tears down every monarchy-era system in one place. SAU_monarchy_abolished is the # remove_trigger on the House of Al Saud modifier and the cancel on the Faisalite spirits. SAU_end_the_monarchy = { set_country_flag = SAU_monarchy_abolished clr_country_flag = SAU_succession_race_active clr_country_flag = SAU_crown_prince_race_active clr_country_flag = SAU_crown_prince_named clr_country_flag = SAU_officer_grievance_active set_variable = { SAU_current_king = 0 } set_variable = { SAU_army_grievance = 0 } hidden_effect = { SAU_army_grievance_clear = yes } } SAU_junta_clear_tiers = { if = { limit = { has_idea = SAU_junta_accepted } remove_ideas = SAU_junta_accepted } if = { limit = { has_idea = SAU_junta_tolerated } remove_ideas = SAU_junta_tolerated } if = { limit = { has_idea = SAU_junta_contested } remove_ideas = SAU_junta_contested } if = { limit = { has_idea = SAU_junta_rejected } remove_ideas = SAU_junta_rejected } if = { limit = { has_idea = SAU_junta_illegitimate } remove_ideas = SAU_junta_illegitimate } if = { limit = { has_idea = SAU_junta_grip_firm } remove_ideas = SAU_junta_grip_firm } if = { limit = { has_idea = SAU_junta_grip_uneven } remove_ideas = SAU_junta_grip_uneven } if = { limit = { has_idea = SAU_junta_grip_slipping } remove_ideas = SAU_junta_grip_slipping } } # The junta runs on two counters: Control is what it can enforce, Legitimacy is what it is # owed. Legitimacy is the danger dial, so the badge hangs off it. SAU_junta_set_tier = { clamp_variable = { var = SAU_junta_control min = 0 max = 100 } clamp_variable = { var = SAU_junta_legitimacy min = 0 max = 100 } SAU_junta_clear_tiers = yes if = { limit = { check_variable = { SAU_junta_legitimacy > 79 } } add_ideas = SAU_junta_accepted } else_if = { limit = { check_variable = { SAU_junta_legitimacy > 59 } } add_ideas = SAU_junta_tolerated } else_if = { limit = { check_variable = { SAU_junta_legitimacy > 39 } } add_ideas = SAU_junta_contested } else_if = { limit = { check_variable = { SAU_junta_legitimacy > 19 } } add_ideas = SAU_junta_rejected } else = { add_ideas = SAU_junta_illegitimate } # control decides how far the Council's writ actually runs if = { limit = { check_variable = { SAU_junta_control > 59 } } add_ideas = SAU_junta_grip_firm } else_if = { limit = { check_variable = { SAU_junta_control > 34 } } add_ideas = SAU_junta_grip_uneven } else = { add_ideas = SAU_junta_grip_slipping } } # Mutaib's circle in the National Guard, from the Gaza winter of 2009 to the day he # either takes up Faisal's programme or is talked out of it. Mirrors the army-grievance model. SAU_faisalite_conviction_clear = { if = { limit = { has_idea = SAU_faisalite_conviction_decided } remove_ideas = SAU_faisalite_conviction_decided } if = { limit = { has_idea = SAU_faisalite_conviction_insistent } remove_ideas = SAU_faisalite_conviction_insistent } if = { limit = { has_idea = SAU_faisalite_conviction_gathering } remove_ideas = SAU_faisalite_conviction_gathering } if = { limit = { has_idea = SAU_faisalite_conviction_stirring } remove_ideas = SAU_faisalite_conviction_stirring } if = { limit = { has_idea = SAU_faisalite_conviction_dormant } remove_ideas = SAU_faisalite_conviction_dormant } } SAU_faisalite_conviction_set_tier = { clamp_variable = { var = SAU_faisalite_conviction min = 0 max = 100 } SAU_faisalite_conviction_clear = yes if = { limit = { check_variable = { SAU_faisalite_conviction > 79 } } add_ideas = SAU_faisalite_conviction_decided } else_if = { limit = { check_variable = { SAU_faisalite_conviction > 59 } } add_ideas = SAU_faisalite_conviction_insistent } else_if = { limit = { check_variable = { SAU_faisalite_conviction > 39 } } add_ideas = SAU_faisalite_conviction_gathering } else_if = { limit = { check_variable = { SAU_faisalite_conviction > 19 } } add_ideas = SAU_faisalite_conviction_stirring } else = { add_ideas = SAU_faisalite_conviction_dormant } } # Majlis ash-Shura: three benches compete for the Council's seats. Whichever holds the # most decides how the Council reads the files it is finally allowed to read. SAU_shura_clear = { if = { limit = { has_idea = SAU_shura_led_ulema } remove_ideas = SAU_shura_led_ulema } if = { limit = { has_idea = SAU_shura_led_technocrats } remove_ideas = SAU_shura_led_technocrats } if = { limit = { has_idea = SAU_shura_led_notables } remove_ideas = SAU_shura_led_notables } if = { limit = { has_idea = SAU_shura_charter_ulema } remove_ideas = SAU_shura_charter_ulema } if = { limit = { has_idea = SAU_shura_charter_technocrats } remove_ideas = SAU_shura_charter_technocrats } if = { limit = { has_idea = SAU_shura_charter_notables } remove_ideas = SAU_shura_charter_notables } } SAU_shura_set_tier = { clamp_variable = { var = SAU_shura_ulema min = 0 max = 100 } clamp_variable = { var = SAU_shura_technocrats min = 0 max = 100 } clamp_variable = { var = SAU_shura_notables min = 0 max = 100 } # once a bench is chartered the Council's character is settled and the # seat count stops deciding anything if = { limit = { has_country_flag = SAU_shura_chartered } SAU_shura_clear = yes } else = { SAU_shura_clear = yes if = { limit = { check_variable = { SAU_shura_technocrats > SAU_shura_ulema } check_variable = { SAU_shura_technocrats > SAU_shura_notables } } add_ideas = SAU_shura_led_technocrats if = { limit = { check_variable = { SAU_shura_technocrats > 69 } NOT = { has_country_flag = SAU_shura_charter_offered } } set_country_flag = SAU_shura_charter_offered country_event = { id = SAU_events.220 days = 3 } } } else_if = { limit = { check_variable = { SAU_shura_notables > SAU_shura_ulema } check_variable = { SAU_shura_notables > SAU_shura_technocrats } } add_ideas = SAU_shura_led_notables if = { limit = { check_variable = { SAU_shura_notables > 69 } NOT = { has_country_flag = SAU_shura_charter_offered } } set_country_flag = SAU_shura_charter_offered country_event = { id = SAU_events.221 days = 3 } } } else = { add_ideas = SAU_shura_led_ulema if = { limit = { check_variable = { SAU_shura_ulema > 69 } NOT = { has_country_flag = SAU_shura_charter_offered } } set_country_flag = SAU_shura_charter_offered country_event = { id = SAU_events.222 days = 3 } } } } } # The Council sits by the King's leave and falls with him. SAU_shura_dissolve = { clr_country_flag = SAU_shura_open set_variable = { SAU_shura_ulema = 0 } set_variable = { SAU_shura_technocrats = 0 } set_variable = { SAU_shura_notables = 0 } SAU_shura_clear = yes } # The People's Council is elected: seats move, the chamber does not grow. SAU_pc_clamp_seats = { clamp_variable = { var = SAU_pc_standing min = 0 max = 100 } clamp_variable = { var = SAU_pc_reformists min = 0 max = 100 } clamp_variable = { var = SAU_pc_traditionalists min = 0 max = 100 } clamp_variable = { var = SAU_pc_provincials min = 0 max = 100 } } # The Council asks for more each time it is satisfied, but never for more than a # province of this size can carry. SAU_pc_clamp_works = { clamp_variable = { var = SAU_pc_standing min = 0 max = 100 } clamp_variable = { var = SAU_pc_req_civ min = 1 max = 3 } clamp_variable = { var = SAU_pc_req_off min = 1 max = 3 } clamp_variable = { var = SAU_pc_req_inf min = 1 max = 2 } } # Clearing the race flags is what stops the manoeuvre missions: each of them carries # available = { NOT = { has_country_flag = ..._race_active } }, so they close themselves. SAU_succession_dissolve = { clr_country_flag = SAU_succession_race_active clr_country_flag = SAU_crown_prince_race_active clr_country_flag = SAU_crown_prince_named remove_mission = SAU_salman_maneuver remove_mission = SAU_mbn_maneuver remove_mission = SAU_mutaib_maneuver remove_mission = SAU_heir_mbs_maneuver remove_mission = SAU_heir_mbn_maneuver custom_effect_tooltip = SAU_succession_dissolved_tt } # The Tadawul ladder was copied into every focus in the branch, where swap_ideas # inside a limit renders nothing - the player paid the money and saw no reward. SAU_tadawul_tier_up = { if = { limit = { has_idea = SAU_tadawul_market_t10 } custom_effect_tooltip = SAU_tadawul_matured_tt one_office_construction = yes } else_if = { limit = { has_idea = SAU_tadawul_market_t9 } effect_tooltip = { add_ideas = SAU_tadawul_market_t10 } } else_if = { limit = { has_idea = SAU_tadawul_market_t8 } effect_tooltip = { add_ideas = SAU_tadawul_market_t9 } } else_if = { limit = { has_idea = SAU_tadawul_market_t7 } effect_tooltip = { add_ideas = SAU_tadawul_market_t8 } } else_if = { limit = { has_idea = SAU_tadawul_market_t6 } effect_tooltip = { add_ideas = SAU_tadawul_market_t7 } } else_if = { limit = { has_idea = SAU_tadawul_market_t5 } effect_tooltip = { add_ideas = SAU_tadawul_market_t6 } } else_if = { limit = { has_idea = SAU_tadawul_market_t4 } effect_tooltip = { add_ideas = SAU_tadawul_market_t5 } } else_if = { limit = { has_idea = SAU_tadawul_market_t3 } effect_tooltip = { add_ideas = SAU_tadawul_market_t4 } } else_if = { limit = { has_idea = SAU_tadawul_market_t2 } effect_tooltip = { add_ideas = SAU_tadawul_market_t3 } } else_if = { limit = { has_idea = SAU_tadawul_market_t1 } effect_tooltip = { add_ideas = SAU_tadawul_market_t2 } } else_if = { limit = { has_idea = SAU_tadawul_market } effect_tooltip = { add_ideas = SAU_tadawul_market_t1 } } else = { custom_effect_tooltip = SAU_tadawul_needs_market_tt effect_tooltip = { add_ideas = SAU_tadawul_market } } hidden_effect = { if = { limit = { has_idea = SAU_tadawul_market_t9 } swap_ideas = { remove_idea = SAU_tadawul_market_t9 add_idea = SAU_tadawul_market_t10 } } if = { limit = { has_idea = SAU_tadawul_market_t8 } swap_ideas = { remove_idea = SAU_tadawul_market_t8 add_idea = SAU_tadawul_market_t9 } } if = { limit = { has_idea = SAU_tadawul_market_t7 } swap_ideas = { remove_idea = SAU_tadawul_market_t7 add_idea = SAU_tadawul_market_t8 } } if = { limit = { has_idea = SAU_tadawul_market_t6 } swap_ideas = { remove_idea = SAU_tadawul_market_t6 add_idea = SAU_tadawul_market_t7 } } if = { limit = { has_idea = SAU_tadawul_market_t5 } swap_ideas = { remove_idea = SAU_tadawul_market_t5 add_idea = SAU_tadawul_market_t6 } } if = { limit = { has_idea = SAU_tadawul_market_t4 } swap_ideas = { remove_idea = SAU_tadawul_market_t4 add_idea = SAU_tadawul_market_t5 } } if = { limit = { has_idea = SAU_tadawul_market_t3 } swap_ideas = { remove_idea = SAU_tadawul_market_t3 add_idea = SAU_tadawul_market_t4 } } if = { limit = { has_idea = SAU_tadawul_market_t2 } swap_ideas = { remove_idea = SAU_tadawul_market_t2 add_idea = SAU_tadawul_market_t3 } } if = { limit = { has_idea = SAU_tadawul_market_t1 } swap_ideas = { remove_idea = SAU_tadawul_market_t1 add_idea = SAU_tadawul_market_t2 } } if = { limit = { has_idea = SAU_tadawul_market } swap_ideas = { remove_idea = SAU_tadawul_market add_idea = SAU_tadawul_market_t1 } } } } # Sovereign Waters reads stability: what the Kingdom can promise about water is whatever # the country believes about it. Opened by SAU_the_sovereign_saudi_water_company, then monthly. SAU_water_pride_set_tier = { hidden_effect = { if = { limit = { has_idea = SAU_national_water_pride_minus4 } remove_ideas = SAU_national_water_pride_minus4 } if = { limit = { has_idea = SAU_national_water_pride_minus3 } remove_ideas = SAU_national_water_pride_minus3 } if = { limit = { has_idea = SAU_national_water_pride_minus2 } remove_ideas = SAU_national_water_pride_minus2 } if = { limit = { has_idea = SAU_national_water_pride_minus1 } remove_ideas = SAU_national_water_pride_minus1 } if = { limit = { has_idea = SAU_national_water_pride_neutral } remove_ideas = SAU_national_water_pride_neutral } if = { limit = { has_idea = SAU_national_water_pride_plus1 } remove_ideas = SAU_national_water_pride_plus1 } if = { limit = { has_idea = SAU_national_water_pride_plus2 } remove_ideas = SAU_national_water_pride_plus2 } if = { limit = { has_idea = SAU_national_water_pride_plus3 } remove_ideas = SAU_national_water_pride_plus3 } if = { limit = { has_idea = SAU_national_water_pride_plus4 } remove_ideas = SAU_national_water_pride_plus4 } if = { limit = { has_stability < 0.15 } add_ideas = SAU_national_water_pride_minus4 } else_if = { limit = { has_stability < 0.25 } add_ideas = SAU_national_water_pride_minus3 } else_if = { limit = { has_stability < 0.35 } add_ideas = SAU_national_water_pride_minus2 } else_if = { limit = { has_stability < 0.45 } add_ideas = SAU_national_water_pride_minus1 } else_if = { limit = { has_stability < 0.55 } add_ideas = SAU_national_water_pride_neutral } else_if = { limit = { has_stability < 0.65 } add_ideas = SAU_national_water_pride_plus1 } else_if = { limit = { has_stability < 0.75 } add_ideas = SAU_national_water_pride_plus2 } else_if = { limit = { has_stability < 0.85 } add_ideas = SAU_national_water_pride_plus3 } else = { add_ideas = SAU_national_water_pride_plus4 } } } # The Presidency's standing capability. Kept in one effect so the founding focus and the # save-repair path in SAU_intel_expand_gip can never drift apart. SAU_found_gip_network = { add_dynamic_modifier = { modifier = SAU_gip_network } custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = SAU_gip_network } add_to_variable = { SAU_gip_agency_defense = 0.5 tooltip = intelligence_agency_defense_tt } add_to_variable = { SAU_gip_network_gain = 0.1 tooltip = intel_network_gain_factor_tt } add_to_variable = { SAU_gip_detection = 0.1 tooltip = enemy_operative_detection_chance_tt } add_to_variable = { SAU_gip_encryption = 0.05 tooltip = encryption_factor_tt } add_to_variable = { SAU_gip_decryption = 0.05 tooltip = decryption_factor_tt } add_to_variable = { SAU_gip_subversion = -0.1 tooltip = foreign_subversive_activites_tt } } # The standing standard is what the Council asks for; a province can only give what it has # room for. Factories take the shared slots first, offices what is left, infrastructure its own. SAU_pc_set_mandate = { set_temp_variable = { SAU_pc_room = 0 } if = { limit = { event_target:SAU_pc_works_province = { free_building_slots = { building = industrial_complex size > 0 include_locked = yes } } } add_to_temp_variable = { SAU_pc_room = 1 } } if = { limit = { event_target:SAU_pc_works_province = { free_building_slots = { building = industrial_complex size > 1 include_locked = yes } } } add_to_temp_variable = { SAU_pc_room = 1 } } if = { limit = { event_target:SAU_pc_works_province = { free_building_slots = { building = industrial_complex size > 2 include_locked = yes } } } add_to_temp_variable = { SAU_pc_room = 1 } } set_temp_variable = { SAU_pc_have_civ = event_target:SAU_pc_works_province.building_level@industrial_complex } set_temp_variable = { SAU_pc_have_off = event_target:SAU_pc_works_province.building_level@offices } set_temp_variable = { SAU_pc_cap_civ = SAU_pc_have_civ } add_to_temp_variable = { var = SAU_pc_cap_civ value = SAU_pc_room } set_variable = { SAU_pc_mandate_civ = SAU_pc_req_civ } clamp_variable = { var = SAU_pc_mandate_civ min = 0 max = SAU_pc_cap_civ } set_temp_variable = { SAU_pc_used = SAU_pc_mandate_civ } subtract_from_temp_variable = { SAU_pc_used = SAU_pc_have_civ } clamp_temp_variable = { var = SAU_pc_used min = 0 max = SAU_pc_room } set_temp_variable = { SAU_pc_left = SAU_pc_room } subtract_from_temp_variable = { SAU_pc_left = SAU_pc_used } set_temp_variable = { SAU_pc_cap_off = SAU_pc_have_off } add_to_temp_variable = { var = SAU_pc_cap_off value = SAU_pc_left } set_variable = { SAU_pc_mandate_off = SAU_pc_req_off } clamp_variable = { var = SAU_pc_mandate_off min = 0 max = SAU_pc_cap_off } set_temp_variable = { SAU_pc_inf_room = 0 } if = { limit = { event_target:SAU_pc_works_province = { free_building_slots = { building = infrastructure size > 0 } } } add_to_temp_variable = { SAU_pc_inf_room = 1 } } if = { limit = { event_target:SAU_pc_works_province = { free_building_slots = { building = infrastructure size > 1 } } } add_to_temp_variable = { SAU_pc_inf_room = 1 } } set_temp_variable = { SAU_pc_have_inf = event_target:SAU_pc_works_province.building_level@infrastructure } set_temp_variable = { SAU_pc_cap_inf = SAU_pc_have_inf } add_to_temp_variable = { var = SAU_pc_cap_inf value = SAU_pc_inf_room } set_variable = { SAU_pc_mandate_inf = SAU_pc_req_inf } clamp_variable = { var = SAU_pc_mandate_inf min = 0 max = SAU_pc_cap_inf } } # manoeuvres inflated the point total as fast as anyone climbed, so the player's paid # gains were divided away by a growing denominator and the share barely moved. # Same idea with only two claimants, so the whole gain comes out of the other one.