# Author(s): TheGeneral CHI_reset_ic_commissions = { set_variable = { CHI_ic_slot_1 = 0 } set_variable = { CHI_ic_slot_2 = 0 } set_variable = { CHI_ic_slot_3 = 0 } } CHI_16th_congress_succession_tooltip = { custom_effect_tooltip = CHI_16th_congress_succession_tt newline = yes custom_effect_tooltip = current_effect_tooltip if = { limit = { is_power_balance_in_range = { id = CHI_factional_balance range > CHI_shanghai_clique_leaning } } custom_effect_tooltip = CHI_16th_congress_successor_hu_tt } else = { custom_effect_tooltip = CHI_16th_congress_successor_zeng_tt } } CHI_18th_congress_succession_tooltip = { custom_effect_tooltip = CHI_18th_congress_succession_tt newline = yes custom_effect_tooltip = current_effect_tooltip if = { limit = { is_power_balance_in_range = { id = CHI_factional_balance range > CHI_collective_leadership_active } } custom_effect_tooltip = CHI_18th_congress_successor_bo_tt } else = { custom_effect_tooltip = CHI_18th_congress_successor_xi_tt } } CHI_gain_commission_influence = { set_temp_variable = { CHI_ic_slot_check = CHI_ic_slot_1 } CHI_add_influence_to_active_commission = yes set_temp_variable = { CHI_ic_slot_check = CHI_ic_slot_2 } CHI_add_influence_to_active_commission = yes set_temp_variable = { CHI_ic_slot_check = CHI_ic_slot_3 } CHI_add_influence_to_active_commission = yes } CHI_add_influence_to_active_commission = { if = { limit = { check_variable = { CHI_ic_slot_check = 1 } } add_to_variable = { CHI_ic_inf_org = 5 } clamp_variable = { var = CHI_ic_inf_org min = 0 max = 100 } set_temp_variable = { CHI_ic_tier_target = 1 } CHI_apply_single_commission_tier = yes } else_if = { limit = { check_variable = { CHI_ic_slot_check = 2 } } add_to_variable = { CHI_ic_inf_pub = 5 } clamp_variable = { var = CHI_ic_inf_pub min = 0 max = 100 } set_temp_variable = { CHI_ic_tier_target = 2 } CHI_apply_single_commission_tier = yes } else_if = { limit = { check_variable = { CHI_ic_slot_check = 3 } } add_to_variable = { CHI_ic_inf_ufwd = 5 } clamp_variable = { var = CHI_ic_inf_ufwd min = 0 max = 100 } set_temp_variable = { CHI_ic_tier_target = 3 } CHI_apply_single_commission_tier = yes } else_if = { limit = { check_variable = { CHI_ic_slot_check = 4 } } add_to_variable = { CHI_ic_inf_intl = 5 } clamp_variable = { var = CHI_ic_inf_intl min = 0 max = 100 } set_temp_variable = { CHI_ic_tier_target = 4 } CHI_apply_single_commission_tier = yes } else_if = { limit = { check_variable = { CHI_ic_slot_check = 5 } } add_to_variable = { CHI_ic_inf_social = 5 } clamp_variable = { var = CHI_ic_inf_social min = 0 max = 100 } set_temp_variable = { CHI_ic_tier_target = 5 } CHI_apply_single_commission_tier = yes } else_if = { limit = { check_variable = { CHI_ic_slot_check = 6 } } add_to_variable = { CHI_ic_inf_cplac = 5 } clamp_variable = { var = CHI_ic_inf_cplac min = 0 max = 100 } set_temp_variable = { CHI_ic_tier_target = 6 } CHI_apply_single_commission_tier = yes } else_if = { limit = { check_variable = { CHI_ic_slot_check = 7 } } add_to_variable = { CHI_ic_inf_nsc = 5 } clamp_variable = { var = CHI_ic_inf_nsc min = 0 max = 100 } set_temp_variable = { CHI_ic_tier_target = 7 } CHI_apply_single_commission_tier = yes } } CHI_apply_commission_ideas = { set_temp_variable = { CHI_ic_tier_target = 1 } CHI_apply_single_commission_tier = yes set_temp_variable = { CHI_ic_tier_target = 2 } CHI_apply_single_commission_tier = yes set_temp_variable = { CHI_ic_tier_target = 3 } CHI_apply_single_commission_tier = yes set_temp_variable = { CHI_ic_tier_target = 4 } CHI_apply_single_commission_tier = yes set_temp_variable = { CHI_ic_tier_target = 5 } CHI_apply_single_commission_tier = yes set_temp_variable = { CHI_ic_tier_target = 6 } CHI_apply_single_commission_tier = yes set_temp_variable = { CHI_ic_tier_target = 7 } CHI_apply_single_commission_tier = yes } CHI_apply_single_commission_tier = { if = { limit = { check_variable = { CHI_ic_tier_target = 1 } } if = { limit = { check_variable = { CHI_ic_inf_org > 99 } } if = { limit = { NOT = { has_idea = CHI_organisation_department_3 } } if = { limit = { has_idea = CHI_organisation_department_1 } remove_ideas = CHI_organisation_department_1 } if = { limit = { has_idea = CHI_organisation_department_2 } remove_ideas = CHI_organisation_department_2 } add_ideas = CHI_organisation_department_3 } } else_if = { limit = { check_variable = { CHI_ic_inf_org > 69 } } if = { limit = { NOT = { has_idea = CHI_organisation_department_2 } } if = { limit = { has_idea = CHI_organisation_department_1 } remove_ideas = CHI_organisation_department_1 } add_ideas = CHI_organisation_department_2 } } else_if = { limit = { check_variable = { CHI_ic_inf_org > 34 } } if = { limit = { NOT = { has_idea = CHI_organisation_department_1 } } add_ideas = CHI_organisation_department_1 } } } else_if = { limit = { check_variable = { CHI_ic_tier_target = 2 } } if = { limit = { check_variable = { CHI_ic_inf_pub > 99 } } if = { limit = { NOT = { has_idea = CHI_publicity_department_3 } } if = { limit = { has_idea = CHI_publicity_department_1 } remove_ideas = CHI_publicity_department_1 } if = { limit = { has_idea = CHI_publicity_department_2 } remove_ideas = CHI_publicity_department_2 } add_ideas = CHI_publicity_department_3 } } else_if = { limit = { check_variable = { CHI_ic_inf_pub > 69 } } if = { limit = { NOT = { has_idea = CHI_publicity_department_2 } } if = { limit = { has_idea = CHI_publicity_department_1 } remove_ideas = CHI_publicity_department_1 } add_ideas = CHI_publicity_department_2 } } else_if = { limit = { check_variable = { CHI_ic_inf_pub > 34 } } if = { limit = { NOT = { has_idea = CHI_publicity_department_1 } } add_ideas = CHI_publicity_department_1 } } } else_if = { limit = { check_variable = { CHI_ic_tier_target = 3 } } if = { limit = { check_variable = { CHI_ic_inf_ufwd > 99 } } if = { limit = { NOT = { has_idea = CHI_united_front_department_3 } } if = { limit = { has_idea = CHI_united_front_department_1 } remove_ideas = CHI_united_front_department_1 } if = { limit = { has_idea = CHI_united_front_department_2 } remove_ideas = CHI_united_front_department_2 } add_ideas = CHI_united_front_department_3 } } else_if = { limit = { check_variable = { CHI_ic_inf_ufwd > 69 } } if = { limit = { NOT = { has_idea = CHI_united_front_department_2 } } if = { limit = { has_idea = CHI_united_front_department_1 } remove_ideas = CHI_united_front_department_1 } add_ideas = CHI_united_front_department_2 } } else_if = { limit = { check_variable = { CHI_ic_inf_ufwd > 34 } } if = { limit = { NOT = { has_idea = CHI_united_front_department_1 } } add_ideas = CHI_united_front_department_1 } } } else_if = { limit = { check_variable = { CHI_ic_tier_target = 4 } } if = { limit = { check_variable = { CHI_ic_inf_intl > 99 } } if = { limit = { NOT = { has_idea = CHI_international_department_3 } } if = { limit = { has_idea = CHI_international_department_1 } remove_ideas = CHI_international_department_1 } if = { limit = { has_idea = CHI_international_department_2 } remove_ideas = CHI_international_department_2 } add_ideas = CHI_international_department_3 } } else_if = { limit = { check_variable = { CHI_ic_inf_intl > 69 } } if = { limit = { NOT = { has_idea = CHI_international_department_2 } } if = { limit = { has_idea = CHI_international_department_1 } remove_ideas = CHI_international_department_1 } add_ideas = CHI_international_department_2 } } else_if = { limit = { check_variable = { CHI_ic_inf_intl > 34 } } if = { limit = { NOT = { has_idea = CHI_international_department_1 } } add_ideas = CHI_international_department_1 } } } else_if = { limit = { check_variable = { CHI_ic_tier_target = 5 } } if = { limit = { check_variable = { CHI_ic_inf_social > 99 } } if = { limit = { NOT = { has_idea = CHI_society_department_3 } } if = { limit = { has_idea = CHI_society_department_1 } remove_ideas = CHI_society_department_1 } if = { limit = { has_idea = CHI_society_department_2 } remove_ideas = CHI_society_department_2 } add_ideas = CHI_society_department_3 } } else_if = { limit = { check_variable = { CHI_ic_inf_social > 69 } } if = { limit = { NOT = { has_idea = CHI_society_department_2 } } if = { limit = { has_idea = CHI_society_department_1 } remove_ideas = CHI_society_department_1 } add_ideas = CHI_society_department_2 } } else_if = { limit = { check_variable = { CHI_ic_inf_social > 34 } } if = { limit = { NOT = { has_idea = CHI_society_department_1 } } add_ideas = CHI_society_department_1 } } } else_if = { limit = { check_variable = { CHI_ic_tier_target = 6 } } if = { limit = { check_variable = { CHI_ic_inf_cplac > 99 } } if = { limit = { NOT = { has_idea = CHI_central_political_commission_3 } } if = { limit = { has_idea = CHI_central_political_commission_1 } remove_ideas = CHI_central_political_commission_1 } if = { limit = { has_idea = CHI_central_political_commission_2 } remove_ideas = CHI_central_political_commission_2 } add_ideas = CHI_central_political_commission_3 } } else_if = { limit = { check_variable = { CHI_ic_inf_cplac > 69 } } if = { limit = { NOT = { has_idea = CHI_central_political_commission_2 } } if = { limit = { has_idea = CHI_central_political_commission_1 } remove_ideas = CHI_central_political_commission_1 } add_ideas = CHI_central_political_commission_2 } } else_if = { limit = { check_variable = { CHI_ic_inf_cplac > 34 } } if = { limit = { NOT = { has_idea = CHI_central_political_commission_1 } } add_ideas = CHI_central_political_commission_1 } } } else_if = { limit = { check_variable = { CHI_ic_tier_target = 7 } } if = { limit = { check_variable = { CHI_ic_inf_nsc > 99 } } if = { limit = { NOT = { has_idea = CHI_national_security_commission_3 } } if = { limit = { has_idea = CHI_national_security_commission_1 } remove_ideas = CHI_national_security_commission_1 } if = { limit = { has_idea = CHI_national_security_commission_2 } remove_ideas = CHI_national_security_commission_2 } add_ideas = CHI_national_security_commission_3 } } else_if = { limit = { check_variable = { CHI_ic_inf_nsc > 69 } } if = { limit = { NOT = { has_idea = CHI_national_security_commission_2 } } if = { limit = { has_idea = CHI_national_security_commission_1 } remove_ideas = CHI_national_security_commission_1 } add_ideas = CHI_national_security_commission_2 } } else_if = { limit = { check_variable = { CHI_ic_inf_nsc > 34 } } if = { limit = { NOT = { has_idea = CHI_national_security_commission_1 } } add_ideas = CHI_national_security_commission_1 } } } } CHI_update_sinicization = { set_temp_variable = { sinicization_compliance = THIS.compliance } subtract_from_temp_variable = { sinicization_compliance = THIS.resistance } divide_temp_variable = { sinicization_compliance = 100 } set_temp_variable = { sinicization_extra_change = sinicization_base_change } multiply_temp_variable = { sinicization_extra_change = sinicization_compliance } add_to_temp_variable = { sinicization_base_change = sinicization_extra_change } set_temp_variable = { sinicization_compliance = CHI.CHI_sinicization_modifier } set_temp_variable = { sinicization_extra_change = sinicization_base_change } multiply_temp_variable = { sinicization_extra_change = sinicization_compliance } add_to_temp_variable = { sinicization_base_change = sinicization_extra_change } } # The SAR state is the canonical store; CHI keeps a mirror because decision-category descriptions cannot scope to a state id. # Callers set sinicization_base_change, then call the wrapper for the SAR being changed. CHI_apply_sinicization_HKG = { 595 = { CHI_update_sinicization = yes add_to_variable = { HKG_sinicization_var = sinicization_base_change tooltip = HKG_sinicization_tt } clamp_variable = { var = HKG_sinicization_var min = 0 max = 100 } CHI = { set_variable = { HKG_sinicization_var = PREV.HKG_sinicization_var } } } } CHI_apply_sinicization_MAC = { 1106 = { CHI_update_sinicization = yes add_to_variable = { MAC_sinicization_var = sinicization_base_change tooltip = MAC_sinicization_tt } clamp_variable = { var = MAC_sinicization_var min = 0 max = 100 } CHI = { set_variable = { MAC_sinicization_var = PREV.MAC_sinicization_var } } } } CHI_apply_sinicization_TIB = { 589 = { CHI_update_sinicization = yes add_to_variable = { TIB_sinicization_var = sinicization_base_change tooltip = TIB_sinicization_tt } clamp_variable = { var = TIB_sinicization_var min = 0 max = 100 } CHI = { set_variable = { TIB_sinicization_var = PREV.TIB_sinicization_var } } } } CHI_apply_sinicization_ETK = { 592 = { CHI_update_sinicization = yes add_to_variable = { ETK_sinicization_var = sinicization_base_change tooltip = ETK_sinicization_tt } clamp_variable = { var = ETK_sinicization_var min = 0 max = 100 } CHI = { set_variable = { ETK_sinicization_var = PREV.ETK_sinicization_var } } 591 = { set_variable = { ETK_sinicization_var = PREV.ETK_sinicization_var } } } } CHI_apply_sinicization_OMG = { 556 = { CHI_update_sinicization = yes add_to_variable = { OMG_sinicization_var = sinicization_base_change tooltip = OMG_sinicization_tt } clamp_variable = { var = OMG_sinicization_var min = 0 max = 100 } CHI = { set_variable = { OMG_sinicization_var = PREV.OMG_sinicization_var } } 1097 = { set_variable = { OMG_sinicization_var = PREV.OMG_sinicization_var } } } } # CHI_update_sinicization rewrites sinicization_base_change in place, so the caller's input has to be restored before every wrapper call. CHI_apply_sinicization_all_SARs = { set_temp_variable = { sinicization_saved_base = sinicization_base_change } if = { limit = { 595 = { owns_or_subject_of = yes NOT = { is_core_of = CHI } } } set_temp_variable = { sinicization_base_change = sinicization_saved_base } CHI_apply_sinicization_HKG = yes } if = { limit = { 1106 = { owns_or_subject_of = yes NOT = { is_core_of = CHI } } } set_temp_variable = { sinicization_base_change = sinicization_saved_base } CHI_apply_sinicization_MAC = yes } if = { limit = { 589 = { is_owned_by = CHI NOT = { is_core_of = CHI } } } set_temp_variable = { sinicization_base_change = sinicization_saved_base } CHI_apply_sinicization_TIB = yes } if = { limit = { 592 = { is_owned_by = CHI NOT = { is_core_of = CHI } } } set_temp_variable = { sinicization_base_change = sinicization_saved_base } CHI_apply_sinicization_ETK = yes } if = { limit = { 556 = { is_owned_by = CHI NOT = { is_core_of = CHI } } } set_temp_variable = { sinicization_base_change = sinicization_saved_base } CHI_apply_sinicization_OMG = yes } } # SCO membership scripted effects CHI_sco_add_dialogue_partner = { add_ideas = CHI_sco_dialogue_partner add_to_array = { global.CHI_sco_dialogue_partners = THIS } } CHI_sco_promote_to_observer = { if = { limit = { has_idea = CHI_sco_dialogue_partner } remove_ideas = CHI_sco_dialogue_partner remove_from_array = { global.CHI_sco_dialogue_partners = THIS } } add_ideas = CHI_sco_observer add_to_array = { global.CHI_sco_observers = THIS } } CHI_sco_promote_to_member = { if = { limit = { has_idea = CHI_sco_observer } remove_ideas = CHI_sco_observer remove_from_array = { global.CHI_sco_observers = THIS } } if = { limit = { has_idea = CHI_sco_dialogue_partner } remove_ideas = CHI_sco_dialogue_partner remove_from_array = { global.CHI_sco_dialogue_partners = THIS } } if = { limit = { CHI = { has_idea = CHI_sco_member_econ } } add_ideas = CHI_sco_member_econ } else_if = { limit = { CHI = { has_idea = CHI_sco_member_pol } } add_ideas = CHI_sco_member_pol } else_if = { limit = { CHI = { has_idea = CHI_sco_member_mil } } add_ideas = CHI_sco_member_mil } else = { add_ideas = CHI_sco_member } add_to_array = { global.sco_members = THIS } } CHI_sco_remove = { if = { limit = { has_idea = CHI_sco_member } remove_ideas = CHI_sco_member remove_from_array = { global.sco_members = THIS } } if = { limit = { has_idea = CHI_sco_member_econ } remove_ideas = CHI_sco_member_econ remove_from_array = { global.sco_members = THIS } } if = { limit = { has_idea = CHI_sco_member_pol } remove_ideas = CHI_sco_member_pol remove_from_array = { global.sco_members = THIS } } if = { limit = { has_idea = CHI_sco_member_mil } remove_ideas = CHI_sco_member_mil remove_from_array = { global.sco_members = THIS } } if = { limit = { has_idea = CHI_sco_observer } remove_ideas = CHI_sco_observer remove_from_array = { global.CHI_sco_observers = THIS } } if = { limit = { has_idea = CHI_sco_dialogue_partner } remove_ideas = CHI_sco_dialogue_partner remove_from_array = { global.CHI_sco_dialogue_partners = THIS } } } CHI_sco_demote_member = { if = { limit = { has_idea = CHI_sco_member } remove_ideas = CHI_sco_member } if = { limit = { has_idea = CHI_sco_member_econ } remove_ideas = CHI_sco_member_econ } if = { limit = { has_idea = CHI_sco_member_pol } remove_ideas = CHI_sco_member_pol } if = { limit = { has_idea = CHI_sco_member_mil } remove_ideas = CHI_sco_member_mil } remove_from_array = { global.sco_members = THIS } add_ideas = CHI_sco_observer add_to_array = { global.CHI_sco_observers = THIS } } CHI_sco_demote_observer = { remove_ideas = CHI_sco_observer remove_from_array = { global.CHI_sco_observers = THIS } add_ideas = CHI_sco_dialogue_partner add_to_array = { global.CHI_sco_dialogue_partners = THIS } } ### SCO Bilateral Helper ### CHI_sco_bilateral_complete = { if = { limit = { NOT = { original_tag = CHI } check_variable = { var = global.sco_cohesion_yearly_contribution value = 3 compare = greater_than_or_equals } } custom_effect_tooltip = SCO_bilateral_capped_tt } else = { CHI = { add_to_variable = { var = CHI_sco_cohesion value = PREV.sco_cohesion_amount } clamp_variable = { var = CHI_sco_cohesion min = 0 max = 100 } } if = { limit = { NOT = { original_tag = CHI } } add_to_variable = { var = global.sco_cohesion_yearly_contribution value = sco_cohesion_amount } } } add_opinion_modifier = { target = FROM modifier = sco_cooperation } FROM = { add_opinion_modifier = { target = ROOT modifier = sco_cooperation } } } CHI_add_brokerage = { custom_effect_tooltip = CHI_add_brokerage_tt add_to_variable = { var = CHI_beijing_brokerage value = BROKERAGE_AMOUNT } clamp_variable = { var = CHI_beijing_brokerage min = 0 max = 100 } } ### Belt and Road Initiative ### # Project types: 1=port 2=railway 3=pipeline 4=telecom 5=SEZ 6=mine 7=powerplant 8=prestige CHI_bri_unlock = { add_to_variable = { CHI_bri_monthly_income_base = 8 } add_to_variable = { CHI_bri_project_slots = 6 } set_variable = { CHI_bri_project_cost = 40 } set_variable = { CHI_bri_committed_projects = 0 } set_variable = { CHI_bri_return_per_project = 4 } set_variable = { CHI_bri_monthly_income_total = CHI_bri_monthly_income_base } add_ideas = CHI_belt_and_road_initiative_idea if = { limit = { is_ai = yes } set_country_flag = CHI_bri_auto_accept } CHI_bri_recalc_presence = yes add_dynamic_modifier = { modifier = CHI_bri_presence_modifier } CHI_bri_mark_dirty = yes } CHI_bri_recalc_presence = { set_temp_variable = { bri_presence = CHI_bri_global_presence } clamp_temp_variable = { var = bri_presence min = 0 max = 200 } set_variable = { CHI_bri_presence_political_power_factor = { value = bri_presence multiply = 0.00075 } } set_variable = { CHI_bri_presence_trade_opinion_factor = { value = bri_presence multiply = 0.00125 } } set_variable = { CHI_bri_presence_consumer_goods_factor = { value = bri_presence multiply = -0.00075 multiply = 0.5 } } set_variable = { CHI_bri_presence_monthly_population = { value = bri_presence multiply = 0.0015 } } } CHI_bri_mark_dirty = { if = { limit = { is_ai = no } if = { limit = { check_variable = { global.CHI_bri_dirty_update_var < 10000 } } add_to_variable = { global.CHI_bri_dirty_update_var = 1 } } else = { set_variable = { global.CHI_bri_dirty_update_var = 1 } } } } CHI_bri_request_project = { set_country_flag = bri_pipeline_busy set_variable = { bri_project_cost_committed = CHI.CHI_bri_project_cost } CHI = { add_to_variable = { CHI_bri_committed_projects = 1 } subtract_from_variable = { var = CHI_bri_treasury value = CHI_bri_project_cost } clamp_variable = { var = CHI_bri_treasury min = 0 } CHI_bri_mark_dirty = yes } if = { limit = { CHI = { has_country_flag = CHI_bri_auto_accept } } CHI_bri_start_project = yes } else = { set_country_flag = bri_pending_application country_event = { id = chi_bri.9 days = 3 } } } CHI_bri_start_project = { if = { limit = { CHI_bri_reserved_application_is_valid = yes } clr_country_flag = bri_pending_application if = { limit = { check_variable = { var = treasury value = bri_project_cost_committed compare = greater_than_or_equals } } set_temp_variable = { treasury_change = bri_project_cost_committed } multiply_temp_variable = { treasury_change = -1 } modify_treasury_effect = yes set_country_flag = bri_project_financed_cash CHI = { set_temp_variable = { treasury_change = PREV.bri_project_cost_committed } modify_treasury_effect = yes } } else = { set_country_flag = bri_project_financed_loan CHI_bri_issue_loan = yes country_event = { id = chi_bri.23 days = 1 } } activate_mission = CHI_bri_project_mission } else = { CHI_bri_cancel_project = yes } } CHI_bri_complete_project = { if = { limit = { has_country_flag = bri_pipeline_busy } set_temp_variable = { bri_project_granted = 0 } if = { limit = { country_exists = CHI } CHI_bri_grant_project_reward = yes } if = { limit = { check_variable = { bri_project_granted = 1 } } add_to_variable = { bri_projects_completed = 1 } CHI_bri_advance_named_project = yes CHI = { add_to_variable = { CHI_bri_completed_projects = 1 } } CHI_bri_apply_partner_rank = yes CHI = { set_temp_variable = { int_investment_change = CHI_bri_return_per_project } set_temp_variable = { bri_return_mult = 1 } add_to_temp_variable = { bri_return_mult = CHI_bri_returns_multiplier_base } add_to_temp_variable = { bri_return_mult = modifier@CHI_bri_returns_multiplier } multiply_temp_variable = { int_investment_change = bri_return_mult } modify_international_investment_effect = yes } } else = { CHI_bri_unwind_project_financing = yes } CHI_bri_release_project = yes } } CHI_bri_unwind_project_financing = { if = { limit = { country_exists = CHI } CHI = { add_to_variable = { var = CHI_bri_treasury value = PREV.bri_project_cost_committed } } } if = { limit = { has_country_flag = bri_project_financed_cash } set_temp_variable = { treasury_change = bri_project_cost_committed } modify_treasury_effect = yes if = { limit = { country_exists = CHI } CHI = { set_temp_variable = { treasury_change = PREV.bri_project_cost_committed } multiply_temp_variable = { treasury_change = -1 } modify_treasury_effect = yes } } } else_if = { limit = { has_country_flag = bri_project_financed_loan } set_temp_variable = { bri_debt_reduction = bri_project_cost_committed } CHI_bri_reduce_loan = yes } } CHI_bri_release_project = { clr_country_flag = bri_pipeline_busy clr_country_flag = bri_pending_application clr_country_flag = bri_project_financed_cash clr_country_flag = bri_project_financed_loan set_variable = { bri_project_cost_committed = 0 } if = { limit = { country_exists = CHI } CHI = { subtract_from_variable = { CHI_bri_committed_projects = 1 } clamp_variable = { var = CHI_bri_committed_projects min = 0 } CHI_bri_mark_dirty = yes } } } CHI_bri_cancel_project = { if = { limit = { has_country_flag = bri_pipeline_busy } if = { limit = { has_country_flag = bri_pending_application } if = { limit = { country_exists = CHI } CHI = { add_to_variable = { var = CHI_bri_treasury value = PREV.bri_project_cost_committed } } } } else = { CHI_bri_unwind_project_financing = yes } CHI_bri_release_project = yes remove_mission = CHI_bri_project_mission } } CHI_bri_grant_project_reward = { if = { limit = { check_variable = { bri_project_type = 1 } CHI_bri_can_host_port = yes } random_owned_controlled_state = { limit = { is_coastal = yes infrastructure < 5 } add_dynamic_modifier = { modifier = CHI_bri_state_port } add_building_construction = { type = infrastructure level = 1 instant_build = yes } } set_temp_variable = { bri_project_granted = 1 } CHI = { add_to_variable = { CHI_bri_ports_built = 1 } } } else_if = { limit = { check_variable = { bri_project_type = 2 } CHI_bri_can_host_rail = yes } random_owned_controlled_state = { limit = { infrastructure < 5 } add_dynamic_modifier = { modifier = CHI_bri_state_rail } add_building_construction = { type = infrastructure level = 1 instant_build = yes } } set_temp_variable = { bri_project_granted = 1 } CHI = { add_to_variable = { CHI_bri_railways_built = 1 } } } else_if = { limit = { check_variable = { bri_project_type = 3 } CHI_bri_can_host_pipeline = yes } random_owned_controlled_state = { limit = { OR = { has_resources_amount = { resource = oil amount > 4 } has_resources_amount = { resource = steel amount > 4 } has_resources_amount = { resource = chromium amount > 4 } } } add_dynamic_modifier = { modifier = CHI_bri_state_pipeline } } set_temp_variable = { bri_project_granted = 1 } CHI = { add_to_variable = { CHI_bri_pipelines_built = 1 } } } else_if = { limit = { check_variable = { bri_project_type = 4 } CHI_bri_can_host_telecom = yes } random_owned_controlled_state = { limit = { free_building_slots = { building = internet_station size > 0 include_locked = no } } add_dynamic_modifier = { modifier = CHI_bri_state_telecom } add_building_construction = { type = internet_station level = 1 instant_build = yes } } set_temp_variable = { bri_project_granted = 1 } CHI = { add_to_variable = { CHI_bri_telecom_built = 1 } } } else_if = { limit = { check_variable = { bri_project_type = 5 } CHI_bri_can_host_sez = yes } random_owned_controlled_state = { limit = { free_building_slots = { building = industrial_complex size > 0 include_locked = no } OR = { is_coastal = yes infrastructure > 3 } } add_dynamic_modifier = { modifier = CHI_bri_state_sez } add_building_construction = { type = industrial_complex level = 1 instant_build = yes } } set_temp_variable = { bri_project_granted = 1 } CHI = { add_to_variable = { CHI_bri_industrial_zones = 1 } } } else_if = { limit = { check_variable = { bri_project_type = 6 } CHI_bri_can_host_mine = yes } random_owned_controlled_state = { limit = { OR = { has_resources_amount = { resource = steel amount > 2 } has_resources_amount = { resource = chromium amount > 2 } has_resources_amount = { resource = aluminium amount > 2 } has_resources_amount = { resource = tungsten amount > 2 } } } add_dynamic_modifier = { modifier = CHI_bri_state_mine } } set_temp_variable = { bri_project_granted = 1 } CHI = { add_to_variable = { CHI_bri_mines_secured = 1 } } } else_if = { limit = { check_variable = { bri_project_type = 7 } CHI_bri_can_host_energy = yes } random_owned_controlled_state = { limit = { industrial_complex > 0 free_building_slots = { building = renewable_energy_infra size > 0 include_locked = no } } add_dynamic_modifier = { modifier = CHI_bri_state_energy } add_building_construction = { type = renewable_energy_infra level = 1 instant_build = yes } } set_temp_variable = { bri_project_granted = 1 } CHI = { add_to_variable = { CHI_bri_powerplants_built = 1 } } } else_if = { limit = { check_variable = { bri_project_type = 8 } CHI_bri_can_host_prestige = yes } random_owned_controlled_state = { limit = { is_capital = yes free_building_slots = { building = offices size > 0 include_locked = no } } add_dynamic_modifier = { modifier = CHI_bri_state_prestige } add_building_construction = { type = offices level = 1 instant_build = yes } } set_temp_variable = { bri_project_granted = 1 } CHI = { add_to_variable = { CHI_bri_prestige_projects = 1 } } } } CHI_bri_credit_presence = { add_to_variable = { var = CHI_bri_global_presence value = bri_presence_amount } CHI_bri_recalc_presence = yes FROM = { add_to_variable = { var = bri_presence_given value = PREV.bri_presence_amount } } } CHI_bri_advance_named_project = { if = { limit = { check_variable = { bri_project_type = 1 } } add_to_variable = { bri_named_done_PORT = 1 } } else_if = { limit = { check_variable = { bri_project_type = 2 } } add_to_variable = { bri_named_done_RAIL = 1 } } else_if = { limit = { check_variable = { bri_project_type = 3 } } add_to_variable = { bri_named_done_PIPELINE = 1 } } else_if = { limit = { check_variable = { bri_project_type = 4 } } add_to_variable = { bri_named_done_TELECOM = 1 } } else_if = { limit = { check_variable = { bri_project_type = 5 } } add_to_variable = { bri_named_done_SEZ = 1 } } else_if = { limit = { check_variable = { bri_project_type = 6 } } add_to_variable = { bri_named_done_MINE = 1 } } else_if = { limit = { check_variable = { bri_project_type = 7 } } add_to_variable = { bri_named_done_ENERGY = 1 } } else_if = { limit = { check_variable = { bri_project_type = 8 } } add_to_variable = { bri_named_done_PRESTIGE = 1 } } } CHI_bri_apply_partner_rank = { if = { limit = { check_variable = { bri_partner_rank < 5 } } if = { limit = { check_variable = { bri_partner_rank = 0 } } add_ideas = CHI_bri_partner_1 set_country_flag = CHI_bri_partner } else_if = { limit = { check_variable = { bri_partner_rank = 1 } } swap_ideas = { remove_idea = CHI_bri_partner_1 add_idea = CHI_bri_partner_2 } } else_if = { limit = { check_variable = { bri_partner_rank = 2 } } swap_ideas = { remove_idea = CHI_bri_partner_2 add_idea = CHI_bri_partner_3 } } else_if = { limit = { check_variable = { bri_partner_rank = 3 } } swap_ideas = { remove_idea = CHI_bri_partner_3 add_idea = CHI_bri_partner_4 } } else = { swap_ideas = { remove_idea = CHI_bri_partner_4 add_idea = CHI_bri_partner_5 } } add_to_variable = { bri_partner_rank = 1 } add_to_variable = { bri_presence_given = 5 } CHI = { add_to_variable = { CHI_bri_global_presence = 5 } CHI_bri_recalc_presence = yes } } } CHI_bri_reclaim_structure = { set_variable = { bri_structure_reclaimed = 0 } random_owned_controlled_state = { limit = { OR = { has_dynamic_modifier = { modifier = CHI_bri_state_port } has_dynamic_modifier = { modifier = CHI_bri_state_rail } has_dynamic_modifier = { modifier = CHI_bri_state_pipeline } has_dynamic_modifier = { modifier = CHI_bri_state_telecom } has_dynamic_modifier = { modifier = CHI_bri_state_sez } has_dynamic_modifier = { modifier = CHI_bri_state_mine } has_dynamic_modifier = { modifier = CHI_bri_state_energy } has_dynamic_modifier = { modifier = CHI_bri_state_prestige } has_dynamic_modifier = { modifier = CHI_bri_state_industrial } has_dynamic_modifier = { modifier = CHI_bri_state_infrastructure } } } if = { limit = { has_dynamic_modifier = { modifier = CHI_bri_state_port } } remove_dynamic_modifier = { modifier = CHI_bri_state_port } } else_if = { limit = { has_dynamic_modifier = { modifier = CHI_bri_state_rail } } remove_dynamic_modifier = { modifier = CHI_bri_state_rail } } else_if = { limit = { has_dynamic_modifier = { modifier = CHI_bri_state_pipeline } } remove_dynamic_modifier = { modifier = CHI_bri_state_pipeline } } else_if = { limit = { has_dynamic_modifier = { modifier = CHI_bri_state_telecom } } remove_dynamic_modifier = { modifier = CHI_bri_state_telecom } } else_if = { limit = { has_dynamic_modifier = { modifier = CHI_bri_state_sez } } remove_dynamic_modifier = { modifier = CHI_bri_state_sez } } else_if = { limit = { has_dynamic_modifier = { modifier = CHI_bri_state_mine } } remove_dynamic_modifier = { modifier = CHI_bri_state_mine } } else_if = { limit = { has_dynamic_modifier = { modifier = CHI_bri_state_energy } } remove_dynamic_modifier = { modifier = CHI_bri_state_energy } } else_if = { limit = { has_dynamic_modifier = { modifier = CHI_bri_state_prestige } } remove_dynamic_modifier = { modifier = CHI_bri_state_prestige } } else_if = { limit = { has_dynamic_modifier = { modifier = CHI_bri_state_industrial } } remove_dynamic_modifier = { modifier = CHI_bri_state_industrial } } else = { remove_dynamic_modifier = { modifier = CHI_bri_state_infrastructure } } PREV = { set_variable = { bri_structure_reclaimed = 1 } } } } CHI_bri_drop_partner = { if = { limit = { check_variable = { bri_partner_rank > 0 } } if = { limit = { country_exists = CHI } CHI = { subtract_from_variable = { var = CHI_bri_global_presence value = PREV.bri_presence_given } clamp_variable = { var = CHI_bri_global_presence min = 0 } CHI_bri_recalc_presence = yes } } if = { limit = { has_idea = CHI_bri_partner_1 } remove_ideas = CHI_bri_partner_1 } else_if = { limit = { has_idea = CHI_bri_partner_2 } remove_ideas = CHI_bri_partner_2 } else_if = { limit = { has_idea = CHI_bri_partner_3 } remove_ideas = CHI_bri_partner_3 } else_if = { limit = { has_idea = CHI_bri_partner_4 } remove_ideas = CHI_bri_partner_4 } else_if = { limit = { has_idea = CHI_bri_partner_5 } remove_ideas = CHI_bri_partner_5 } set_variable = { bri_partner_rank = 0 } set_variable = { bri_projects_completed = 0 } set_variable = { bri_presence_given = 0 } clr_country_flag = CHI_bri_partner } if = { limit = { has_country_flag = bri_pipeline_busy } CHI_bri_cancel_project = yes } if = { limit = { has_war_with = CHI } set_variable = { bri_loan_payment = 0 } } } CHI_bri_shutdown_recipient = { CHI_bri_drop_partner = yes CHI_bri_clear_loan = yes if = { limit = { has_idea = CHI_bri_resource_concession_idea } remove_ideas = CHI_bri_resource_concession_idea } remove_mission = CHI_bri_project_mission set_variable = { bri_project_cost_committed = 0 } clr_country_flag = bri_pipeline_busy clr_country_flag = bri_pending_application clr_country_flag = bri_project_financed_cash clr_country_flag = bri_project_financed_loan } CHI_bri_monthly_tick = { set_temp_variable = { bri_contribution = { value = CHI_bri_monthly_income_base add = modifier@CHI_bri_monthly_income max = 0 } } if = { limit = { check_variable = { var = treasury value = bri_contribution compare = less_than } } set_temp_variable = { bri_contribution = { value = treasury max = 0 } } } set_variable = { CHI_bri_monthly_income_total = bri_contribution } set_temp_variable = { treasury_change = { value = bri_contribution multiply = -1 } } modify_treasury_effect = yes add_to_variable = { var = CHI_bri_treasury value = bri_contribution } CHI_bri_recalc_presence = yes CHI_bri_process_loans = yes CHI_bri_schedule_application = yes CHI_bri_mark_dirty = yes } CHI_bri_schedule_application = { if = { limit = { check_variable = { CHI_bri_committed_projects < CHI_bri_project_slots } check_variable = { var = CHI_bri_treasury value = CHI_bri_project_cost compare = greater_than_or_equals } } random_scope_in_array = { array = global.bri_eligible_countries limit = { is_ai = yes is_major = no NOT = { original_tag = IND } NOT = { has_country_flag = bri_ai_application_cooldown } CHI_bri_is_application_eligible = yes NOT = { gdp_per_capita_greater_than_10 = yes } NOT = { is_in_faction_with = USA } NOT = { has_opinion = { target = CHI value < 0 } } } clear_temp_array = bri_hostable_project_types if = { limit = { CHI_bri_can_host_port = yes } add_to_temp_array = { bri_hostable_project_types = 1 } } if = { limit = { OR = { is_neighbor_of = CHI has_country_flag = CHI_bri_partner } CHI_bri_can_host_rail = yes } add_to_temp_array = { bri_hostable_project_types = 2 } } if = { limit = { CHI_bri_can_host_pipeline = yes } add_to_temp_array = { bri_hostable_project_types = 3 } } if = { limit = { CHI_bri_can_host_telecom = yes } add_to_temp_array = { bri_hostable_project_types = 4 } } if = { limit = { CHI_bri_can_host_sez = yes } add_to_temp_array = { bri_hostable_project_types = 5 } } if = { limit = { CHI_bri_can_host_mine = yes } add_to_temp_array = { bri_hostable_project_types = 6 } } if = { limit = { CHI_bri_can_host_energy = yes } add_to_temp_array = { bri_hostable_project_types = 7 } } if = { limit = { CHI_bri_can_host_prestige = yes } add_to_temp_array = { bri_hostable_project_types = 8 } } if = { limit = { check_variable = { bri_hostable_project_types^num > 0 } } set_temp_variable = { bri_project_pick_max = { value = bri_hostable_project_types^num subtract = 1 } } set_temp_variable_to_random = { var = bri_project_pick min = 0 max = bri_project_pick_max integer = yes } set_variable = { bri_project_type = bri_hostable_project_types^bri_project_pick } set_country_flag = { flag = bri_ai_application_cooldown days = 540 value = 1 } CHI_bri_request_project = yes } } } } # Applies the demographic dividend and population penalty for the current one-child # policy stage (CHI_demographic_policy_stage 1-4). monthly_population is exclusive to # this system; the other three factors are shared with focuses, so the previously # applied stage is reversed before the current one is added. CHI_apply_demographic_policy = { if = { limit = { check_variable = { CHI_demographic_stage_applied = 1 } } add_to_variable = { CHI_economy_monthly_population = 0.90 } subtract_from_variable = { CHI_economy_productivity_growth_modifier = 0.08 } add_to_variable = { CHI_economy_consumer_goods_factor = 0.10 } subtract_from_variable = { CHI_economy_total_workforce_modifier = 0.12 } } else_if = { limit = { check_variable = { CHI_demographic_stage_applied = 2 } } add_to_variable = { CHI_economy_monthly_population = 0.45 } subtract_from_variable = { CHI_economy_productivity_growth_modifier = 0.04 } add_to_variable = { CHI_economy_consumer_goods_factor = 0.05 } subtract_from_variable = { CHI_economy_total_workforce_modifier = 0.06 } } else_if = { limit = { check_variable = { CHI_demographic_stage_applied = 3 } } add_to_variable = { CHI_economy_monthly_population = 0.15 } subtract_from_variable = { CHI_economy_productivity_growth_modifier = 0.015 } add_to_variable = { CHI_economy_consumer_goods_factor = 0.02 } subtract_from_variable = { CHI_economy_total_workforce_modifier = 0.02 } } custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CHI_economy_modifier } if = { limit = { check_variable = { CHI_demographic_policy_stage = 1 } } subtract_from_variable = { CHI_economy_monthly_population = 0.90 tooltip = monthly_population_tt } add_to_variable = { CHI_economy_productivity_growth_modifier = 0.08 tooltip = productivity_growth_modifier_tt } subtract_from_variable = { CHI_economy_consumer_goods_factor = 0.10 tooltip = consumer_goods_factor_tt } add_to_variable = { CHI_economy_total_workforce_modifier = 0.12 tooltip = total_workforce_modifier_tt } } else_if = { limit = { check_variable = { CHI_demographic_policy_stage = 2 } } subtract_from_variable = { CHI_economy_monthly_population = 0.45 tooltip = monthly_population_tt } add_to_variable = { CHI_economy_productivity_growth_modifier = 0.04 tooltip = productivity_growth_modifier_tt } subtract_from_variable = { CHI_economy_consumer_goods_factor = 0.05 tooltip = consumer_goods_factor_tt } add_to_variable = { CHI_economy_total_workforce_modifier = 0.06 tooltip = total_workforce_modifier_tt } } else_if = { limit = { check_variable = { CHI_demographic_policy_stage = 3 } } subtract_from_variable = { CHI_economy_monthly_population = 0.15 tooltip = monthly_population_tt } add_to_variable = { CHI_economy_productivity_growth_modifier = 0.015 tooltip = productivity_growth_modifier_tt } subtract_from_variable = { CHI_economy_consumer_goods_factor = 0.02 tooltip = consumer_goods_factor_tt } add_to_variable = { CHI_economy_total_workforce_modifier = 0.02 tooltip = total_workforce_modifier_tt } } # stage 4 (abolished): penalty and dividend both fully reversed above, nothing applied set_variable = { CHI_demographic_stage_applied = CHI_demographic_policy_stage } } ### Russian arms dependency: re-evaluate tier from CHI_military_self_sufficiency. Idempotent, downgrade-only. ### CHI_evaluate_arms_dependency = { clamp_variable = { var = CHI_military_self_sufficiency min = 0 max = 100 } if = { limit = { check_variable = { CHI_military_self_sufficiency > 99 } } if = { limit = { has_idea = CHI_russian_arms_dependency } remove_ideas = CHI_russian_arms_dependency } if = { limit = { has_idea = CHI_russian_arms_dependency_2 } remove_ideas = CHI_russian_arms_dependency_2 } if = { limit = { has_idea = CHI_russian_arms_dependency_3 } remove_ideas = CHI_russian_arms_dependency_3 } if = { limit = { has_idea = CHI_russian_arms_dependency_4 } remove_ideas = CHI_russian_arms_dependency_4 } } else_if = { limit = { check_variable = { CHI_military_self_sufficiency > 74 } } if = { limit = { has_idea = CHI_russian_arms_dependency } swap_ideas = { remove_idea = CHI_russian_arms_dependency add_idea = CHI_russian_arms_dependency_4 } } else_if = { limit = { has_idea = CHI_russian_arms_dependency_2 } swap_ideas = { remove_idea = CHI_russian_arms_dependency_2 add_idea = CHI_russian_arms_dependency_4 } } else_if = { limit = { has_idea = CHI_russian_arms_dependency_3 } swap_ideas = { remove_idea = CHI_russian_arms_dependency_3 add_idea = CHI_russian_arms_dependency_4 } } else_if = { limit = { NOT = { has_idea = CHI_russian_arms_dependency_4 } } add_ideas = CHI_russian_arms_dependency_4 } } else_if = { limit = { check_variable = { CHI_military_self_sufficiency > 49 } } if = { limit = { has_idea = CHI_russian_arms_dependency } swap_ideas = { remove_idea = CHI_russian_arms_dependency add_idea = CHI_russian_arms_dependency_3 } } else_if = { limit = { has_idea = CHI_russian_arms_dependency_2 } swap_ideas = { remove_idea = CHI_russian_arms_dependency_2 add_idea = CHI_russian_arms_dependency_3 } } else_if = { limit = { NOT = { has_idea = CHI_russian_arms_dependency_3 } } add_ideas = CHI_russian_arms_dependency_3 } } else_if = { limit = { check_variable = { CHI_military_self_sufficiency > 24 } } if = { limit = { has_idea = CHI_russian_arms_dependency } swap_ideas = { remove_idea = CHI_russian_arms_dependency add_idea = CHI_russian_arms_dependency_2 } } else_if = { limit = { NOT = { has_idea = CHI_russian_arms_dependency_2 } } add_ideas = CHI_russian_arms_dependency_2 } } } CHI_add_arms_self_sufficiency = { add_to_variable = { CHI_military_self_sufficiency = arms_ss_gain tooltip = CHI_military_self_sufficiency_tt } CHI_evaluate_arms_dependency = yes } CHI_military_corruption_monthly_tick = { if = { limit = { has_completed_focus = CHI_warlord_temptation } random = { chance = 3 country_event = CHI_military_event.10 } } } CHI_modify_uighur_threat = { add_to_variable = { uighur_threat = modify_uighur_threat tooltip = uighur_threat_tt } clamp_variable = { var = uighur_threat min = 0 max = 100 } } CHI_uighur_monthly_tick = { if = { limit = { NOT = { 592 = { is_controlled_by = ETK } } } if = { limit = { 592 = { resistance > 60 } } set_temp_variable = { modify_uighur_threat = 2 } CHI_modify_uighur_threat = yes } else_if = { limit = { 592 = { resistance > 39 } } set_temp_variable = { modify_uighur_threat = 1 } CHI_modify_uighur_threat = yes } else_if = { limit = { 592 = { NOT = { resistance > 14 } } } set_temp_variable = { modify_uighur_threat = -1 } CHI_modify_uighur_threat = yes } if = { limit = { check_variable = { var = ETK_sinicization_var value = 60 compare = greater_than } } set_temp_variable = { modify_uighur_threat = 1 } CHI_modify_uighur_threat = yes } else_if = { limit = { check_variable = { var = ETK_sinicization_var value = 20 compare = less_than } } set_temp_variable = { modify_uighur_threat = -1 } CHI_modify_uighur_threat = yes } if = { limit = { NOT = { has_country_flag = CHI_uighur_event_cd } } if = { limit = { check_variable = { var = uighur_threat value = 30 compare = less_than } } random = { chance = 8 country_event = chi_uighur.5 set_country_flag = { flag = CHI_uighur_event_cd value = 1 days = 60 } } } else_if = { limit = { check_variable = { var = uighur_threat value = 60 compare = less_than } } random_list = { 60 = { } 30 = { country_event = chi_uighur.1 set_country_flag = { flag = CHI_uighur_event_cd value = 1 days = 60 } } 10 = { country_event = chi_uighur.2 set_country_flag = { flag = CHI_uighur_event_cd value = 1 days = 60 } } } } else_if = { limit = { check_variable = { var = uighur_threat value = 85 compare = less_than } } random_list = { 35 = { } 25 = { country_event = chi_uighur.1 set_country_flag = { flag = CHI_uighur_event_cd value = 1 days = 60 } } 30 = { country_event = chi_uighur.2 set_country_flag = { flag = CHI_uighur_event_cd value = 1 days = 60 } } 10 = { country_event = chi_uighur.3 set_country_flag = { flag = CHI_uighur_event_cd value = 1 days = 60 } } } } else = { random_list = { 15 = { } 15 = { country_event = chi_uighur.1 set_country_flag = { flag = CHI_uighur_event_cd value = 1 days = 60 } } 30 = { country_event = chi_uighur.2 set_country_flag = { flag = CHI_uighur_event_cd value = 1 days = 60 } } 30 = { country_event = chi_uighur.3 set_country_flag = { flag = CHI_uighur_event_cd value = 1 days = 60 } } 10 = { country_event = china_sar.034 set_country_flag = { flag = CHI_uighur_event_cd value = 1 days = 60 } } } } } } } CHI_add_water_project_progress = { add_to_variable = { var = CHI_water_projects_completed value = 1 } clamp_variable = { var = CHI_water_projects_completed min = 0 max = 20 } custom_effect_tooltip = CHI_water_project_progress_tt CHI_evaluate_water_shortage = yes } CHI_evaluate_water_shortage = { if = { limit = { has_idea = CHI_water_shortage check_variable = { CHI_water_projects_completed > 3 } } if = { limit = { check_variable = { CHI_water_projects_completed > 16 } } remove_ideas = CHI_water_shortage } else_if = { limit = { check_variable = { CHI_water_projects_completed > 12 } } swap_ideas = { remove_idea = CHI_water_shortage add_idea = CHI_water_shortage_4 } } else_if = { limit = { check_variable = { CHI_water_projects_completed > 8 } } swap_ideas = { remove_idea = CHI_water_shortage add_idea = CHI_water_shortage_3 } } else = { swap_ideas = { remove_idea = CHI_water_shortage add_idea = CHI_water_shortage_2 } } } else_if = { limit = { has_idea = CHI_water_shortage_2 check_variable = { CHI_water_projects_completed > 8 } } if = { limit = { check_variable = { CHI_water_projects_completed > 16 } } remove_ideas = CHI_water_shortage_2 } else_if = { limit = { check_variable = { CHI_water_projects_completed > 12 } } swap_ideas = { remove_idea = CHI_water_shortage_2 add_idea = CHI_water_shortage_4 } } else = { swap_ideas = { remove_idea = CHI_water_shortage_2 add_idea = CHI_water_shortage_3 } } } else_if = { limit = { has_idea = CHI_water_shortage_3 check_variable = { CHI_water_projects_completed > 12 } } if = { limit = { check_variable = { CHI_water_projects_completed > 16 } } remove_ideas = CHI_water_shortage_3 } else = { swap_ideas = { remove_idea = CHI_water_shortage_3 add_idea = CHI_water_shortage_4 } } } else_if = { limit = { has_idea = CHI_water_shortage_4 check_variable = { CHI_water_projects_completed > 16 } } remove_ideas = CHI_water_shortage_4 } } CHI_snwt_capstone_check = { if = { limit = { has_country_flag = CHI_snwt_eastern_done has_country_flag = CHI_snwt_central_done has_country_flag = CHI_snwt_western_done NOT = { has_country_flag = CHI_snwt_complete } } set_country_flag = CHI_snwt_complete custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CHI_economy_modifier } add_to_variable = { CHI_economy_pop_energy_use_multiplier = -0.04 tooltip = pop_energy_use_multiplier_tt } add_to_variable = { CHI_economy_agricolture_productivity_modifier = 0.04 tooltip = agricolture_productivity_modifier_tt } CHI_add_water_project_progress = yes } } CHI_unlock_random_asteroid_bonus = { random_list = { 10 = { if = { limit = { NOT = { has_country_flag = CHI_asteroid_bonus_1 } } set_country_flag = CHI_asteroid_bonus_1 add_to_variable = { CHI_asteroid_bonus_count = 1 } custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CHI_economy_modifier } add_to_variable = { CHI_economy_production_speed_facility_factor = 0.05 tooltip = production_speed_facility_factor_tt } } else = { set_temp_variable = { treasury_change = 25 } modify_treasury_effect = yes } } 10 = { if = { limit = { NOT = { has_country_flag = CHI_asteroid_bonus_2 } } set_country_flag = CHI_asteroid_bonus_2 add_to_variable = { CHI_asteroid_bonus_count = 1 } custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CHI_economy_modifier } add_to_variable = { CHI_economy_local_resources_steel_factor = 0.05 tooltip = local_resources_steel_factor_tt } } else = { set_temp_variable = { treasury_change = 25 } modify_treasury_effect = yes } } 10 = { if = { limit = { NOT = { has_country_flag = CHI_asteroid_bonus_3 } } set_country_flag = CHI_asteroid_bonus_3 add_to_variable = { CHI_asteroid_bonus_count = 1 } custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CHI_defense_industry } add_to_variable = { CHI_di_line_change_production_efficiency_factor = 0.05 tooltip = line_change_production_efficiency_factor_tt } } else = { set_temp_variable = { treasury_change = 25 } modify_treasury_effect = yes } } 10 = { if = { limit = { NOT = { has_country_flag = CHI_asteroid_bonus_4 } } set_country_flag = CHI_asteroid_bonus_4 add_to_variable = { CHI_asteroid_bonus_count = 1 } custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CHI_economy_modifier } add_to_variable = { CHI_economy_research_speed_factor = 0.03 tooltip = research_speed_factor_tt } } else = { set_temp_variable = { treasury_change = 25 } modify_treasury_effect = yes } } 10 = { if = { limit = { NOT = { has_country_flag = CHI_asteroid_bonus_5 } } set_country_flag = CHI_asteroid_bonus_5 add_to_variable = { CHI_asteroid_bonus_count = 1 } custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CHI_economy_modifier } add_to_variable = { CHI_economy_production_factory_efficiency_gain_factor = 0.05 tooltip = production_factory_efficiency_gain_factor_tt } } else = { set_temp_variable = { treasury_change = 25 } modify_treasury_effect = yes } } 10 = { if = { limit = { NOT = { has_country_flag = CHI_asteroid_bonus_6 } } set_country_flag = CHI_asteroid_bonus_6 add_to_variable = { CHI_asteroid_bonus_count = 1 } custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CHI_economy_modifier } add_to_variable = { CHI_economy_fuel_gain_factor = 0.05 tooltip = fuel_gain_factor_tt } } else = { set_temp_variable = { treasury_change = 25 } modify_treasury_effect = yes } } 10 = { if = { limit = { NOT = { has_country_flag = CHI_asteroid_bonus_7 } } set_country_flag = CHI_asteroid_bonus_7 add_to_variable = { CHI_asteroid_bonus_count = 1 } custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CHI_economy_modifier } add_to_variable = { CHI_economy_return_on_investment_modifier = 0.03 tooltip = return_on_investment_modifier_tt } } else = { set_temp_variable = { treasury_change = 25 } modify_treasury_effect = yes } } 10 = { if = { limit = { NOT = { has_country_flag = CHI_asteroid_bonus_8 } } set_country_flag = CHI_asteroid_bonus_8 add_to_variable = { CHI_asteroid_bonus_count = 1 } custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CHI_economy_modifier } add_to_variable = { CHI_economy_production_speed_buildings_factor = 0.03 tooltip = production_speed_buildings_factor_tt } } else = { set_temp_variable = { treasury_change = 25 } modify_treasury_effect = yes } } 10 = { if = { limit = { NOT = { has_country_flag = CHI_asteroid_bonus_9 } } set_country_flag = CHI_asteroid_bonus_9 add_to_variable = { CHI_asteroid_bonus_count = 1 } custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CHI_economy_modifier } add_to_variable = { CHI_economy_production_factory_max_efficiency_factor = 0.03 tooltip = production_factory_max_efficiency_factor_tt } } else = { set_temp_variable = { treasury_change = 25 } modify_treasury_effect = yes } } 10 = { if = { limit = { NOT = { has_country_flag = CHI_asteroid_bonus_10 } } set_country_flag = CHI_asteroid_bonus_10 add_to_variable = { CHI_asteroid_bonus_count = 1 } custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CHI_economy_modifier } add_to_variable = { CHI_economy_local_resources_chromium_factor = 0.05 tooltip = local_resources_chromium_factor_tt } } else = { set_temp_variable = { treasury_change = 25 } modify_treasury_effect = yes } } } } CHI_corruption_treasury_penalty = { if = { limit = { OR = { has_idea = corruption_level_08 has_idea = corruption_level_09 has_idea = corruption_level_10 } } multiply_temp_variable = { treasury_change = 2.0 } } else_if = { limit = { OR = { has_idea = corruption_level_07 has_idea = corruption_level_06 has_idea = corruption_level_05 } } multiply_temp_variable = { treasury_change = 1.5 } } } # Re-scans the sitting US president and applies their one-time Taiwan-support delta. CHI_update_us_president_support = { set_temp_variable = { CHI_us_president_index = 0 } set_temp_variable = { CHI_us_president_delta = 0 } if = { limit = { USA = { has_country_leader = { name = "John McCain" } } } set_temp_variable = { CHI_us_president_index = 1 } set_temp_variable = { CHI_us_president_delta = 10 } } else_if = { limit = { USA = { has_country_leader = { name = "Joe Biden" } } } set_temp_variable = { CHI_us_president_index = 2 } set_temp_variable = { CHI_us_president_delta = 8 } } else_if = { limit = { USA = { has_country_leader = { name = "Hillary Clinton" } } } set_temp_variable = { CHI_us_president_index = 3 } set_temp_variable = { CHI_us_president_delta = 6 } } else_if = { limit = { USA = { has_country_leader = { name = "Kamala Harris" } } } set_temp_variable = { CHI_us_president_index = 4 } set_temp_variable = { CHI_us_president_delta = 6 } } else_if = { limit = { USA = { has_country_leader = { name = "George W. Bush" } } } set_temp_variable = { CHI_us_president_index = 5 } set_temp_variable = { CHI_us_president_delta = 5 } } else_if = { limit = { USA = { has_country_leader = { name = "Barack Obama" } } } set_temp_variable = { CHI_us_president_index = 6 } set_temp_variable = { CHI_us_president_delta = 5 } } else_if = { limit = { USA = { has_country_leader = { name = "Mitt Romney" } } } set_temp_variable = { CHI_us_president_index = 7 } set_temp_variable = { CHI_us_president_delta = 4 } } else_if = { limit = { USA = { has_country_leader = { name = "Al Gore" } } } set_temp_variable = { CHI_us_president_index = 8 } set_temp_variable = { CHI_us_president_delta = 3 } } else_if = { limit = { USA = { has_country_leader = { name = "John Kerry" } } } set_temp_variable = { CHI_us_president_index = 9 } set_temp_variable = { CHI_us_president_delta = -2 } } else_if = { limit = { USA = { has_country_leader = { name = "Donald Trump" } } } set_temp_variable = { CHI_us_president_index = 10 } set_temp_variable = { CHI_us_president_delta = -10 } } if = { limit = { check_variable = { CHI_us_president_index > 0 } NOT = { check_variable = { CHI_us_president_applied = CHI_us_president_index } } } clr_country_flag = CHI_trump_is_president clr_country_flag = CHI_harris_us_support_floor add_to_variable = { var = CHI_taiwan_us_support value = CHI_us_president_delta tooltip = CHI_taiwan_us_support_tt } clamp_variable = { var = CHI_taiwan_us_support min = 0 max = 100 } if = { limit = { check_variable = { CHI_us_president_index = 4 } } set_country_flag = CHI_harris_us_support_floor } if = { limit = { check_variable = { CHI_us_president_index = 10 } } set_country_flag = CHI_trump_is_president } set_variable = { CHI_us_president_applied = CHI_us_president_index } country_event = { id = china_sar.026 days = 3 } } } # Easter-egg C&C general victory shout. Runs with the leader hook's ROOT/FROM scopes intact. CHI_general_quote_shout = { if = { limit = { ROOT = { has_trait = CHI_special_weapons_general } } FROM = { scoped_sound_effect = "CHI_general_leang_shout" clr_country_flag = CHI_cnc_general_quote_used set_country_flag = CHI_cnc_general_quote_used } } else_if = { limit = { ROOT = { has_trait = CHI_infantry_general } } FROM = { scoped_sound_effect = "CHI_general_fai_shout" clr_country_flag = CHI_cnc_general_quote_used set_country_flag = CHI_cnc_general_quote_used } } else_if = { limit = { ROOT = { has_trait = CHI_tank_general } } FROM = { scoped_sound_effect = "CHI_general_kwai_shout" clr_country_flag = CHI_cnc_general_quote_used set_country_flag = CHI_cnc_general_quote_used } } else_if = { limit = { ROOT = { has_trait = CHI_nuke_general } } FROM = { scoped_sound_effect = "CHI_general_tao_shout" clr_country_flag = CHI_cnc_general_quote_used set_country_flag = CHI_cnc_general_quote_used } } } CHI_bri_find_debtor_index = { set_temp_variable = { bri_found_index = -1 } for_each_loop = { array = CHI_bri_debtors if = { limit = { check_variable = { v = bri_debtor_id } } set_temp_variable = { bri_found_index = i } } } } CHI_bri_issue_loan = { add_to_variable = { var = bri_debt_owed_to_china value = bri_project_cost_committed } CHI = { set_temp_variable = { bri_debtor_id = PREV.id } set_temp_variable = { bri_loan_amount = PREV.bri_project_cost_committed } CHI_bri_find_debtor_index = yes if = { limit = { check_variable = { bri_found_index > -1 } } add_to_variable = { var = CHI_bri_loan_principal^bri_found_index value = bri_loan_amount } set_temp_variable = { bri_existing_rate = CHI_bri_loan_rate^bri_found_index } PREV = { set_variable = { bri_loan_rate = PREV.bri_existing_rate } } } else = { add_to_array = { CHI_bri_debtors = bri_debtor_id } set_temp_variable = { bri_new_index = { value = CHI_bri_debtors^num subtract = 1 } } set_variable = { CHI_bri_loan_principal^bri_new_index = bri_loan_amount } set_variable = { CHI_bri_loan_rate^bri_new_index = 4 } PREV = { set_variable = { bri_loan_rate = 4 } } } CHI_bri_mark_dirty = yes } CHI_bri_recalculate_loan_payment = yes } CHI_bri_recalculate_loan_payment = { set_variable = { bri_loan_payment = 0 } if = { limit = { country_exists = CHI check_variable = { bri_debt_owed_to_china > 0 } NOT = { has_country_flag = bri_defaulted } NOT = { has_country_flag = bri_loan_grace } NOT = { has_war_with = CHI } } set_variable = { bri_loan_payment = { value = bri_debt_owed_to_china multiply = 0.00019 multiply = bri_loan_rate } } } } CHI_bri_process_loans = { set_variable = { CHI_bri_loan_income = 0 } set_temp_variable = { bri_cleanup_needed = 0 } if = { limit = { check_variable = { CHI_bri_debtors^num > 0 } } for_each_loop = { array = CHI_bri_debtors value = v index = i set_temp_variable = { bri_interest = { value = CHI_bri_loan_principal^i multiply = 0.00019 multiply = CHI_bri_loan_rate^i } } set_temp_variable = { bri_amortisation = { value = CHI_bri_loan_principal^i multiply = 0.05 } } var:CHI_bri_debtors^i = { set_variable = { bri_loan_payment = 0 } if = { limit = { NOT = { has_country_flag = bri_defaulted } NOT = { has_country_flag = bri_loan_grace } NOT = { has_war_with = CHI } } if = { limit = { check_variable = { var = treasury value = ROOT.bri_amortisation compare = greater_than_or_equals } NOT = { has_active_mission = bankruptcy_incoming_collapse } } set_variable = { bri_loan_payment = ROOT.bri_interest } set_temp_variable = { treasury_change = { value = ROOT.bri_amortisation multiply = -1 } } modify_treasury_effect = yes subtract_from_variable = { var = bri_debt_owed_to_china value = ROOT.bri_amortisation } clamp_variable = { var = bri_debt_owed_to_china min = 0 } ROOT = { subtract_from_variable = { var = CHI_bri_loan_principal^i value = bri_amortisation } add_to_variable = { var = CHI_bri_loan_income value = bri_interest } set_temp_variable = { treasury_change = bri_amortisation } modify_treasury_effect = yes } } else = { set_country_flag = bri_defaulted if = { limit = { NOT = { has_country_flag = bri_default_recorded } } set_country_flag = bri_default_recorded country_event = { id = chi_bri.16 days = 1 } if = { limit = { original_tag = SRI } country_event = { id = chi_bri.20 days = 30 } } else_if = { limit = { original_tag = PAK } country_event = { id = chi_bri.21 days = 30 } } else_if = { limit = { original_tag = DJI } country_event = { id = chi_bri.22 days = 30 } } ROOT = { add_to_variable = { CHI_bri_defaulted_projects = 1 } } } } } } if = { limit = { check_variable = { CHI_bri_loan_principal^i < 0.01 } } set_temp_variable = { bri_cleanup_needed = 1 } } } if = { limit = { check_variable = { bri_cleanup_needed = 1 } } CHI_bri_cleanup_loans = yes } } } CHI_bri_cleanup_loans = { set_temp_variable = { bri_cleanup_index = { value = CHI_bri_debtors^num subtract = 1 } } while_loop_effect = { limit = { check_variable = { bri_cleanup_index > -1 } } if = { limit = { check_variable = { CHI_bri_loan_principal^bri_cleanup_index < 0.01 } } var:CHI_bri_debtors^bri_cleanup_index = { set_variable = { bri_debt_owed_to_china = 0 } set_variable = { bri_loan_payment = 0 } set_variable = { bri_loan_rate = 0 } clr_country_flag = bri_defaulted clr_country_flag = bri_default_recorded clr_country_flag = bri_loan_grace } remove_from_array = { array = CHI_bri_debtors index = bri_cleanup_index } remove_from_array = { array = CHI_bri_loan_principal index = bri_cleanup_index } remove_from_array = { array = CHI_bri_loan_rate index = bri_cleanup_index } } subtract_from_temp_variable = { bri_cleanup_index = 1 } } if = { limit = { check_variable = { CHI_bri_debtors^num = 0 } } set_variable = { CHI_bri_loan_income = 0 } } } CHI_bri_reduce_loan = { if = { limit = { country_exists = CHI } CHI = { set_temp_variable = { bri_debtor_id = PREV.id } CHI_bri_find_debtor_index = yes if = { limit = { check_variable = { bri_found_index > -1 } } subtract_from_variable = { var = CHI_bri_loan_principal^bri_found_index value = PREV.bri_debt_reduction } clamp_variable = { var = CHI_bri_loan_principal^bri_found_index min = 0 } set_temp_variable = { bri_remaining_principal = CHI_bri_loan_principal^bri_found_index } PREV = { set_variable = { bri_debt_owed_to_china = PREV.bri_remaining_principal } } if = { limit = { check_variable = { bri_remaining_principal < 0.01 } } CHI_bri_cleanup_loans = yes } } } } CHI_bri_recalculate_loan_payment = yes } CHI_bri_restructure_loan = { CHI_bri_grant_loan_grace = yes if = { limit = { country_exists = CHI } CHI = { set_temp_variable = { bri_debtor_id = PREV.id } CHI_bri_find_debtor_index = yes if = { limit = { check_variable = { bri_found_index > -1 } } set_variable = { CHI_bri_loan_rate^bri_found_index = 2 } PREV = { set_variable = { bri_loan_rate = 2 } } } } } } CHI_bri_grant_loan_grace = { clr_country_flag = bri_defaulted set_country_flag = { flag = bri_loan_grace days = 365 value = 1 } set_variable = { bri_loan_payment = 0 } if = { limit = { country_exists = CHI } CHI = { CHI_bri_mark_dirty = yes } } } CHI_bri_clear_loan = { set_variable = { bri_debt_owed_to_china = 0 } set_variable = { bri_loan_payment = 0 } set_variable = { bri_loan_rate = 0 } clr_country_flag = bri_defaulted clr_country_flag = bri_default_recorded clr_country_flag = bri_loan_grace if = { limit = { country_exists = CHI } CHI = { set_temp_variable = { bri_debtor_id = PREV.id } CHI_bri_find_debtor_index = yes if = { limit = { check_variable = { bri_found_index > -1 } } remove_from_array = { array = CHI_bri_debtors index = bri_found_index } remove_from_array = { array = CHI_bri_loan_principal index = bri_found_index } remove_from_array = { array = CHI_bri_loan_rate index = bri_found_index } if = { limit = { check_variable = { CHI_bri_debtors^num = 0 } } set_variable = { CHI_bri_loan_income = 0 } } CHI_bri_mark_dirty = yes } } } } CHI_TAI_recompute_isolation = { # iso_index: +15 = fully isolated (0 recognisers), -15 = broadly recognised (30+) set_temp_variable = { CHI_TAI_iso_index = 15 } subtract_from_temp_variable = { CHI_TAI_iso_index = Granted_Recognition } clamp_temp_variable = { var = CHI_TAI_iso_index min = -15 max = 15 } set_variable = { CHI_TAI_isolation_trade = CHI_TAI_iso_index } multiply_variable = { CHI_TAI_isolation_trade = -0.02 } set_variable = { CHI_TAI_isolation_influence = CHI_TAI_iso_index } multiply_variable = { CHI_TAI_isolation_influence = -0.015 } set_variable = { CHI_TAI_isolation_relations = CHI_TAI_iso_index } multiply_variable = { CHI_TAI_isolation_relations = 0.03 } } CHI_TAI_apply_isolation = { if = { limit = { NOT = { has_dynamic_modifier = { modifier = CHI_TAI_intl_isolation_modifier } } } hidden_effect = { add_dynamic_modifier = { modifier = CHI_TAI_intl_isolation_modifier } } } hidden_effect = { CHI_TAI_recompute_isolation = yes } custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CHI_TAI_intl_isolation_modifier } } # Huawei corporate history. Five milestones set the route; the closing # milestone resolves it into one of four outcomes. CHI_huawei_apply_sovereign_full_stack = { if = { limit = { CHI_huawei_outcome_settled = no } add_ideas = CHI_huawei_sovereign_full_stack } } CHI_huawei_apply_resilient_fortress = { if = { limit = { CHI_huawei_outcome_settled = no } add_timed_idea = { idea = CHI_huawei_resilient_technology_fortress days = 365 } } } CHI_huawei_apply_global_challenger = { if = { limit = { CHI_huawei_outcome_settled = no } add_timed_idea = { idea = CHI_huawei_global_telecom_challenger days = 365 } } } CHI_huawei_apply_consumer_ecosystem = { if = { limit = { CHI_huawei_outcome_settled = no } add_timed_idea = { idea = CHI_huawei_consumer_ecosystem_power days = 365 } } } # One entry point per milestone, called from the yearly pulse. Full presents the # choice; Outcomes Only applies the historical persistent route silently without # the live event's one-time costs or rewards. CHI_huawei_milestone_2001 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.300 days = 90 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_huawei_international_expansion } } CHI_huawei_milestone_2009 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.301 days = 243 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_huawei_european_carrier_wins } } CHI_huawei_milestone_2013 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.302 days = 304 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_huawei_5g_moonshot } } CHI_huawei_milestone_2019 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.303 days = 135 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_huawei_entity_list_defiance } } CHI_huawei_milestone_2020 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.304 days = 258 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_huawei_domestic_fab_push } } CHI_huawei_milestone_2023 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.305 days = 240 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } CHI_huawei_apply_sovereign_full_stack = yes } } # Lenovo corporate history. Five milestones set the route; the closing milestone # resolves it into one of four futures for Chinese computing manufacture. CHI_lenovo_apply_enterprise_server_platform = { if = { limit = { CHI_lenovo_outcome_settled = no } add_timed_idea = { idea = CHI_lenovo_enterprise_server_platform days = 365 } } } CHI_lenovo_apply_global_pc_platform = { if = { limit = { CHI_lenovo_outcome_settled = no } add_timed_idea = { idea = CHI_lenovo_global_pc_platform days = 365 } } } CHI_lenovo_apply_strategic_bridge = { if = { limit = { CHI_lenovo_outcome_settled = no } add_timed_idea = { idea = CHI_lenovo_strategic_bridge days = 365 } } } CHI_lenovo_apply_domestic_champion = { if = { limit = { CHI_lenovo_outcome_settled = no } add_ideas = CHI_lenovo_domestic_champion } } # One entry point per milestone, called from the yearly pulse. Full presents the # choice; Outcomes Only applies the historical persistent route silently without # the live event's one-time costs or rewards. CHI_lenovo_milestone_2004 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.310 days = 342 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_lenovo_ibm_pc_acquired } } CHI_lenovo_milestone_2005 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.311 days = 120 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_lenovo_security_undertakings } } CHI_lenovo_milestone_2008 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.312 days = 179 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_lenovo_own_brand } } CHI_lenovo_milestone_2011 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.313 days = 26 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_lenovo_joint_ventures } } CHI_lenovo_milestone_2014 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.314 days = 189 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_lenovo_server_acquired } } CHI_lenovo_milestone_2026 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.315 days = 200 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } CHI_lenovo_apply_enterprise_server_platform = yes } } # Tencent corporate history. Five milestones set the route; the closing # milestone resolves it into one of four futures for the Chinese consumer internet. CHI_tencent_apply_global_platform = { if = { limit = { CHI_tencent_outcome_settled = no } add_timed_idea = { idea = CHI_tencent_global_platform_conglomerate days = 365 } } } CHI_tencent_apply_domestic_superapp = { if = { limit = { CHI_tencent_outcome_settled = no } add_ideas = CHI_tencent_domestic_superapp } } CHI_tencent_apply_licensed_publisher = { if = { limit = { CHI_tencent_outcome_settled = no } add_timed_idea = { idea = CHI_tencent_licensed_games_publisher days = 365 } } } CHI_tencent_apply_independent_messaging = { if = { limit = { CHI_tencent_outcome_settled = no } add_timed_idea = { idea = CHI_tencent_independent_messaging days = 365 } } } # One entry point per milestone, called from the yearly pulse. Full presents the # choice; Outcomes Only applies the historical persistent route silently without # the live event's one-time costs or rewards. CHI_tencent_milestone_2001 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.320 days = 151 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_tencent_foreign_capital } } CHI_tencent_milestone_2004 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.321 days = 167 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_tencent_public_listing } } CHI_tencent_milestone_2011 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.322 days = 20 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_tencent_superapp } } CHI_tencent_milestone_2016 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.323 days = 172 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_tencent_global_games } } CHI_tencent_milestone_2018 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.324 days = 86 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_tencent_state_accommodation } } CHI_tencent_milestone_2026 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.325 days = 134 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } CHI_tencent_apply_global_platform = yes } } # Alibaba corporate history. Five milestones set the route; the closing # milestone resolves it into one of four futures for Chinese commerce. CHI_alibaba_apply_supervised_backbone = { if = { limit = { CHI_alibaba_outcome_settled = no } add_ideas = CHI_alibaba_supervised_commerce_backbone } } CHI_alibaba_apply_open_marketplace = { if = { limit = { CHI_alibaba_outcome_settled = no } add_timed_idea = { idea = CHI_alibaba_open_consumer_marketplace days = 365 } } } CHI_alibaba_apply_trading_house = { if = { limit = { CHI_alibaba_outcome_settled = no } add_timed_idea = { idea = CHI_alibaba_foreign_capitalised_trading_house days = 365 } } } CHI_alibaba_apply_export_broker = { if = { limit = { CHI_alibaba_outcome_settled = no } add_timed_idea = { idea = CHI_alibaba_wholesale_export_broker days = 365 } } } # One entry point per milestone, called from the yearly pulse. Full presents the # choice; Outcomes Only applies the historical persistent route silently without # the live event's one-time costs or rewards. CHI_alibaba_milestone_2000 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.330 days = 20 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_alibaba_foreign_venture_capital } } CHI_alibaba_milestone_2003 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.331 days = 129 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_alibaba_consumer_marketplace } } CHI_alibaba_milestone_2005 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.332 days = 222 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_alibaba_yahoo_stake } } CHI_alibaba_milestone_2011 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.333 days = 129 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_alibaba_payments_severed } } CHI_alibaba_milestone_2020 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.334 days = 307 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_alibaba_state_supervision } } CHI_alibaba_milestone_2026 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.335 days = 170 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } CHI_alibaba_apply_supervised_backbone = yes } } # ByteDance corporate history. Five milestones set the route; the closing # milestone resolves it into one of four futures for Chinese algorithmic media. CHI_bytedance_apply_sovereign_engine = { if = { limit = { CHI_bytedance_outcome_settled = no } add_ideas = CHI_bytedance_sovereign_recommendation_engine } } CHI_bytedance_apply_global_attention = { if = { limit = { CHI_bytedance_outcome_settled = no } add_timed_idea = { idea = CHI_bytedance_global_attention_platform days = 365 } } } CHI_bytedance_apply_licensed_utility = { if = { limit = { CHI_bytedance_outcome_settled = no } add_timed_idea = { idea = CHI_bytedance_licensed_information_utility days = 365 } } } CHI_bytedance_apply_editorial_group = { if = { limit = { CHI_bytedance_outcome_settled = no } add_timed_idea = { idea = CHI_bytedance_editorial_news_group days = 365 } } } # One entry point per milestone, called from the yearly pulse. Full presents the # choice; Outcomes Only applies the historical persistent route silently without # the live event's one-time costs or rewards. CHI_bytedance_milestone_2012 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.340 days = 225 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_bytedance_algorithmic_feed } } CHI_bytedance_milestone_2016 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.341 days = 263 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_bytedance_short_video } } CHI_bytedance_milestone_2018 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.342 days = 100 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_bytedance_content_compliance } } CHI_bytedance_milestone_2020 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.343 days = 226 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_bytedance_algorithm_withheld } } CHI_bytedance_milestone_2024 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.344 days = 114 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } set_country_flag = CHI_bytedance_litigated } } CHI_bytedance_milestone_2026 = { if = { limit = { has_game_rule = { rule = rule_corporate_history option = full } } country_event = { id = CHI_semiconductor_events.345 days = 190 } } else_if = { limit = { has_game_rule = { rule = rule_corporate_history option = outcomes_only } } CHI_bytedance_apply_sovereign_engine = yes } } # One entry point per year, called from the yearly pulse, so that adding a chain # does not add a line to every year block in 00_yearly_effects.txt. CHI_corporate_history_2000 = { CHI_alibaba_milestone_2000 = yes } CHI_corporate_history_2001 = { CHI_huawei_milestone_2001 = yes CHI_tencent_milestone_2001 = yes } CHI_corporate_history_2003 = { CHI_alibaba_milestone_2003 = yes } CHI_corporate_history_2004 = { CHI_lenovo_milestone_2004 = yes CHI_tencent_milestone_2004 = yes } CHI_corporate_history_2005 = { CHI_lenovo_milestone_2005 = yes CHI_alibaba_milestone_2005 = yes } CHI_corporate_history_2008 = { CHI_lenovo_milestone_2008 = yes } CHI_corporate_history_2009 = { CHI_huawei_milestone_2009 = yes } CHI_corporate_history_2011 = { CHI_lenovo_milestone_2011 = yes CHI_tencent_milestone_2011 = yes CHI_alibaba_milestone_2011 = yes } CHI_corporate_history_2012 = { CHI_bytedance_milestone_2012 = yes } CHI_corporate_history_2013 = { CHI_huawei_milestone_2013 = yes } CHI_corporate_history_2014 = { CHI_lenovo_milestone_2014 = yes } CHI_corporate_history_2016 = { CHI_tencent_milestone_2016 = yes CHI_bytedance_milestone_2016 = yes } CHI_corporate_history_2018 = { CHI_tencent_milestone_2018 = yes CHI_bytedance_milestone_2018 = yes } CHI_corporate_history_2019 = { CHI_huawei_milestone_2019 = yes } CHI_corporate_history_2020 = { CHI_huawei_milestone_2020 = yes CHI_alibaba_milestone_2020 = yes CHI_bytedance_milestone_2020 = yes } CHI_corporate_history_2023 = { CHI_huawei_milestone_2023 = yes } CHI_corporate_history_2024 = { CHI_bytedance_milestone_2024 = yes } CHI_corporate_history_2026 = { CHI_lenovo_milestone_2026 = yes CHI_tencent_milestone_2026 = yes CHI_alibaba_milestone_2026 = yes CHI_bytedance_milestone_2026 = yes } # Keep temporary exceptions and their consumer in one history effect invocation. CHI_initialize_party_bans = { add_to_temp_array = { ban_except_array = 4 } add_to_temp_array = { ban_except_array = 5 } add_to_temp_array = { ban_except_array = 7 } add_to_temp_array = { ban_except_array = 18 } ban_all_parties_except_array = yes }