#name is also used for loc #modifier_id = { # #description to use in tooltip # tooltip = "bla_bla" # # #gfx entry & frame for law entry icon. both frame and gfx name can be ommited # #gfx entry can be omitted, in that case it will default to GFX_occupation_modifier_strip # icon = "GFX_bla_bla:1" # #small icon will be used for progress bars (GFX_occupation_modifier_small_strip is default gfx) # icon_small = "GFX_bla_bla_small:1" # # type = state_resistance_modifier # #type = core_resistance_modifier # #type = state_compliance_modifier # #type = core_compliancemodifier # # #for state modifiers, the scope will be the state, FROM/root will be the occuppier and from from will be the occuppied country # #for core modifiers, the scope/root will be the occuppier and from will be the occuppied country # # #percentage threshold to enable # threshold = 35 # # #margin to disable the modifier back. it will be disabled if current value < threshold - margin. # margin = 2 # # #if visible is false, the modifier will not show up anywhere # visible = { # # } # # #if enabled is false, the modifier won't be enabled even if it passes threshold (and will be disabled if it was enabled before) # enabled = { # # } # # #the effect will be called when modifier is enabled # on_enable = { # # } # # #the effect will be called when modifier is disabled # on_disable = { # # } # # #will be added to state if modifier is enabled # state_modifier = { # # } #} resistance_25 = { type = state_resistance_modifier icon = "GFX_occupation_resistance_modifier_strip:1" small_icon = "GFX_occupation_resistance_modifier_small_strip:1" threshold = 25 margin = 2 state_modifier = { resistance_garrison_penetration_chance = 0.5 } } resistance_50 = { type = state_resistance_modifier icon = "GFX_occupation_resistance_modifier_strip:2" small_icon = "GFX_occupation_resistance_modifier_small_strip:2" threshold = 50 margin = 2 state_modifier = { resistance_damage_to_garrison = 1 } } resistance_75 = { type = state_resistance_modifier icon = "GFX_occupation_resistance_modifier_strip:3" small_icon = "GFX_occupation_resistance_modifier_small_strip:3" threshold = 75 margin = 2 state_modifier = { army_speed_factor_for_controller = -0.5 local_supplies_for_controller = -0.5 attrition_for_controller = 0.3 disable_strategic_redeployment_for_controller = 1 } } resistance_90 = { type = core_resistance_modifier icon = "GFX_occupation_resistance_modifier_strip:4" small_icon = "GFX_occupation_resistance_modifier_small_strip:4" threshold = 90 margin = 2 alert_level = high alert_margin = 20 state_modifier = { local_factories = -0.03 } on_enable = { custom_effect_tooltip = resistance_90_effect_tooltip hidden_effect = { set_temp_variable = { occupier_country = THIS } set_temp_variable = { occupied_country = FROM } set_temp_variable = { new_occupied_country = FROM } set_temp_variable = { civil_war_country_picked = 0 } if = { ## pick an existing civil war country limit = { FROM = { tag = PREV } } random_country_with_original_tag = { original_tag_to_check = var:occupier_country limit = { NOT = { tag = var:occupier_country } has_war_with = var:occupier_country } set_temp_variable = { civil_war_country_picked = 1 } set_temp_variable = { new_occupied_country = this } } } if = { ## create a new country if necesarry limit = { check_variable = { civil_war_country_picked = 0 } FROM = { #if resistance country exists and not at war with occupier (whitepaced/subjected etc) create a country instead exists = yes NOT = { has_war_with = occupier_country } } } create_dynamic_country = { original_tag = FROM copy_tag = FROM set_temp_variable = { new_occupied_country = THIS } } } # change ideology if necessary if = { limit = { var:occupied_country = { #only change ideology if we are not creating a new country and old country is not existing OR = { exists = no NOT = { tag = new_occupied_country } } } } # booleans that will be allowed to change ideology set_temp_variable = { allowed_party_neutrality = 1 } set_temp_variable = { allowed_party_democratic = 1 } set_temp_variable = { allowed_party_fascism = 1 } set_temp_variable = { allowed_party_communism = 1 } # do not change ideology of occupier country var:occupier_country = { remove_from_allowed_party = yes } if = { # if occupied country exists and different than new country # it is white peaced & subject of occupier. ignore its ideology as well limit = { NOT = { check_variable = { new_occupied_country = occupied_country } } } var:occupied_country = { remove_from_allowed_party = yes } } # change government if necesarry var:new_occupied_country = { if = { # check if our current ideology is OK limit = { OR = { AND = { has_government = democratic check_variable = { allowed_party_democratic = 0 } } AND = { has_government = fascism check_variable = { allowed_party_fascism = 0 } } AND = { has_government = communism check_variable = { allowed_party_communism = 0 } } AND = { has_government = neutrality check_variable = { allowed_party_neutrality = 0 } } } } random_list = { allowed_party_democratic = { set_popularities = { democratic = 100 } set_politics = { ruling_party = democratic elections_allowed = yes } } allowed_party_fascism = { set_popularities = { fascism = 100 } set_politics = { ruling_party = fascism elections_allowed = no } } allowed_party_communism = { set_popularities = { communism = 100 } set_politics = { ruling_party = communism elections_allowed = no } } allowed_party_neutrality = { set_popularities = { neutrality = 100 } set_politics = { ruling_party = neutrality elections_allowed = no } } } } } } # create resistance template for armies to spawn var:new_occupied_country = { if = { limit = { NOT = { has_country_flag = created_civil_war_template } } set_country_flag = created_civil_war_template division_template = { name = "Resistance" is_locked = yes regiments = { Militia_Bat = { x = 0 y = 0 } Militia_Bat = { x = 0 y = 1 } } } } } clear_temp_array = checked_neighbours every_controlled_state = { limit = { occupied_country_tag = occupied_country } # move our armies to back home teleport_armies = { limit = { OR = { is_ally_with = occupier_country has_military_access_to = occupier_country } } to_state_array = owned_controlled_states } # transfer state if = { limit = { has_resistance = yes } set_resistance = 0 } var:new_occupied_country = { transfer_state = PREV } if = { limit = { var:occupier_country = { check_variable = { resistance_already_inited@var:occupied_country = 0 } } } # create resistance units, number is relative to size of industry set_temp_variable = { num_units_to_create = building_level@arms_factory } add_to_temp_variable = { num_units_to_create = building_level@industrial_complex } multiply_temp_variable = { num_units_to_create = 0.33333 } add_to_temp_variable = { num_units_to_create = 2 } round_temp_variable = num_units_to_create clamp_temp_variable = { var = num_units_to_create min = 2 max = 6 } for_loop_effect = { end = num_units_to_create create_unit = { division = "division_template = \"Resistance\" start_experience_factor = 1 start_equipment_factor = 1" owner = new_occupied_country } } } # also check neighbouring core states of the occupier that are not captured yet # move our armies so they are not surrounded/create pockets every_neighbor_state = { limit = { is_owned_and_controlled_by = occupied_country is_core_of = occupied_country NOT = { is_in_array = { checked_neighbours = this } } } add_to_temp_array = { checked_neighbours = this } teleport_armies = { limit = { OR = { is_ally_with = occupier_country has_military_access_to = occupier_country } } to_state_array = owned_controlled_states } set_state_province_controller = { controller = occupied_country limit = { is_ally_with = occupier_country } } } } # create war if necesarry if = { limit = { NOT = { has_war_with = new_occupied_country } } declare_war_on = { target = new_occupied_country type = annex_everything } } var:occupier_country = { set_variable = { resistance_already_inited@var:occupied_country = 1 } } } } }