# Random Constructions # Costs are integrated within this function # Author(s): Angriest Bird one_random_arms_factory = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 1 add_extra_state_shared_building_slots = 1 add_building_construction = { type = arms_factory level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -7.5 } modify_treasury_effect = yes } } one_state_arms_factory = { if = { limit = { free_building_slots = { building = arms_factory size > 0 include_locked = yes } } add_extra_state_shared_building_slots = 1 add_building_construction = { type = arms_factory level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 1 add_extra_state_shared_building_slots = 1 add_building_construction = { type = arms_factory level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -7.5 } modify_treasury_effect = yes } } } two_random_arms_factory = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 2 add_extra_state_shared_building_slots = 1 add_building_construction = { type = arms_factory level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -15 } modify_treasury_effect = yes } } two_state_arms_factory = { if = { limit = { free_building_slots = { building = arms_factory size > 1 include_locked = yes } } add_extra_state_shared_building_slots = 2 add_building_construction = { type = arms_factory level = 2 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 2 add_extra_state_shared_building_slots = 1 add_building_construction = { type = arms_factory level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -15 } modify_treasury_effect = yes } } } three_random_arms_factory = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 3 add_extra_state_shared_building_slots = 1 add_building_construction = { type = arms_factory level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -22.5 } modify_treasury_effect = yes } } three_state_arms_factory = { if = { limit = { free_building_slots = { building = arms_factory size > 2 include_locked = yes } } add_extra_state_shared_building_slots = 3 add_building_construction = { type = arms_factory level = 3 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 3 add_extra_state_shared_building_slots = 1 add_building_construction = { type = arms_factory level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -22.5 } modify_treasury_effect = yes } } } four_random_arms_factory = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 4 add_extra_state_shared_building_slots = 1 add_building_construction = { type = arms_factory level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -30 } modify_treasury_effect = yes } } four_state_arms_factory = { if = { limit = { free_building_slots = { building = arms_factory size > 3 include_locked = yes } } add_extra_state_shared_building_slots = 4 add_building_construction = { type = arms_factory level = 4 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 4 add_extra_state_shared_building_slots = 1 add_building_construction = { type = arms_factory level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -30 } modify_treasury_effect = yes } } } one_random_industrial_complex = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 1 add_extra_state_shared_building_slots = 1 add_building_construction = { type = industrial_complex level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -7.5 } modify_treasury_effect = yes } } one_state_industrial_complex = { if = { limit = { free_building_slots = { building = industrial_complex size > 0 include_locked = yes } } add_extra_state_shared_building_slots = 1 add_building_construction = { type = industrial_complex level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 1 add_extra_state_shared_building_slots = 1 add_building_construction = { type = industrial_complex level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -7.5 } modify_treasury_effect = yes } } } two_random_industrial_complex = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 2 add_extra_state_shared_building_slots = 1 add_building_construction = { type = industrial_complex level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -15 } modify_treasury_effect = yes } } two_state_industrial_complex = { if = { limit = { free_building_slots = { building = industrial_complex size > 1 include_locked = yes } } add_extra_state_shared_building_slots = 2 add_building_construction = { type = industrial_complex level = 2 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 2 add_extra_state_shared_building_slots = 1 add_building_construction = { type = industrial_complex level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -15 } modify_treasury_effect = yes } } } three_random_industrial_complex = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 3 add_extra_state_shared_building_slots = 1 add_building_construction = { type = industrial_complex level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -22.5 } modify_treasury_effect = yes } } three_state_industrial_complex = { if = { limit = { free_building_slots = { building = industrial_complex size > 2 include_locked = yes } } add_extra_state_shared_building_slots = 3 add_building_construction = { type = industrial_complex level = 3 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 3 add_extra_state_shared_building_slots = 1 add_building_construction = { type = industrial_complex level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -22.5 } modify_treasury_effect = yes } } } four_random_industrial_complex = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 4 add_extra_state_shared_building_slots = 1 add_building_construction = { type = industrial_complex level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -30 } modify_treasury_effect = yes } } four_state_industrial_complex = { if = { limit = { free_building_slots = { building = industrial_complex size > 3 include_locked = yes } } add_extra_state_shared_building_slots = 4 add_building_construction = { type = industrial_complex level = 4 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 4 add_extra_state_shared_building_slots = 1 add_building_construction = { type = industrial_complex level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -30 } modify_treasury_effect = yes } } } one_random_infrastructure = { every_controlled_state = { limit = { infrastructure_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = infrastructure level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3.5 } modify_treasury_effect = yes } } one_state_infrastructure = { if = { limit = { free_building_slots = { building = infrastructure size > 0 } } add_building_construction = { type = infrastructure level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { infrastructure_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = infrastructure level = 1 instant_build = yes } } } custom_effect_tooltip = no_building_construction_TT } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3.5 } modify_treasury_effect = yes } } } two_random_infrastructure = { every_controlled_state = { limit = { infrastructure_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = infrastructure level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -7 } modify_treasury_effect = yes } } two_state_infrastructure = { if = { limit = { free_building_slots = { building = infrastructure size > 1 } } add_building_construction = { type = infrastructure level = 2 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { infrastructure_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = infrastructure level = 1 instant_build = yes } } } custom_effect_tooltip = no_building_construction_TT } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -7 } modify_treasury_effect = yes } } } three_random_infrastructure = { every_controlled_state = { limit = { infrastructure_random_build_loc = yes } random_select_amount = 3 add_building_construction = { type = infrastructure level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -10.5 } modify_treasury_effect = yes } } three_state_infrastructure = { if = { limit = { free_building_slots = { building = infrastructure size > 2 } } add_building_construction = { type = infrastructure level = 3 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { infrastructure_random_build_loc = yes } random_select_amount = 3 add_building_construction = { type = infrastructure level = 1 instant_build = yes } } } custom_effect_tooltip = no_building_construction_TT } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -10.5 } modify_treasury_effect = yes } } } one_random_dockyard = { every_controlled_state = { limit = { dockyard_random_build_loc = yes } random_select_amount = 1 add_extra_state_shared_building_slots = 1 add_building_construction = { type = dockyard level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -7.5 } modify_treasury_effect = yes } } one_state_dockyard = { if = { limit = { is_coastal = yes free_building_slots = { building = dockyard size > 0 include_locked = yes } } add_extra_state_shared_building_slots = 1 add_building_construction = { type = dockyard level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { dockyard_random_build_loc = yes } random_select_amount = 1 add_extra_state_shared_building_slots = 1 add_building_construction = { type = dockyard level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -7.5 } modify_treasury_effect = yes } } } two_random_dockyards = { every_controlled_state = { limit = { dockyard_random_build_loc = yes } random_select_amount = 2 add_extra_state_shared_building_slots = 1 add_building_construction = { type = dockyard level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -15 } modify_treasury_effect = yes } } two_state_dockyards = { if = { limit = { is_coastal = yes free_building_slots = { building = dockyard size > 1 include_locked = yes } } add_extra_state_shared_building_slots = 2 add_building_construction = { type = dockyard level = 2 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { dockyard_random_build_loc = yes } random_select_amount = 2 add_extra_state_shared_building_slots = 1 add_building_construction = { type = dockyard level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -15 } modify_treasury_effect = yes } } } one_office_construction = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 1 add_extra_state_shared_building_slots = 1 add_building_construction = { type = offices level = 1 instant_build = yes } add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -12 } modify_treasury_effect = yes } } one_state_office_construction = { if = { limit = { free_building_slots = { building = offices size > 0 include_locked = yes } } add_extra_state_shared_building_slots = 1 add_building_construction = { type = offices level = 1 instant_build = yes } add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 1 add_extra_state_shared_building_slots = 1 add_building_construction = { type = offices level = 1 instant_build = yes } add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -12 } modify_treasury_effect = yes } } } two_office_construction = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 2 add_extra_state_shared_building_slots = 1 add_building_construction = { type = offices level = 1 instant_build = yes } add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -24 } modify_treasury_effect = yes } } two_state_office_construction = { if = { limit = { free_building_slots = { building = offices size > 1 include_locked = yes } } add_extra_state_shared_building_slots = 2 add_building_construction = { type = offices level = 2 instant_build = yes } add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 2 add_extra_state_shared_building_slots = 1 add_building_construction = { type = offices level = 1 instant_build = yes } add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -24 } modify_treasury_effect = yes } } } three_office_construction = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 3 add_extra_state_shared_building_slots = 1 add_building_construction = { type = offices level = 1 instant_build = yes } add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -36 } modify_treasury_effect = yes } } three_state_office_construction = { if = { limit = { free_building_slots = { building = offices size > 2 include_locked = yes } } add_extra_state_shared_building_slots = 3 add_building_construction = { type = offices level = 3 instant_build = yes } add_building_construction = { type = fossil_powerplant level = 2 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 3 add_extra_state_shared_building_slots = 1 add_building_construction = { type = offices level = 1 instant_build = yes } add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -36 } modify_treasury_effect = yes } } } one_random_nuclear_reactor = { every_controlled_state = { limit = { nuclear_reactor_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = nuclear_reactor level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -9.00 } modify_treasury_effect = yes } } one_state_nuclear_reactor = { if = { limit = { free_building_slots = { building = nuclear_reactor size > 0 } } add_extra_state_shared_building_slots = 1 add_building_construction = { type = nuclear_reactor level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { nuclear_reactor_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = nuclear_reactor level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -9.00 } modify_treasury_effect = yes } } } two_random_nuclear_reactor = { every_controlled_state = { limit = { nuclear_reactor_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = nuclear_reactor level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -18.00 } modify_treasury_effect = yes } } two_state_nuclear_reactor = { if = { limit = { free_building_slots = { building = nuclear_reactor size > 1 } } add_extra_state_shared_building_slots = 2 add_building_construction = { type = nuclear_reactor level = 2 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { nuclear_reactor_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = nuclear_reactor level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -18.00 } modify_treasury_effect = yes } } } one_random_synthetic_refinery = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 1 add_building_construction = { type = synthetic_refinery level = 1 instant_build = yes } add_extra_state_shared_building_slots = 1 } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -6.0 } modify_treasury_effect = yes } } one_random_microchip_plant = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 1 add_building_construction = { type = microchip_plant level = 1 instant_build = yes } add_extra_state_shared_building_slots = 1 } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -10.5 } modify_treasury_effect = yes } } one_random_energy_infrastructure = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 1 add_building_construction = { type = energy_infrastructure level = 1 instant_build = yes } add_extra_state_shared_building_slots = 1 } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -6.5 } modify_treasury_effect = yes } } one_state_energy_infrastructure = { if = { limit = { free_shared_building_slots = yes } add_building_construction = { type = energy_infrastructure level = 1 instant_build = yes } add_extra_state_shared_building_slots = 1 } else = { ROOT = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 1 add_building_construction = { type = energy_infrastructure level = 1 instant_build = yes } add_extra_state_shared_building_slots = 1 } } custom_effect_tooltip = no_building_construction_TT } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -6.5 } modify_treasury_effect = yes } } } one_state_rail_terminal = { if = { limit = { free_building_slots = { building = rail_terminal size > 0 } } add_building_construction = { type = rail_terminal level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { free_building_slots = { building = rail_terminal size > 0 } } random_select_amount = 1 add_building_construction = { type = rail_terminal level = 1 instant_build = yes } } } custom_effect_tooltip = no_building_construction_TT } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -2.5 } modify_treasury_effect = yes } } } one_random_industrial_infrastructure = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 1 add_building_construction = { type = industrial_infrastructure level = 1 instant_build = yes } add_extra_state_shared_building_slots = 1 } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -6.5 } modify_treasury_effect = yes } } one_random_composite_plant = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 1 add_building_construction = { type = composite_plant level = 1 instant_build = yes } add_extra_state_shared_building_slots = 1 } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -8.5 } modify_treasury_effect = yes } } one_random_renewable_energy_infra = { every_controlled_state = { limit = { renewable_energy_infra_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = renewable_energy_infra level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -8.50 } modify_treasury_effect = yes } } one_state_renewable_energy_infra = { if = { limit = { free_building_slots = { building = renewable_energy_infra size > 0 } } add_building_construction = { type = renewable_energy_infra level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { renewable_energy_infra_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = renewable_energy_infra level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { set_temp_variable = { treasury_change = -8.50 } modify_treasury_effect = yes } } two_random_renewable_energy_infra = { every_controlled_state = { limit = { renewable_energy_infra_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = renewable_energy_infra level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -17 } modify_treasury_effect = yes } } two_state_renewable_energy_infra = { if = { limit = { free_building_slots = { building = renewable_energy_infra size > 1 } } add_building_construction = { type = renewable_energy_infra level = 2 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { renewable_energy_infra_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = renewable_energy_infra level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3 } modify_treasury_effect = yes } } } three_random_renewable_energy_infra = { every_controlled_state = { limit = { renewable_energy_infra_random_build_loc = yes } random_select_amount = 3 add_building_construction = { type = renewable_energy_infra level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -25.50 } modify_treasury_effect = yes } } three_state_renewable_energy_infra = { if = { limit = { free_building_slots = { building = renewable_energy_infra size > 2 } } add_building_construction = { type = renewable_energy_infra level = 3 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { renewable_energy_infra_random_build_loc = yes } random_select_amount = 3 add_building_construction = { type = renewable_energy_infra level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -25.5 } modify_treasury_effect = yes } } } one_air_base = { every_controlled_state = { limit = { air_base_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = air_base level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -2.5 } modify_treasury_effect = yes } } one_state_air_base = { if = { limit = { free_building_slots = { building = air_base size > 0 } } add_building_construction = { type = air_base level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { air_base_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = air_base level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3 } modify_treasury_effect = yes } } } two_air_base = { every_controlled_state = { limit = { air_base_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = air_base level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -5 } modify_treasury_effect = yes } } two_state_air_base = { if = { limit = { free_building_slots = { building = air_base size > 1 } } add_building_construction = { type = air_base level = 2 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { air_base_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = air_base level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -5 } modify_treasury_effect = yes } } } one_radar_station = { every_controlled_state = { limit = { radar_station_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = radar_station level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -1.75 } modify_treasury_effect = yes } } one_state_radar_station = { if = { limit = { free_building_slots = { building = radar_station size > 0 } } add_building_construction = { type = radar_station level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { radar_station_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = radar_station level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -1.75 } modify_treasury_effect = yes } } } two_radar_station = { every_controlled_state = { limit = { radar_station_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = radar_station level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3.5 } modify_treasury_effect = yes } } two_state_radar_station = { if = { limit = { free_building_slots = { building = radar_station size > 1 } } add_building_construction = { type = radar_station level = 2 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { radar_station_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = radar_station level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3.5 } modify_treasury_effect = yes } } } one_anti_air = { every_controlled_state = { limit = { anti_air_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = anti_air_building level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3.25 } modify_treasury_effect = yes } } one_state_anti_air = { if = { limit = { free_building_slots = { building = anti_air_building size > 0 } } add_building_construction = { type = anti_air_building level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { anti_air_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = anti_air_building level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3.25 } modify_treasury_effect = yes } } } two_anti_air = { every_controlled_state = { limit = { anti_air_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = anti_air_building level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -6.5 } modify_treasury_effect = yes } } two_state_anti_air = { if = { limit = { free_building_slots = { building = anti_air_building size > 1 } } add_building_construction = { type = anti_air_building level = 2 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { anti_air_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = anti_air_building level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -6.5 } modify_treasury_effect = yes } } } one_random_network_infrastructure = { every_controlled_state = { limit = { network_infrastructure_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = internet_station level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3 } modify_treasury_effect = yes } } one_state_network_infrastructure = { if = { limit = { free_building_slots = { building = internet_station size > 0 } } add_building_construction = { type = internet_station level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { network_infrastructure_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = internet_station level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3 } modify_treasury_effect = yes } } } two_random_network_infrastructure = { every_controlled_state = { limit = { network_infrastructure_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = internet_station level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -6 } modify_treasury_effect = yes } } two_state_network_infrastructure = { if = { limit = { free_building_slots = { building = internet_station size > 1 } } add_building_construction = { type = internet_station level = 2 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { network_infrastructure_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = internet_station level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3 } modify_treasury_effect = yes } } } one_fuel_reserve = { every_controlled_state = { limit = { fuel_reserve_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = fuel_silo level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3 } modify_treasury_effect = yes } } one_state_fuel_reserve = { if = { limit = { free_building_slots = { building = fuel_silo size > 0 } } add_building_construction = { type = fuel_silo level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { fuel_reserve_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = fuel_silo level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3 } modify_treasury_effect = yes } } } two_fuel_reserve = { every_controlled_state = { limit = { fuel_reserve_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = fuel_silo level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -6 } modify_treasury_effect = yes } } two_state_fuel_reserve = { if = { limit = { free_building_slots = { building = fuel_silo size > 1 } } add_building_construction = { type = fuel_silo level = 2 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { fuel_reserve_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = fuel_silo level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -6 } modify_treasury_effect = yes } } } one_random_fossil_fuel_powerplant = { every_controlled_state = { limit = { fossil_powerplant_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3.25 } modify_treasury_effect = yes } } one_state_fossil_fuel_powerplant = { if = { limit = { free_building_slots = { building = fossil_powerplant size > 0 } } add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { fossil_powerplant_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3.25 } modify_treasury_effect = yes } } } one_random_factory_energy_check = { if = { limit = { check_variable = { unfulfilled_energy_demand_var < -0.049 } NOT = { OR = { has_idea = some_additional_consumption_spirit has_idea = heavy_power_restrictions_spirit } } } every_controlled_state = { limit = { fossil_powerplant_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } } one_random_industrial_complex = yes } one_state_factory_energy_check = { if = { limit = { check_variable = { unfulfilled_energy_demand_var < -0.049 } NOT = { OR = { has_idea = some_additional_consumption_spirit has_idea = heavy_power_restrictions_spirit } } } if = { limit = { free_building_slots = { building = fossil_powerplant size > 0 } } add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { fossil_powerplant_random_build_loc = yes } random_select_amount = 1 add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } } one_state_industrial_complex = yes } two_random_fossil_fuel_powerplant = { every_controlled_state = { limit = { fossil_powerplant_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -6.5 } modify_treasury_effect = yes } } two_state_fossil_fuel_powerplant = { if = { limit = { free_building_slots = { building = fossil_powerplant size > 1 } } add_building_construction = { type = fossil_powerplant level = 2 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { fossil_powerplant_random_build_loc = yes } random_select_amount = 2 add_building_construction = { type = fossil_powerplant level = 1 instant_build = yes } } custom_effect_tooltip = no_building_construction_TT } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3.75 } modify_treasury_effect = yes } } } one_random_agriculture_district = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 1 add_extra_state_shared_building_slots = 1 add_building_construction = { type = agriculture_district level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3.75 } modify_treasury_effect = yes } } one_state_agriculture_district = { if = { limit = { free_building_slots = { building = agriculture_district size > 0 include_locked = yes } } add_extra_state_shared_building_slots = 1 add_building_construction = { type = agriculture_district level = 1 instant_build = yes } } else = { ROOT = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 1 add_extra_state_shared_building_slots = 1 add_building_construction = { type = agriculture_district level = 1 instant_build = yes } } } } CONTROLLER = { if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -3.75 } modify_treasury_effect = yes } } } two_random_agriculture_district = { every_controlled_state = { limit = { free_shared_building_slots = yes } random_select_amount = 2 add_extra_state_shared_building_slots = 1 add_building_construction = { type = agriculture_district level = 1 instant_build = yes } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -7.5 } modify_treasury_effect = yes } } increase_HIV_prevalence = { if = { limit = { has_idea = low_level_of_aids } swap_ideas = { remove_idea = low_level_of_aids add_idea = rising_level_of_aids } } else_if = { limit = { has_idea = rising_level_of_aids } swap_ideas = { remove_idea = rising_level_of_aids add_idea = high_level_of_aids } } else_if = { limit = { has_idea = high_level_of_aids } swap_ideas = { remove_idea = high_level_of_aids add_idea = very_high_level_of_aids } } else_if = { limit = { has_idea = very_high_level_of_aids } swap_ideas = { remove_idea = very_high_level_of_aids add_idea = critical_level_of_aids } } else_if = { limit = { has_idea = critical_level_of_aids } add_political_power = -100 } } decrease_HIV_prevalence = { if = { limit = { has_idea = critical_level_of_aids } swap_ideas = { remove_idea = critical_level_of_aids add_idea = very_high_level_of_aids } } else_if = { limit = { has_idea = very_high_level_of_aids } swap_ideas = { remove_idea = very_high_level_of_aids add_idea = high_level_of_aids } } else_if = { limit = { has_idea = high_level_of_aids } swap_ideas = { remove_idea = high_level_of_aids add_idea = rising_level_of_aids } } else_if = { limit = { has_idea = rising_level_of_aids } swap_ideas = { remove_idea = rising_level_of_aids add_idea = low_level_of_aids } } else_if = { limit = { has_idea = low_level_of_aids } remove_ideas = low_level_of_aids } } SF_marine_modern_demolition_effect = { #When changing this, update the research tooltip if = { limit = { coastal_bunker > 0 } damage_building = { type = coastal_bunker damage = 3 } } if = { limit = { bunker > 0 } damage_building = { type = bunker damage = 3 } } set_state_flag = { flag = marines_commando_effect value = 1 days = 30 } } SF_marine_logistics_raiding_effect = { if = { limit = { non_damaged_building_level = { building = infrastructure level > 0 } } damage_building = { type = infrastructure damage = 5 } } if = { limit = { non_damaged_building_level = { building = fuel_silo level > 0 } } damage_building = { type = fuel_silo damage = 3 } } } SF_PARA_sabotage_effect = { #When changing this, update the research tooltip if = { limit = { non_damaged_building_level = { building = air_base level > 0 } } damage_building = { type = air_base damage = 4 } } if = { limit = { non_damaged_building_level = { building = radar_station level > 0 } } damage_building = { type = radar_station damage = 2 } } if = { limit = { supply_node > 0 } damage_building = { type = supply_node damage = 2 } } if = { limit = { rail_way > 0 } damage_building = { type = rail_way damage = 2 } } set_state_flag = { flag = para_drop_effect value = 1 days = 30 } } SF_PARA_combat_effect = { #When changing this, update the research tooltip every_state_division = { limit = { OWNER = { has_war_with = FROM } } set_unit_organization = 0.75 } set_state_flag = { flag = para_drop_effect value = 1 days = 30 } } one_random_land_facility = { random_owned_controlled_state = { limit = { can_construct_building = land_facility } construct_building_in_random_province = { land_facility = 1 } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -15 } modify_treasury_effect = yes } } one_random_naval_facility = { random_owned_controlled_state = { limit = { can_construct_building = naval_facility } construct_building_in_random_province = { naval_facility = 1 } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -15 } modify_treasury_effect = yes } } one_random_air_facility = { random_owned_controlled_state = { limit = { can_construct_building = air_facility } construct_building_in_random_province = { air_facility = 1 } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -15 } modify_treasury_effect = yes } } one_random_nuclear_facility = { random_owned_controlled_state = { limit = { can_construct_building = nuclear_facility } construct_building_in_random_province = { nuclear_facility = 1 } } if = { limit = { NOT = { check_variable = { skip_payment = 1 } } } set_temp_variable = { treasury_change = -15 } modify_treasury_effect = yes } } # Ingame Startup Effect # Purpose: Effect that sets up released nations to ensure functionality with all of MDs systems # Parameters: # Null ingame_startup_nations_effect = { hidden_effect = { set_temp_variable = { fresh_nation_temp = 0 } if = { limit = { NOT = { has_variable = last_quarter_gdp_total } } set_temp_variable = { fresh_nation_temp = 1 } } setup_employment_variables = yes if = { limit = { PREV = { has_variable = gdpc_converging_var } } set_variable = { gdpc_converging_var = PREV.gdpc_converging_var } inherit_technology = PREV } else_if = { limit = { NOT = { has_variable = gdpc_converging_var } } set_variable = { gdpc_converging_var = overall_productivity } multiply_variable = { gdpc_converging_var = 0.05 } clamp_variable = { var = gdpc_converging_var min = 2 } } if = { limit = { NOT = { has_variable = domestic_influence_amount } } set_variable = { domestic_influence_amount = 100 } } if = { limit = { NOT = { has_variable = corporate_tax_rate } } set_variable = { var = corporate_tax_rate value = 20 } } if = { limit = { NOT = { has_variable = population_tax_rate } } set_variable = { var = population_tax_rate value = 20 } } if = { limit = { NOT = { has_dynamic_modifier = { modifier = civilian_microchip_consumption_modifier } } } add_dynamic_modifier = { modifier = civilian_microchip_consumption_modifier } } if = { limit = { NOT = { has_dynamic_modifier = { modifier = inflation_dynamic_modifier } } } add_dynamic_modifier = { modifier = inflation_dynamic_modifier } } calculate_influence_percentage = yes #set alignment drifts from influence startup_politics = yes set_law_vars = yes #vars for change laws secondary effects set_variable = { currency_inflation_feed = 0 } set_variable = { inflation_cost_combined_var = 0 } resize_array = { array = year_quarter_inflation_tracker value = inflation_rate_var size = 4 } calculate_inflation_effects = yes set_variable = { reserve_roi_bonus = 0 } set_variable = { reserve_trade_bonus = 0 } if = { limit = { NOT = { has_variable = cb_policy_rate } } set_variable = { cb_policy_rate = 3 } } if = { limit = { NOT = { has_idea = gold_standard_back } NOT = { has_idea = silver_standard } NOT = { has_idea = bi_metal_standard } NOT = { has_idea = no_currency_backing } } add_ideas = no_currency_backing } if = { limit = { NOT = { has_variable = cyber_capability } } set_variable = { cyber_attribution_bonus = 0 } set_variable = { cyber_ongoing_operations = 0 } cyber_nation_startup = yes #must precede ingame_update_setup so cyber_capability is set before update_military_rate checks it } currency_startup = yes ingame_update_setup = yes #money system if = { limit = { NOT = { has_variable = last_quarter_gdp_total } } set_variable = { last_quarter_gdp_total = gdp_total } } if = { limit = { NOT = { has_variable = last_quarter_gdpc_total } } set_variable = { last_quarter_gdpc_total = gdp_per_capita } } setup_init_factions = yes #flags for int. factions update_neighbors_effects = yes # Updates Neighbor Effects economic_cycle_drift_popularity = yes #drift from neighbor init_auto_influence_array = yes ingame_init_investment_system = yes research_slot_init_for_country = yes calculate_expected_spending = yes recalculate_law_desires = yes un_recog_setup_check = yes IP_idea_configuration = yes setup_missile_configuration_effect = yes microchip_startup = yes add_country_to_power_ranking = yes add_on_creation = yes if = { limit = { check_variable = { fresh_nation_temp = 1 } } increment_global_reserve_currency = yes calculate_starting_utility_stockpile = yes calculate_starting_mio_size = yes AGRI_plant_the_seeds = yes EDU_learn_your_ABCs_with_dread = yes if = { limit = { original_tag = TAL } AFG_reapply_taliban_opinion_modifiers = yes } } } } # Civil War Replication Effect # Purpose: full init plus politics/taxes/influence/faction copy from PREV onto a # freshly split-off nation (civil wars, dynamic peace-deal splinters) civil_war_replication_effect = { ingame_startup_nations_effect = yes set_temp_variable = { nation_to_copy_from = PREV.id } replicate_configure_politics = yes #VARIABLES set_variable = { var = corporate_tax_rate value = PREV.corporate_tax_rate } set_variable = { var = population_tax_rate value = PREV.population_tax_rate } set_variable = { treasury = PREV.treasury } set_temp_variable = { nation_to_copy_from = PREV.id } setup_employment_variables = yes #don't get values of original yet - REMINDER -> add it on_civil_war_end set_variable = { debt = 0 } set_variable = { int_investments = 0 } #influence set_variable = { domestic_influence_amount = PREV.domestic_influence_amount } #just copy all for_loop_effect = { end = PREV.influence_array^num value = v if = { limit = { NOT = { is_in_array = { influence_array = PREV.influence_array^v } } } add_to_array = { influence_array = PREV.influence_array^v } add_to_array = { influence_array_val = PREV.influence_array_val^v } } } recalculate_influence = yes #GAME VARIABLES add_political_power = PREV.political_power add_political_power = 400 #bonus #LAWS set_variable = { gdp_per_capita = PREV.gdp_per_capita } # Copy Internal Factions set_temp_variable = { nation_to_copy_from = PREV } copy_internal_factions = yes #copy leader throughput set_temp_variable = { nation_to_copy_from = PREV } copy_subideolgy_leader_throughput = yes calculate_influence_percentage = yes #set alignment drifts from influence ingame_update_setup = yes #money system calculate_expected_spending = yes mb_refresh_relations_effect = yes } ##################################### ### emergency_factory_conversion #### ##################################### #This is going to give misleading and ugly tooltips. Making it nice will take effort. TODO_WTT_CD make nice or ignore and remove comment. Easiest solution is just making a custom tooltip that says "5 civilian factories will be converted to military factories" and ignore telling the player the states where it will happen. replace_civ_with_arms_factories = { every_controlled_state = { limit = { is_owned_by = ROOT is_fully_controlled_by = ROOT industrial_complex > 0 } random_select_amount = 5 remove_building = { type = industrial_complex level = 1 } add_building_construction = { type = arms_factory level = 1 instant_build = yes } } } #Country scope ROOT_inherit_current_scope_wars_effect = { custom_effect_tooltip = ROOT_inherit_current_scope_wars_effect hidden_effect = { every_country = { limit = { has_defensive_war_with = PREV } ROOT = { declare_war_on = { target = PREV type = annex_everything } } } every_country = { limit = { has_offensive_war_with = PREV } declare_war_on = { target = ROOT type = annex_everything } } } } clear_sabotaged_resources_if_necesary = { if = { limit = { NOT = { has_dynamic_modifier = { modifier = sabotaged_resources } } } clear_variable = sabotaged_oil clear_variable = sabotaged_aluminium clear_variable = sabotaged_rubber clear_variable = sabotaged_tungsten clear_variable = sabotaged_steel clear_variable = sabotaged_chromium } } # wargoal_by = wargoal FROM # wargoal_on = country on which wargoal is placed # wargoal_type = 0 - puppet/default, 1 - liberate/change government, 2 - conquer add_threat_from_wargoal_effect = { if = { limit = { check_variable = { wargoal_by = 0 } } set_temp_variable = { wargoal_by = THIS.id } } set_temp_variable = { temp_threat = 5 } if = { limit = { var:wargoal_by = { has_idea = non_power } } add_to_temp_variable = { temp_threat = -2 } } else_if = { limit = { var:wargoal_by = { has_idea = minor_power } } add_to_temp_variable = { temp_threat = -1 } } else_if = { limit = { var:wargoal_by = { has_idea = large_power } } add_to_temp_variable = { temp_threat = 1 } } else_if = { limit = { var:wargoal_by = { has_idea = great_power } } add_to_temp_variable = { temp_threat = 2 } } else_if = { limit = { var:wargoal_by = { has_idea = super_power } } add_to_temp_variable = { temp_threat = 3 } } if = { limit = { var:wargoal_on = { has_idea = non_power } } add_to_temp_variable = { temp_threat = -2 } } else_if = { limit = { var:wargoal_on = { has_idea = minor_power } } add_to_temp_variable = { temp_threat = -1 } } else_if = { limit = { var:wargoal_on = { has_idea = large_power } } add_to_temp_variable = { temp_threat = 1 } } else_if = { limit = { var:wargoal_on = { has_idea = great_power } } add_to_temp_variable = { temp_threat = 2 } } else_if = { limit = { var:wargoal_on = { has_idea = super_power } } add_to_temp_variable = { temp_threat = 3 } } if = { limit = { check_variable = { wargoal_type = 1 } } multiply_temp_variable = { temp_threat = 0.5 } } else_if = { limit = { check_variable = { wargoal_type = 2 } } multiply_temp_variable = { temp_threat = 2 } } clamp_temp_variable = { var = temp_threat min = 1 max = 10 } var:wargoal_by = { add_threat = temp_threat } } CHI_censored_nation_level_up = { if = { limit = { has_idea = censored_nation_01 } swap_ideas = { remove_idea = censored_nation_01 add_idea = censored_nation_02 } } else_if = { limit = { has_idea = censored_nation_02 } swap_ideas = { remove_idea = censored_nation_02 add_idea = censored_nation_03 } } else_if = { limit = { has_idea = censored_nation_03 } swap_ideas = { remove_idea = censored_nation_03 add_idea = censored_nation_04 } } else_if = { limit = { has_idea = censored_nation_04 } swap_ideas = { remove_idea = censored_nation_04 add_idea = censored_nation_05 } } else_if = { limit = { has_idea = censored_nation_05 } swap_ideas = { remove_idea = censored_nation_05 add_idea = censored_nation_06 } } else_if = { limit = { has_idea = censored_nation_06 } swap_ideas = { remove_idea = censored_nation_06 add_idea = censored_nation_07 } } else_if = { limit = { has_idea = closed_nation } swap_ideas = { remove_idea = closed_nation add_idea = censored_nation_01 } } } # Special Projects add_space_program_progress = { if = { limit = { has_completed_space_program = no } sp:sp_space_program = { add_project_progress_ratio = 0.15 } } } ######### Set law to specific law (Using levels because we are going to standardise them soon) set_intervention_to_lvl_1 = { if = { limit = { has_idea = intervention_local_security } swap_ideas = { remove_idea = intervention_local_security add_idea = intervention_isolation } } else_if = { limit = { has_idea = intervention_limited_interventionism } swap_ideas = { remove_idea = intervention_limited_interventionism add_idea = intervention_isolation } } else_if = { limit = { has_idea = intervention_regional_interventionism } swap_ideas = { remove_idea = intervention_regional_interventionism add_idea = intervention_isolation } } else_if = { limit = { has_idea = intervention_global_interventionism } swap_ideas = { remove_idea = intervention_global_interventionism add_idea = intervention_isolation } } else_if = { limit = { has_idea = intervention_neo_imperialism } swap_ideas = { remove_idea = intervention_neo_imperialism add_idea = intervention_isolation } } } set_intervention_to_lvl_2 = { if = { limit = { has_idea = intervention_isolation } swap_ideas = { remove_idea = intervention_isolation add_idea = intervention_local_security } } else_if = { limit = { has_idea = intervention_limited_interventionism } swap_ideas = { remove_idea = intervention_limited_interventionism add_idea = intervention_local_security } } else_if = { limit = { has_idea = intervention_regional_interventionism } swap_ideas = { remove_idea = intervention_regional_interventionism add_idea = intervention_local_security } } else_if = { limit = { has_idea = intervention_global_interventionism } swap_ideas = { remove_idea = intervention_global_interventionism add_idea = intervention_local_security } } else_if = { limit = { has_idea = intervention_neo_imperialism } swap_ideas = { remove_idea = intervention_neo_imperialism add_idea = intervention_local_security } } } set_intervention_to_lvl_3 = { if = { limit = { has_idea = intervention_isolation } swap_ideas = { remove_idea = intervention_isolation add_idea = intervention_limited_interventionism } } else_if = { limit = { has_idea = intervention_local_security } swap_ideas = { remove_idea = intervention_local_security add_idea = intervention_limited_interventionism } } else_if = { limit = { has_idea = intervention_regional_interventionism } swap_ideas = { remove_idea = intervention_regional_interventionism add_idea = intervention_limited_interventionism } } else_if = { limit = { has_idea = intervention_global_interventionism } swap_ideas = { remove_idea = intervention_global_interventionism add_idea = intervention_limited_interventionism } } else_if = { limit = { has_idea = intervention_neo_imperialism } swap_ideas = { remove_idea = intervention_neo_imperialism add_idea = intervention_limited_interventionism } } } set_intervention_to_lvl_4 = { if = { limit = { has_idea = intervention_isolation } swap_ideas = { remove_idea = intervention_isolation add_idea = intervention_regional_interventionism } } else_if = { limit = { has_idea = intervention_local_security } swap_ideas = { remove_idea = intervention_local_security add_idea = intervention_regional_interventionism } } else_if = { limit = { has_idea = intervention_limited_interventionism } swap_ideas = { remove_idea = intervention_limited_interventionism add_idea = intervention_regional_interventionism } } else_if = { limit = { has_idea = intervention_global_interventionism } swap_ideas = { remove_idea = intervention_global_interventionism add_idea = intervention_regional_interventionism } } else_if = { limit = { has_idea = intervention_neo_imperialism } swap_ideas = { remove_idea = intervention_neo_imperialism add_idea = intervention_regional_interventionism } } } set_intervention_to_lvl_5 = { if = { limit = { has_idea = intervention_isolation } swap_ideas = { remove_idea = intervention_isolation add_idea = intervention_global_interventionism } } else_if = { limit = { has_idea = intervention_local_security } swap_ideas = { remove_idea = intervention_local_security add_idea = intervention_global_interventionism } } else_if = { limit = { has_idea = intervention_limited_interventionism } swap_ideas = { remove_idea = intervention_limited_interventionism add_idea = intervention_global_interventionism } } else_if = { limit = { has_idea = intervention_regional_interventionism } swap_ideas = { remove_idea = intervention_regional_interventionism add_idea = intervention_global_interventionism } } else_if = { limit = { has_idea = intervention_neo_imperialism } swap_ideas = { remove_idea = intervention_neo_imperialism add_idea = intervention_global_interventionism } } } set_intervention_to_lvl_6 = { if = { limit = { has_idea = intervention_isolation } swap_ideas = { remove_idea = intervention_isolation add_idea = intervention_neo_imperialism } } else_if = { limit = { has_idea = intervention_local_security } swap_ideas = { remove_idea = intervention_local_security add_idea = intervention_neo_imperialism } } else_if = { limit = { has_idea = intervention_limited_interventionism } swap_ideas = { remove_idea = intervention_limited_interventionism add_idea = intervention_neo_imperialism } } else_if = { limit = { has_idea = intervention_regional_interventionism } swap_ideas = { remove_idea = intervention_regional_interventionism add_idea = intervention_neo_imperialism } } else_if = { limit = { has_idea = intervention_global_interventionism } swap_ideas = { remove_idea = intervention_global_interventionism add_idea = intervention_neo_imperialism } } } # Caches the canal closures into global flags so map/adjacency_rules.txt reads one flag per canal # instead of scoping into a state and testing a dynamic modifier on every pathfinding query. update_canal_blockage_flags = { if = { limit = { OR = { EGY = { has_idea = suez_canal_blocked } 214 = { has_dynamic_modifier = { modifier = canal_damaged_modifier scope = THIS } } } } set_global_flag = SUEZ_CANAL_BLOCKED } else = { clr_global_flag = SUEZ_CANAL_BLOCKED } if = { limit = { 853 = { has_dynamic_modifier = { modifier = canal_damaged_modifier scope = THIS } } } set_global_flag = PANAMA_CANAL_BLOCKED } else = { clr_global_flag = PANAMA_CANAL_BLOCKED } if = { limit = { 37 = { has_dynamic_modifier = { modifier = canal_damaged_modifier scope = THIS } } } set_global_flag = GLOBAL_KIEL_CANAL_BLOCKED } else = { clr_global_flag = GLOBAL_KIEL_CANAL_BLOCKED } } # Purpose: Resyncs the diplomatic actions arrays for use in replacing various functions diplomatic_action_cached_array_resync = { clear_array = guaranteeing_nations clear_array = nations_with_military_access clear_array = nations_who_sent_us_volunteers clear_array = nations_we_sent_volunteers_to every_country = { if = { limit = { has_guaranteed = PREV } add_to_array = { PREV.guaranteeing_nations = THIS.id } } if = { limit = { has_military_access_to = PREV } add_to_array = { PREV.nations_with_military_access = THIS.id } } if = { limit = { PREV = { has_volunteers_amount_from = { tag = PREV count > 0 } } } add_to_array = { PREV.nations_who_sent_us_volunteers = THIS.id } } if = { limit = { has_volunteers_amount_from = { tag = PREV count > 0 } } add_to_array = { PREV.nations_we_sent_volunteers_to = THIS.id } } } }