ws_v152_process_armored_car = { ws_initialize = yes set_variable = { ws_v152_protected = 50 } multiply_variable = { ws_v152_protected = ws_reserve_multiplier } set_variable = { ws_v152_shortfall = num_target_equipment_in_armies@armored_car_equipment } subtract_from_variable = { ws_v152_shortfall = num_equipment_in_armies@armored_car_equipment } clamp_variable = { var = ws_v152_shortfall min = 0 max = 1000000 } add_to_variable = { ws_v152_protected = ws_v152_shortfall } set_variable = { ws_v152_remaining = num_equipment@armored_car_equipment } subtract_from_variable = { ws_v152_remaining = ws_v152_protected } clamp_variable = { var = ws_v152_remaining min = 0 max = 50 } # Conservative capacity preflight: all national/technology multipliers remain below x2. set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_iron } divide_variable = { ws_v152_room = 2.4 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_alloy } divide_variable = { ws_v152_room = 0.3 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_parts } divide_variable = { ws_v152_room = 0.16 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } subtract_from_variable = { ws_v152_remaining = 0.5 } round_variable = ws_v152_remaining clamp_variable = { var = ws_v152_remaining min = 0 max = 50 } set_variable = { ws_v152_removed = 0 } if = { limit = { check_variable = { ws_v152_remaining > 0 } } every_possible_country = { limit = { OR = { NOT = { tag = PREV } PREV = { has_country_flag = ws_all_producers } } } PREV = { if = { limit = { check_variable = { ws_v152_remaining > 0 } } set_variable = { ws_v152_before = num_equipment@armored_car_equipment } set_variable = { ws_v152_take = ws_v152_remaining } multiply_variable = { ws_v152_take = -1 } add_equipment_to_stockpile = { type = armored_car_equipment amount = ws_v152_take producer = PREV } set_variable = { ws_v152_delta = ws_v152_before } subtract_from_variable = { ws_v152_delta = num_equipment@armored_car_equipment } clamp_variable = { var = ws_v152_delta min = 0 max = ws_v152_remaining } add_to_variable = { ws_v152_removed = ws_v152_delta } subtract_from_variable = { ws_v152_remaining = ws_v152_delta } } } } } set_variable = { ws_v15_g_iron = ws_v152_removed } multiply_variable = { ws_v15_g_iron = 1.2 } set_variable = { ws_v15_g_alloy = ws_v152_removed } multiply_variable = { ws_v15_g_alloy = 0.15 } set_variable = { ws_v15_g_parts = ws_v152_removed } multiply_variable = { ws_v15_g_parts = 0.08 } if = { limit = { tag = JAP } multiply_variable = { ws_v15_g_iron = 1.25 } multiply_variable = { ws_v15_g_alloy = 1.25 } } if = { limit = { tag = JAP has_country_flag = ws_nat_upgrade_jap } multiply_variable = { ws_v15_g_iron = 1.12 } multiply_variable = { ws_v15_g_alloy = 1.12 } } ws_v15_add_materials = yes add_to_variable = { ws_total_processed = ws_v152_removed } clamp_variable = { var = ws_total_processed min = 0 max = 1000000 } set_variable = { ws_last_removed = ws_v152_removed } set_variable = { ws_last_iron = ws_v15_g_iron } set_variable = { ws_last_alloy = ws_v15_g_alloy } set_variable = { ws_last_parts = ws_v15_g_parts } } ws_v152_process_rocket_artillery = { ws_initialize = yes set_variable = { ws_v152_protected = 50 } multiply_variable = { ws_v152_protected = ws_reserve_multiplier } set_variable = { ws_v152_shortfall = num_target_equipment_in_armies@rocket_artillery_equipment } subtract_from_variable = { ws_v152_shortfall = num_equipment_in_armies@rocket_artillery_equipment } clamp_variable = { var = ws_v152_shortfall min = 0 max = 1000000 } add_to_variable = { ws_v152_protected = ws_v152_shortfall } set_variable = { ws_v152_remaining = num_equipment@rocket_artillery_equipment } subtract_from_variable = { ws_v152_remaining = ws_v152_protected } clamp_variable = { var = ws_v152_remaining min = 0 max = 50 } # Conservative capacity preflight: all national/technology multipliers remain below x2. set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_iron } divide_variable = { ws_v152_room = 1.8 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_alloy } divide_variable = { ws_v152_room = 0.4 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_parts } divide_variable = { ws_v152_room = 0.1 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } subtract_from_variable = { ws_v152_remaining = 0.5 } round_variable = ws_v152_remaining clamp_variable = { var = ws_v152_remaining min = 0 max = 50 } set_variable = { ws_v152_removed = 0 } if = { limit = { check_variable = { ws_v152_remaining > 0 } } every_possible_country = { limit = { OR = { NOT = { tag = PREV } PREV = { has_country_flag = ws_all_producers } } } PREV = { if = { limit = { check_variable = { ws_v152_remaining > 0 } } set_variable = { ws_v152_before = num_equipment@rocket_artillery_equipment } set_variable = { ws_v152_take = ws_v152_remaining } multiply_variable = { ws_v152_take = -1 } add_equipment_to_stockpile = { type = rocket_artillery_equipment amount = ws_v152_take producer = PREV } set_variable = { ws_v152_delta = ws_v152_before } subtract_from_variable = { ws_v152_delta = num_equipment@rocket_artillery_equipment } clamp_variable = { var = ws_v152_delta min = 0 max = ws_v152_remaining } add_to_variable = { ws_v152_removed = ws_v152_delta } subtract_from_variable = { ws_v152_remaining = ws_v152_delta } } } } } set_variable = { ws_v15_g_iron = ws_v152_removed } multiply_variable = { ws_v15_g_iron = 0.9 } set_variable = { ws_v15_g_alloy = ws_v152_removed } multiply_variable = { ws_v15_g_alloy = 0.2 } set_variable = { ws_v15_g_parts = ws_v152_removed } multiply_variable = { ws_v15_g_parts = 0.05 } if = { limit = { tag = JAP } multiply_variable = { ws_v15_g_iron = 1.25 } multiply_variable = { ws_v15_g_alloy = 1.25 } } if = { limit = { tag = JAP has_country_flag = ws_nat_upgrade_jap } multiply_variable = { ws_v15_g_iron = 1.12 } multiply_variable = { ws_v15_g_alloy = 1.12 } } ws_v15_add_materials = yes add_to_variable = { ws_total_processed = ws_v152_removed } clamp_variable = { var = ws_total_processed min = 0 max = 1000000 } set_variable = { ws_last_removed = ws_v152_removed } set_variable = { ws_last_iron = ws_v15_g_iron } set_variable = { ws_last_alloy = ws_v15_g_alloy } set_variable = { ws_last_parts = ws_v15_g_parts } } ws_v152_process_amphibious_mech = { ws_initialize = yes set_variable = { ws_v152_protected = 30 } multiply_variable = { ws_v152_protected = ws_reserve_multiplier } set_variable = { ws_v152_shortfall = num_target_equipment_in_armies@amphibious_mechanized_equipment } subtract_from_variable = { ws_v152_shortfall = num_equipment_in_armies@amphibious_mechanized_equipment } clamp_variable = { var = ws_v152_shortfall min = 0 max = 1000000 } add_to_variable = { ws_v152_protected = ws_v152_shortfall } set_variable = { ws_v152_remaining = num_equipment@amphibious_mechanized_equipment } subtract_from_variable = { ws_v152_remaining = ws_v152_protected } clamp_variable = { var = ws_v152_remaining min = 0 max = 30 } # Conservative capacity preflight: all national/technology multipliers remain below x2. set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_iron } divide_variable = { ws_v152_room = 3.0 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_alloy } divide_variable = { ws_v152_room = 0.3 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_parts } divide_variable = { ws_v152_room = 0.24 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } subtract_from_variable = { ws_v152_remaining = 0.5 } round_variable = ws_v152_remaining clamp_variable = { var = ws_v152_remaining min = 0 max = 30 } set_variable = { ws_v152_removed = 0 } if = { limit = { check_variable = { ws_v152_remaining > 0 } } every_possible_country = { limit = { OR = { NOT = { tag = PREV } PREV = { has_country_flag = ws_all_producers } } } PREV = { if = { limit = { check_variable = { ws_v152_remaining > 0 } } set_variable = { ws_v152_before = num_equipment@amphibious_mechanized_equipment } set_variable = { ws_v152_take = ws_v152_remaining } multiply_variable = { ws_v152_take = -1 } add_equipment_to_stockpile = { type = amphibious_mechanized_equipment amount = ws_v152_take producer = PREV } set_variable = { ws_v152_delta = ws_v152_before } subtract_from_variable = { ws_v152_delta = num_equipment@amphibious_mechanized_equipment } clamp_variable = { var = ws_v152_delta min = 0 max = ws_v152_remaining } add_to_variable = { ws_v152_removed = ws_v152_delta } subtract_from_variable = { ws_v152_remaining = ws_v152_delta } } } } } set_variable = { ws_v15_g_iron = ws_v152_removed } multiply_variable = { ws_v15_g_iron = 1.5 } set_variable = { ws_v15_g_alloy = ws_v152_removed } multiply_variable = { ws_v15_g_alloy = 0.15 } set_variable = { ws_v15_g_parts = ws_v152_removed } multiply_variable = { ws_v15_g_parts = 0.12 } if = { limit = { tag = JAP } multiply_variable = { ws_v15_g_iron = 1.25 } multiply_variable = { ws_v15_g_alloy = 1.25 } } if = { limit = { tag = JAP has_country_flag = ws_nat_upgrade_jap } multiply_variable = { ws_v15_g_iron = 1.12 } multiply_variable = { ws_v15_g_alloy = 1.12 } } ws_v15_add_materials = yes add_to_variable = { ws_total_processed = ws_v152_removed } clamp_variable = { var = ws_total_processed min = 0 max = 1000000 } set_variable = { ws_last_removed = ws_v152_removed } set_variable = { ws_last_iron = ws_v15_g_iron } set_variable = { ws_last_alloy = ws_v15_g_alloy } set_variable = { ws_last_parts = ws_v15_g_parts } } ws_v152_process_convoys = { ws_initialize = yes set_variable = { ws_v152_protected = 50 } multiply_variable = { ws_v152_protected = ws_reserve_multiplier } set_variable = { ws_v152_shortfall = 0 } add_to_variable = { ws_v152_protected = ws_v152_shortfall } set_variable = { ws_v152_remaining = num_equipment@convoy_1 } subtract_from_variable = { ws_v152_remaining = ws_v152_protected } clamp_variable = { var = ws_v152_remaining min = 0 max = 25 } # Conservative capacity preflight: all national/technology multipliers remain below x2. set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_iron } divide_variable = { ws_v152_room = 4.0 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_alloy } divide_variable = { ws_v152_room = 0.4 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_parts } divide_variable = { ws_v152_room = 0.2 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } subtract_from_variable = { ws_v152_remaining = 0.5 } round_variable = ws_v152_remaining clamp_variable = { var = ws_v152_remaining min = 0 max = 25 } set_variable = { ws_v152_removed = 0 } if = { limit = { check_variable = { ws_v152_remaining > 0 } } every_possible_country = { limit = { OR = { NOT = { tag = PREV } PREV = { has_country_flag = ws_all_producers } } } PREV = { if = { limit = { check_variable = { ws_v152_remaining > 0 } } set_variable = { ws_v152_before = num_equipment@convoy_1 } set_variable = { ws_v152_take = ws_v152_remaining } multiply_variable = { ws_v152_take = -1 } add_equipment_to_stockpile = { type = convoy_1 amount = ws_v152_take producer = PREV } set_variable = { ws_v152_delta = ws_v152_before } subtract_from_variable = { ws_v152_delta = num_equipment@convoy_1 } clamp_variable = { var = ws_v152_delta min = 0 max = ws_v152_remaining } add_to_variable = { ws_v152_removed = ws_v152_delta } subtract_from_variable = { ws_v152_remaining = ws_v152_delta } } } } } set_variable = { ws_v15_g_iron = ws_v152_removed } multiply_variable = { ws_v15_g_iron = 2.0 } set_variable = { ws_v15_g_alloy = ws_v152_removed } multiply_variable = { ws_v15_g_alloy = 0.2 } set_variable = { ws_v15_g_parts = ws_v152_removed } multiply_variable = { ws_v15_g_parts = 0.1 } if = { limit = { tag = JAP } multiply_variable = { ws_v15_g_iron = 1.25 } multiply_variable = { ws_v15_g_alloy = 1.25 } } if = { limit = { tag = JAP has_country_flag = ws_nat_upgrade_jap } multiply_variable = { ws_v15_g_iron = 1.12 } multiply_variable = { ws_v15_g_alloy = 1.12 } } ws_v15_add_materials = yes add_to_variable = { ws_total_processed = ws_v152_removed } clamp_variable = { var = ws_total_processed min = 0 max = 1000000 } set_variable = { ws_last_removed = ws_v152_removed } set_variable = { ws_last_iron = ws_v15_g_iron } set_variable = { ws_last_alloy = ws_v15_g_alloy } set_variable = { ws_last_parts = ws_v15_g_parts } } ws_v152_process_modern_tank = { ws_initialize = yes set_variable = { ws_v152_protected = 30 } multiply_variable = { ws_v152_protected = ws_reserve_multiplier } set_variable = { ws_v152_shortfall = num_target_equipment_in_armies@modern_tank_chassis } subtract_from_variable = { ws_v152_shortfall = num_equipment_in_armies@modern_tank_chassis } clamp_variable = { var = ws_v152_shortfall min = 0 max = 1000000 } add_to_variable = { ws_v152_protected = ws_v152_shortfall } set_variable = { ws_v152_remaining = num_equipment@modern_tank_chassis } subtract_from_variable = { ws_v152_remaining = ws_v152_protected } clamp_variable = { var = ws_v152_remaining min = 0 max = 15 } # Conservative capacity preflight: all national/technology multipliers remain below x2. set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_iron } divide_variable = { ws_v152_room = 10.0 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_alloy } divide_variable = { ws_v152_room = 1.6 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_parts } divide_variable = { ws_v152_room = 0.6 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } subtract_from_variable = { ws_v152_remaining = 0.5 } round_variable = ws_v152_remaining clamp_variable = { var = ws_v152_remaining min = 0 max = 15 } set_variable = { ws_v152_removed = 0 } if = { limit = { check_variable = { ws_v152_remaining > 0 } } every_possible_country = { limit = { OR = { NOT = { tag = PREV } PREV = { has_country_flag = ws_all_producers } } } PREV = { if = { limit = { check_variable = { ws_v152_remaining > 0 } } set_variable = { ws_v152_before = num_equipment@modern_tank_chassis } set_variable = { ws_v152_take = ws_v152_remaining } multiply_variable = { ws_v152_take = -1 } add_equipment_to_stockpile = { type = modern_tank_chassis amount = ws_v152_take producer = PREV } set_variable = { ws_v152_delta = ws_v152_before } subtract_from_variable = { ws_v152_delta = num_equipment@modern_tank_chassis } clamp_variable = { var = ws_v152_delta min = 0 max = ws_v152_remaining } add_to_variable = { ws_v152_removed = ws_v152_delta } subtract_from_variable = { ws_v152_remaining = ws_v152_delta } } } } } set_variable = { ws_v15_g_iron = ws_v152_removed } multiply_variable = { ws_v15_g_iron = 5.0 } set_variable = { ws_v15_g_alloy = ws_v152_removed } multiply_variable = { ws_v15_g_alloy = 0.8 } set_variable = { ws_v15_g_parts = ws_v152_removed } multiply_variable = { ws_v15_g_parts = 0.3 } if = { limit = { tag = JAP } multiply_variable = { ws_v15_g_iron = 1.25 } multiply_variable = { ws_v15_g_alloy = 1.25 } } if = { limit = { tag = JAP has_country_flag = ws_nat_upgrade_jap } multiply_variable = { ws_v15_g_iron = 1.12 } multiply_variable = { ws_v15_g_alloy = 1.12 } } ws_v15_add_materials = yes add_to_variable = { ws_total_processed = ws_v152_removed } clamp_variable = { var = ws_total_processed min = 0 max = 1000000 } set_variable = { ws_last_removed = ws_v152_removed } set_variable = { ws_last_iron = ws_v15_g_iron } set_variable = { ws_last_alloy = ws_v15_g_alloy } set_variable = { ws_last_parts = ws_v15_g_parts } } ws_v152_process_super_heavy_tank = { ws_initialize = yes set_variable = { ws_v152_protected = 20 } multiply_variable = { ws_v152_protected = ws_reserve_multiplier } set_variable = { ws_v152_shortfall = num_target_equipment_in_armies@super_heavy_tank_chassis } subtract_from_variable = { ws_v152_shortfall = num_equipment_in_armies@super_heavy_tank_chassis } clamp_variable = { var = ws_v152_shortfall min = 0 max = 1000000 } add_to_variable = { ws_v152_protected = ws_v152_shortfall } set_variable = { ws_v152_remaining = num_equipment@super_heavy_tank_chassis } subtract_from_variable = { ws_v152_remaining = ws_v152_protected } clamp_variable = { var = ws_v152_remaining min = 0 max = 10 } # Conservative capacity preflight: all national/technology multipliers remain below x2. set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_iron } divide_variable = { ws_v152_room = 16.0 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_alloy } divide_variable = { ws_v152_room = 3.0 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_parts } divide_variable = { ws_v152_room = 0.8 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } subtract_from_variable = { ws_v152_remaining = 0.5 } round_variable = ws_v152_remaining clamp_variable = { var = ws_v152_remaining min = 0 max = 10 } set_variable = { ws_v152_removed = 0 } if = { limit = { check_variable = { ws_v152_remaining > 0 } } every_possible_country = { limit = { OR = { NOT = { tag = PREV } PREV = { has_country_flag = ws_all_producers } } } PREV = { if = { limit = { check_variable = { ws_v152_remaining > 0 } } set_variable = { ws_v152_before = num_equipment@super_heavy_tank_chassis } set_variable = { ws_v152_take = ws_v152_remaining } multiply_variable = { ws_v152_take = -1 } add_equipment_to_stockpile = { type = super_heavy_tank_chassis amount = ws_v152_take producer = PREV } set_variable = { ws_v152_delta = ws_v152_before } subtract_from_variable = { ws_v152_delta = num_equipment@super_heavy_tank_chassis } clamp_variable = { var = ws_v152_delta min = 0 max = ws_v152_remaining } add_to_variable = { ws_v152_removed = ws_v152_delta } subtract_from_variable = { ws_v152_remaining = ws_v152_delta } } } } } set_variable = { ws_v15_g_iron = ws_v152_removed } multiply_variable = { ws_v15_g_iron = 8.0 } set_variable = { ws_v15_g_alloy = ws_v152_removed } multiply_variable = { ws_v15_g_alloy = 1.5 } set_variable = { ws_v15_g_parts = ws_v152_removed } multiply_variable = { ws_v15_g_parts = 0.4 } if = { limit = { tag = JAP } multiply_variable = { ws_v15_g_iron = 1.25 } multiply_variable = { ws_v15_g_alloy = 1.25 } } if = { limit = { tag = JAP has_country_flag = ws_nat_upgrade_jap } multiply_variable = { ws_v15_g_iron = 1.12 } multiply_variable = { ws_v15_g_alloy = 1.12 } } ws_v15_add_materials = yes add_to_variable = { ws_total_processed = ws_v152_removed } clamp_variable = { var = ws_total_processed min = 0 max = 1000000 } set_variable = { ws_last_removed = ws_v152_removed } set_variable = { ws_last_iron = ws_v15_g_iron } set_variable = { ws_last_alloy = ws_v15_g_alloy } set_variable = { ws_last_parts = ws_v15_g_parts } } ws_v152_process_modern_chassis = { ws_initialize = yes set_variable = { ws_v152_protected = 30 } multiply_variable = { ws_v152_protected = ws_reserve_multiplier } set_variable = { ws_v152_shortfall = num_target_equipment_in_armies@modern_tank_chassis } subtract_from_variable = { ws_v152_shortfall = num_equipment_in_armies@modern_tank_chassis } clamp_variable = { var = ws_v152_shortfall min = 0 max = 1000000 } add_to_variable = { ws_v152_protected = ws_v152_shortfall } set_variable = { ws_v152_remaining = num_equipment@modern_tank_chassis } subtract_from_variable = { ws_v152_remaining = ws_v152_protected } clamp_variable = { var = ws_v152_remaining min = 0 max = 15 } # Conservative capacity preflight: all national/technology multipliers remain below x2. set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_iron } divide_variable = { ws_v152_room = 10.0 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_alloy } divide_variable = { ws_v152_room = 1.6 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_parts } divide_variable = { ws_v152_room = 0.6 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } subtract_from_variable = { ws_v152_remaining = 0.5 } round_variable = ws_v152_remaining clamp_variable = { var = ws_v152_remaining min = 0 max = 15 } set_variable = { ws_v152_removed = 0 } if = { limit = { check_variable = { ws_v152_remaining > 0 } } every_possible_country = { limit = { OR = { NOT = { tag = PREV } PREV = { has_country_flag = ws_all_producers } } } PREV = { if = { limit = { check_variable = { ws_v152_remaining > 0 } } set_variable = { ws_v152_before = num_equipment@modern_tank_chassis } set_variable = { ws_v152_take = ws_v152_remaining } multiply_variable = { ws_v152_take = -1 } add_equipment_to_stockpile = { type = modern_tank_chassis amount = ws_v152_take producer = PREV } set_variable = { ws_v152_delta = ws_v152_before } subtract_from_variable = { ws_v152_delta = num_equipment@modern_tank_chassis } clamp_variable = { var = ws_v152_delta min = 0 max = ws_v152_remaining } add_to_variable = { ws_v152_removed = ws_v152_delta } subtract_from_variable = { ws_v152_remaining = ws_v152_delta } } } } } set_variable = { ws_v15_g_iron = ws_v152_removed } multiply_variable = { ws_v15_g_iron = 5.0 } set_variable = { ws_v15_g_alloy = ws_v152_removed } multiply_variable = { ws_v15_g_alloy = 0.8 } set_variable = { ws_v15_g_parts = ws_v152_removed } multiply_variable = { ws_v15_g_parts = 0.3 } if = { limit = { tag = JAP } multiply_variable = { ws_v15_g_iron = 1.25 } multiply_variable = { ws_v15_g_alloy = 1.25 } } if = { limit = { tag = JAP has_country_flag = ws_nat_upgrade_jap } multiply_variable = { ws_v15_g_iron = 1.12 } multiply_variable = { ws_v15_g_alloy = 1.12 } } ws_v15_add_materials = yes add_to_variable = { ws_total_processed = ws_v152_removed } clamp_variable = { var = ws_total_processed min = 0 max = 1000000 } set_variable = { ws_last_removed = ws_v152_removed } set_variable = { ws_last_iron = ws_v15_g_iron } set_variable = { ws_last_alloy = ws_v15_g_alloy } set_variable = { ws_last_parts = ws_v15_g_parts } } ws_v152_process_super_heavy_chassis = { ws_initialize = yes set_variable = { ws_v152_protected = 20 } multiply_variable = { ws_v152_protected = ws_reserve_multiplier } set_variable = { ws_v152_shortfall = num_target_equipment_in_armies@super_heavy_tank_chassis } subtract_from_variable = { ws_v152_shortfall = num_equipment_in_armies@super_heavy_tank_chassis } clamp_variable = { var = ws_v152_shortfall min = 0 max = 1000000 } add_to_variable = { ws_v152_protected = ws_v152_shortfall } set_variable = { ws_v152_remaining = num_equipment@super_heavy_tank_chassis } subtract_from_variable = { ws_v152_remaining = ws_v152_protected } clamp_variable = { var = ws_v152_remaining min = 0 max = 10 } # Conservative capacity preflight: all national/technology multipliers remain below x2. set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_iron } divide_variable = { ws_v152_room = 16.0 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_alloy } divide_variable = { ws_v152_room = 3.0 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_parts } divide_variable = { ws_v152_room = 0.8 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } subtract_from_variable = { ws_v152_remaining = 0.5 } round_variable = ws_v152_remaining clamp_variable = { var = ws_v152_remaining min = 0 max = 10 } set_variable = { ws_v152_removed = 0 } if = { limit = { check_variable = { ws_v152_remaining > 0 } } every_possible_country = { limit = { OR = { NOT = { tag = PREV } PREV = { has_country_flag = ws_all_producers } } } PREV = { if = { limit = { check_variable = { ws_v152_remaining > 0 } } set_variable = { ws_v152_before = num_equipment@super_heavy_tank_chassis } set_variable = { ws_v152_take = ws_v152_remaining } multiply_variable = { ws_v152_take = -1 } add_equipment_to_stockpile = { type = super_heavy_tank_chassis amount = ws_v152_take producer = PREV } set_variable = { ws_v152_delta = ws_v152_before } subtract_from_variable = { ws_v152_delta = num_equipment@super_heavy_tank_chassis } clamp_variable = { var = ws_v152_delta min = 0 max = ws_v152_remaining } add_to_variable = { ws_v152_removed = ws_v152_delta } subtract_from_variable = { ws_v152_remaining = ws_v152_delta } } } } } set_variable = { ws_v15_g_iron = ws_v152_removed } multiply_variable = { ws_v15_g_iron = 8.0 } set_variable = { ws_v15_g_alloy = ws_v152_removed } multiply_variable = { ws_v15_g_alloy = 1.5 } set_variable = { ws_v15_g_parts = ws_v152_removed } multiply_variable = { ws_v15_g_parts = 0.4 } if = { limit = { tag = JAP } multiply_variable = { ws_v15_g_iron = 1.25 } multiply_variable = { ws_v15_g_alloy = 1.25 } } if = { limit = { tag = JAP has_country_flag = ws_nat_upgrade_jap } multiply_variable = { ws_v15_g_iron = 1.12 } multiply_variable = { ws_v15_g_alloy = 1.12 } } ws_v15_add_materials = yes add_to_variable = { ws_total_processed = ws_v152_removed } clamp_variable = { var = ws_total_processed min = 0 max = 1000000 } set_variable = { ws_last_removed = ws_v152_removed } set_variable = { ws_last_iron = ws_v15_g_iron } set_variable = { ws_last_alloy = ws_v15_g_alloy } set_variable = { ws_last_parts = ws_v15_g_parts } } ws_v152_process_nav_bomber = { ws_initialize = yes set_variable = { ws_v152_protected = 80 } multiply_variable = { ws_v152_protected = ws_reserve_multiplier } set_variable = { ws_v152_shortfall = num_target_equipment_in_armies@small_plane_airframe } subtract_from_variable = { ws_v152_shortfall = num_equipment_in_armies@small_plane_airframe } clamp_variable = { var = ws_v152_shortfall min = 0 max = 1000000 } add_to_variable = { ws_v152_protected = ws_v152_shortfall } set_variable = { ws_v152_remaining = num_equipment@small_plane_airframe } subtract_from_variable = { ws_v152_remaining = ws_v152_protected } clamp_variable = { var = ws_v152_remaining min = 0 max = 40 } # Conservative capacity preflight: all national/technology multipliers remain below x2. set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_iron } divide_variable = { ws_v152_room = 1.2 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_alloy } divide_variable = { ws_v152_room = 2.0 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_parts } divide_variable = { ws_v152_room = 0.1 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } subtract_from_variable = { ws_v152_remaining = 0.5 } round_variable = ws_v152_remaining clamp_variable = { var = ws_v152_remaining min = 0 max = 40 } set_variable = { ws_v152_removed = 0 } if = { limit = { check_variable = { ws_v152_remaining > 0 } } every_possible_country = { limit = { OR = { NOT = { tag = PREV } PREV = { has_country_flag = ws_all_producers } } } PREV = { if = { limit = { check_variable = { ws_v152_remaining > 0 } } set_variable = { ws_v152_before = num_equipment@small_plane_airframe } set_variable = { ws_v152_take = ws_v152_remaining } multiply_variable = { ws_v152_take = -1 } add_equipment_to_stockpile = { type = small_plane_airframe amount = ws_v152_take producer = PREV } set_variable = { ws_v152_delta = ws_v152_before } subtract_from_variable = { ws_v152_delta = num_equipment@small_plane_airframe } clamp_variable = { var = ws_v152_delta min = 0 max = ws_v152_remaining } add_to_variable = { ws_v152_removed = ws_v152_delta } subtract_from_variable = { ws_v152_remaining = ws_v152_delta } } } } } set_variable = { ws_v15_g_iron = ws_v152_removed } multiply_variable = { ws_v15_g_iron = 0.6 } set_variable = { ws_v15_g_alloy = ws_v152_removed } multiply_variable = { ws_v15_g_alloy = 1.0 } set_variable = { ws_v15_g_parts = ws_v152_removed } multiply_variable = { ws_v15_g_parts = 0.05 } if = { limit = { tag = JAP } multiply_variable = { ws_v15_g_iron = 1.25 } multiply_variable = { ws_v15_g_alloy = 1.25 } } if = { limit = { tag = JAP has_country_flag = ws_nat_upgrade_jap } multiply_variable = { ws_v15_g_iron = 1.12 } multiply_variable = { ws_v15_g_alloy = 1.12 } } ws_v15_add_materials = yes add_to_variable = { ws_total_processed = ws_v152_removed } clamp_variable = { var = ws_total_processed min = 0 max = 1000000 } set_variable = { ws_last_removed = ws_v152_removed } set_variable = { ws_last_iron = ws_v15_g_iron } set_variable = { ws_last_alloy = ws_v15_g_alloy } set_variable = { ws_last_parts = ws_v15_g_parts } } ws_v152_process_cv_fighter = { ws_initialize = yes set_variable = { ws_v152_protected = 60 } multiply_variable = { ws_v152_protected = ws_reserve_multiplier } set_variable = { ws_v152_shortfall = num_target_equipment_in_armies@small_plane_airframe } subtract_from_variable = { ws_v152_shortfall = num_equipment_in_armies@small_plane_airframe } clamp_variable = { var = ws_v152_shortfall min = 0 max = 1000000 } add_to_variable = { ws_v152_protected = ws_v152_shortfall } set_variable = { ws_v152_remaining = num_equipment@small_plane_airframe } subtract_from_variable = { ws_v152_remaining = ws_v152_protected } clamp_variable = { var = ws_v152_remaining min = 0 max = 30 } # Conservative capacity preflight: all national/technology multipliers remain below x2. set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_iron } divide_variable = { ws_v152_room = 1.0 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_alloy } divide_variable = { ws_v152_room = 1.6 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_parts } divide_variable = { ws_v152_room = 0.1 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } subtract_from_variable = { ws_v152_remaining = 0.5 } round_variable = ws_v152_remaining clamp_variable = { var = ws_v152_remaining min = 0 max = 30 } set_variable = { ws_v152_removed = 0 } if = { limit = { check_variable = { ws_v152_remaining > 0 } } every_possible_country = { limit = { OR = { NOT = { tag = PREV } PREV = { has_country_flag = ws_all_producers } } } PREV = { if = { limit = { check_variable = { ws_v152_remaining > 0 } } set_variable = { ws_v152_before = num_equipment@small_plane_airframe } set_variable = { ws_v152_take = ws_v152_remaining } multiply_variable = { ws_v152_take = -1 } add_equipment_to_stockpile = { type = small_plane_airframe amount = ws_v152_take producer = PREV } set_variable = { ws_v152_delta = ws_v152_before } subtract_from_variable = { ws_v152_delta = num_equipment@small_plane_airframe } clamp_variable = { var = ws_v152_delta min = 0 max = ws_v152_remaining } add_to_variable = { ws_v152_removed = ws_v152_delta } subtract_from_variable = { ws_v152_remaining = ws_v152_delta } } } } } set_variable = { ws_v15_g_iron = ws_v152_removed } multiply_variable = { ws_v15_g_iron = 0.5 } set_variable = { ws_v15_g_alloy = ws_v152_removed } multiply_variable = { ws_v15_g_alloy = 0.8 } set_variable = { ws_v15_g_parts = ws_v152_removed } multiply_variable = { ws_v15_g_parts = 0.05 } if = { limit = { tag = JAP } multiply_variable = { ws_v15_g_iron = 1.25 } multiply_variable = { ws_v15_g_alloy = 1.25 } } if = { limit = { tag = JAP has_country_flag = ws_nat_upgrade_jap } multiply_variable = { ws_v15_g_iron = 1.12 } multiply_variable = { ws_v15_g_alloy = 1.12 } } ws_v15_add_materials = yes add_to_variable = { ws_total_processed = ws_v152_removed } clamp_variable = { var = ws_total_processed min = 0 max = 1000000 } set_variable = { ws_last_removed = ws_v152_removed } set_variable = { ws_last_iron = ws_v15_g_iron } set_variable = { ws_last_alloy = ws_v15_g_alloy } set_variable = { ws_last_parts = ws_v15_g_parts } } ws_v152_process_cv_cas = { ws_initialize = yes set_variable = { ws_v152_protected = 60 } multiply_variable = { ws_v152_protected = ws_reserve_multiplier } set_variable = { ws_v152_shortfall = num_target_equipment_in_armies@small_plane_airframe } subtract_from_variable = { ws_v152_shortfall = num_equipment_in_armies@small_plane_airframe } clamp_variable = { var = ws_v152_shortfall min = 0 max = 1000000 } add_to_variable = { ws_v152_protected = ws_v152_shortfall } set_variable = { ws_v152_remaining = num_equipment@small_plane_airframe } subtract_from_variable = { ws_v152_remaining = ws_v152_protected } clamp_variable = { var = ws_v152_remaining min = 0 max = 30 } # Conservative capacity preflight: all national/technology multipliers remain below x2. set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_iron } divide_variable = { ws_v152_room = 1.0 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_alloy } divide_variable = { ws_v152_room = 1.6 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_parts } divide_variable = { ws_v152_room = 0.1 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } subtract_from_variable = { ws_v152_remaining = 0.5 } round_variable = ws_v152_remaining clamp_variable = { var = ws_v152_remaining min = 0 max = 30 } set_variable = { ws_v152_removed = 0 } if = { limit = { check_variable = { ws_v152_remaining > 0 } } every_possible_country = { limit = { OR = { NOT = { tag = PREV } PREV = { has_country_flag = ws_all_producers } } } PREV = { if = { limit = { check_variable = { ws_v152_remaining > 0 } } set_variable = { ws_v152_before = num_equipment@small_plane_airframe } set_variable = { ws_v152_take = ws_v152_remaining } multiply_variable = { ws_v152_take = -1 } add_equipment_to_stockpile = { type = small_plane_airframe amount = ws_v152_take producer = PREV } set_variable = { ws_v152_delta = ws_v152_before } subtract_from_variable = { ws_v152_delta = num_equipment@small_plane_airframe } clamp_variable = { var = ws_v152_delta min = 0 max = ws_v152_remaining } add_to_variable = { ws_v152_removed = ws_v152_delta } subtract_from_variable = { ws_v152_remaining = ws_v152_delta } } } } } set_variable = { ws_v15_g_iron = ws_v152_removed } multiply_variable = { ws_v15_g_iron = 0.5 } set_variable = { ws_v15_g_alloy = ws_v152_removed } multiply_variable = { ws_v15_g_alloy = 0.8 } set_variable = { ws_v15_g_parts = ws_v152_removed } multiply_variable = { ws_v15_g_parts = 0.05 } if = { limit = { tag = JAP } multiply_variable = { ws_v15_g_iron = 1.25 } multiply_variable = { ws_v15_g_alloy = 1.25 } } if = { limit = { tag = JAP has_country_flag = ws_nat_upgrade_jap } multiply_variable = { ws_v15_g_iron = 1.12 } multiply_variable = { ws_v15_g_alloy = 1.12 } } ws_v15_add_materials = yes add_to_variable = { ws_total_processed = ws_v152_removed } clamp_variable = { var = ws_total_processed min = 0 max = 1000000 } set_variable = { ws_last_removed = ws_v152_removed } set_variable = { ws_last_iron = ws_v15_g_iron } set_variable = { ws_last_alloy = ws_v15_g_alloy } set_variable = { ws_last_parts = ws_v15_g_parts } } ws_v152_process_cv_nav_bomber = { ws_initialize = yes set_variable = { ws_v152_protected = 60 } multiply_variable = { ws_v152_protected = ws_reserve_multiplier } set_variable = { ws_v152_shortfall = num_target_equipment_in_armies@small_plane_airframe } subtract_from_variable = { ws_v152_shortfall = num_equipment_in_armies@small_plane_airframe } clamp_variable = { var = ws_v152_shortfall min = 0 max = 1000000 } add_to_variable = { ws_v152_protected = ws_v152_shortfall } set_variable = { ws_v152_remaining = num_equipment@small_plane_airframe } subtract_from_variable = { ws_v152_remaining = ws_v152_protected } clamp_variable = { var = ws_v152_remaining min = 0 max = 30 } # Conservative capacity preflight: all national/technology multipliers remain below x2. set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_iron } divide_variable = { ws_v152_room = 1.2 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_alloy } divide_variable = { ws_v152_room = 1.8 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } set_variable = { ws_v152_room = 1000000 } subtract_from_variable = { ws_v152_room = ws_parts } divide_variable = { ws_v152_room = 0.1 } clamp_variable = { var = ws_v152_remaining min = 0 max = ws_v152_room } subtract_from_variable = { ws_v152_remaining = 0.5 } round_variable = ws_v152_remaining clamp_variable = { var = ws_v152_remaining min = 0 max = 30 } set_variable = { ws_v152_removed = 0 } if = { limit = { check_variable = { ws_v152_remaining > 0 } } every_possible_country = { limit = { OR = { NOT = { tag = PREV } PREV = { has_country_flag = ws_all_producers } } } PREV = { if = { limit = { check_variable = { ws_v152_remaining > 0 } } set_variable = { ws_v152_before = num_equipment@small_plane_airframe } set_variable = { ws_v152_take = ws_v152_remaining } multiply_variable = { ws_v152_take = -1 } add_equipment_to_stockpile = { type = small_plane_airframe amount = ws_v152_take producer = PREV } set_variable = { ws_v152_delta = ws_v152_before } subtract_from_variable = { ws_v152_delta = num_equipment@small_plane_airframe } clamp_variable = { var = ws_v152_delta min = 0 max = ws_v152_remaining } add_to_variable = { ws_v152_removed = ws_v152_delta } subtract_from_variable = { ws_v152_remaining = ws_v152_delta } } } } } set_variable = { ws_v15_g_iron = ws_v152_removed } multiply_variable = { ws_v15_g_iron = 0.6 } set_variable = { ws_v15_g_alloy = ws_v152_removed } multiply_variable = { ws_v15_g_alloy = 0.9 } set_variable = { ws_v15_g_parts = ws_v152_removed } multiply_variable = { ws_v15_g_parts = 0.05 } if = { limit = { tag = JAP } multiply_variable = { ws_v15_g_iron = 1.25 } multiply_variable = { ws_v15_g_alloy = 1.25 } } if = { limit = { tag = JAP has_country_flag = ws_nat_upgrade_jap } multiply_variable = { ws_v15_g_iron = 1.12 } multiply_variable = { ws_v15_g_alloy = 1.12 } } ws_v15_add_materials = yes add_to_variable = { ws_total_processed = ws_v152_removed } clamp_variable = { var = ws_total_processed min = 0 max = 1000000 } set_variable = { ws_last_removed = ws_v152_removed } set_variable = { ws_last_iron = ws_v15_g_iron } set_variable = { ws_last_alloy = ws_v15_g_alloy } set_variable = { ws_last_parts = ws_v15_g_parts } } ws_v152_record_naval_wreckage = { ws_initialize = yes add_to_variable = { ws_v152_naval_wreckage = 5 } clamp_variable = { var = ws_v152_naval_wreckage min = 0 max = 10000 } } ws_v152_recover_naval_wreckage = { ws_initialize = yes set_variable = { ws_last_removed = 0 } if = { limit = { check_variable = { ws_v152_naval_wreckage > 4.999 } check_variable = { ws_iron < 999960 } check_variable = { ws_alloy < 999980 } check_variable = { ws_parts < 999986 } } subtract_from_variable = { ws_v152_naval_wreckage = 5 } set_variable = { ws_v15_g_iron = 30 } set_variable = { ws_v15_g_alloy = 15 } set_variable = { ws_v15_g_parts = 10 } ws_v15_add_materials = yes set_variable = { ws_last_removed = 5 } set_variable = { ws_last_iron = ws_v15_g_iron } set_variable = { ws_last_alloy = ws_v15_g_alloy } set_variable = { ws_last_parts = ws_v15_g_parts } add_to_variable = { ws_total_processed = 5 } clamp_variable = { var = ws_total_processed min = 0 max = 1000000 } } } ws_v152_ai_monthly_policy = { # National AI priorities: monthly, reserve-protected, and cost-equivalent to player actions. # AI bypasses the decision UI, so DLC branches, PP costs/refunds and cooldowns are mirrored here explicitly. if = { limit = { NOT = { has_capitulated = yes } } # GER/ENG: refurbish foreign light armor. Match the player decision's NSB/legacy split. if = { limit = { OR = { tag = GER tag = ENG } OR = { ws_v15_refurb_parts_light_tanks = yes ws_v15_refurb_parts_light_tanks_old = yes } } if = { limit = { has_dlc = "No Step Back" ws_v15_refurb_stock_light_tanks = yes ws_v15_refurb_parts_light_tanks = yes NOT = { has_country_flag = ws_v15_busy_light_tanks } NOT = { has_country_flag = ws_v15_refurb_cd_light_tanks } } ws_v15_refurb_light_tanks = yes if = { limit = { check_variable = { ws_last_removed > 0 } } set_country_flag = { flag = ws_v15_refurb_cd_light_tanks days = 14 } } } else = { if = { limit = { ws_v15_refurb_stock_light_tanks_old = yes ws_v15_refurb_parts_light_tanks_old = yes NOT = { has_country_flag = ws_v15_busy_light_tanks_old } NOT = { has_country_flag = ws_v15_refurb_cd_light_tanks_old } } ws_v15_refurb_light_tanks_old = yes if = { limit = { check_variable = { ws_last_removed > 0 } } set_country_flag = { flag = ws_v15_refurb_cd_light_tanks_old days = 14 } } } } } # SOV: battlefield recovery. Mirror the player decision's 10 PP cost while keeping an AI PP reserve. if = { limit = { tag = SOV has_political_power > 20 check_variable = { ws_v15_wreckage > 9.999 } check_variable = { ws_iron < 999960 } check_variable = { ws_alloy < 999992 } check_variable = { ws_parts < 999988 } } add_political_power = -10 ws_v15_recover_wreckage = yes } # JAP: retire domestic obsolete small arms when the material stores have safe headroom. if = { limit = { tag = JAP NOT = { has_country_flag = ws_v15_retire_cd_smallarms } check_variable = { ws_iron < 900000 } check_variable = { ws_alloy < 900000 } check_variable = { ws_parts < 900000 } } ws_v15_retire_smallarms = yes if = { limit = { check_variable = { ws_last_removed > 0 } } set_country_flag = { flag = ws_v15_retire_cd_smallarms days = 14 } } } # USA: enemy-equipment analysis costs the same 15 PP as the player decision. # If producer filtering finds no foreign sample, refund the 15 PP and do not apply the 180-day cooldown. if = { limit = { tag = USA has_political_power > 30 NOT = { has_country_flag = ws_v15_research_cd_smallarms } } add_political_power = -15 ws_v15_analyse_smallarms = yes if = { limit = { check_variable = { ws_last_removed > 0 } } set_country_flag = { flag = ws_v15_research_cd_smallarms days = 180 } } else = { add_political_power = 15 } } # Shared recovery engineering: buy at most one historical stage per month, mirroring player PP costs. if = { limit = { date > 1940.1.1 has_political_power > 75 NOT = { has_country_flag = ws_recovery_tech_1940 } } add_political_power = -25 set_country_flag = ws_recovery_tech_1940 } else_if = { limit = { date > 1942.1.1 has_political_power > 85 has_country_flag = ws_recovery_tech_1940 NOT = { has_country_flag = ws_recovery_tech_1942 } } add_political_power = -35 set_country_flag = ws_recovery_tech_1942 } else_if = { limit = { date > 1944.1.1 has_political_power > 100 has_country_flag = ws_recovery_tech_1942 NOT = { has_country_flag = ws_recovery_tech_1944 } } add_political_power = -50 set_country_flag = ws_recovery_tech_1944 } # One-time national upgrade when the AI can comfortably pay for it. if = { limit = { tag = GER has_political_power > 100 NOT = { has_country_flag = ws_nat_upgrade_ger } } add_political_power = -50 set_country_flag = ws_nat_upgrade_ger ws_apply_national_doctrine = yes } if = { limit = { tag = SOV has_political_power > 100 NOT = { has_country_flag = ws_nat_upgrade_sov } } add_political_power = -50 set_country_flag = ws_nat_upgrade_sov ws_apply_national_doctrine = yes } if = { limit = { tag = JAP has_political_power > 100 NOT = { has_country_flag = ws_nat_upgrade_jap } } add_political_power = -50 set_country_flag = ws_nat_upgrade_jap ws_apply_national_doctrine = yes } if = { limit = { tag = USA has_political_power > 100 NOT = { has_country_flag = ws_nat_upgrade_usa } } add_political_power = -50 set_country_flag = ws_nat_upgrade_usa ws_apply_national_doctrine = yes } if = { limit = { tag = ENG has_political_power > 100 NOT = { has_country_flag = ws_nat_upgrade_eng } } add_political_power = -50 set_country_flag = ws_nat_upgrade_eng ws_apply_national_doctrine = yes } } }