#Second Civil War
#Setup SOV
sov_setup_scw = {
    SOV = {
        country_lock_all_division_template = no
        division_template = {
            name = "Patrul'nyy Ttryad Militsii"
            is_locked = no
            division_names_group = SOV_CAV_01

            regiments = {
                cavalry = { x = 0 y = 0 }
                cavalry = { x = 0 y = 1 }
                cavalry = { x = 1 y = 0 }
                cavalry = { x = 1 y = 1 }
            }
            support = 	{
                military_police = { x = 0 y = 0 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        division_template = {
            name = "Vozdushno-Desantnaya Brigada"
            is_locked = no
            division_names_group = SOV_PAR_01

            regiments = {
                paratrooper = { x = 0 y = 0 }
                paratrooper = { x = 0 y = 1 }
            }
        }
        load_oob = "SOV_civil_war"
        remove_ideas = {
            SOV_Prepare_second_war
            SOV_Terrible_fate
            SOV_Army_disorganisation
        }
        add_ideas = {
            SOV_Supply_line
            SOV_Second_civil_war_idea_modifier
            SOV_Urals_secret
            SOV_Slow_industry
        }
        clr_country_flag = second_civil_war_mission
        if = {
            limit = {
                is_ai = yes
            }
            country_event = { id = russia2_russia.136 days = 1 }
        }
        else = {
            country_event = { id = russia2_ukraine.31 days = 1 }
        }
        country_event = { id = russia2_russia.227 days = 15 }
        set_country_flag = preparation_done_russian_civil_war_russia2
        set_country_flag = sov_enemy_second_civil_war_russia2
        set_cosmetic_tag = WMA
        dismantle_faction = yes
        create_faction = anti_communist_coalition
        remove_country_leader_role = {
            character = SOV_Joseph_stalin
            ideology = stalinism
        }
        add_country_leader_role = {
            character = SOV_Leon_trotsky
            promote_leader = yes
            country_leader = {
                desc = SOV_Leon_trotsky_desc
                ideology = leninism
                expire = "1965.1.1.1"
                traits = {
                    russia2_counter_revolutionist
                }
            }
        }
        set_party_name = {
            ideology = communism
            long_name = SOV_4th_international
            name = SOV_communist_trotsky
        }
        582 = {
            add_dynamic_modifier = {
                modifier = urals_secret
            }
        }
        573 = {
            add_dynamic_modifier = {
                modifier = urals_secret
            }
        }
        581 = {
            add_dynamic_modifier = {
                modifier = urals_secret
            }
        }
        add_corps_commander_role = {
            character = SOV_Pyotr_Nikolayevich_Krasnov
            traits = {
                trait_reckless
                infantry_officer
                trait_mountaineer
            }
            skill = 4
            attack_skill = 4
            defense_skill = 3
            planning_skill = 3
            logistics_skill = 3
        }
        add_corps_commander_role = {
            character = SOV_Popov_pyotr_kharitonovich
            traits = {
                cavalry_officer
            }
            skill = 2
            attack_skill = 2
            defense_skill = 3
            planning_skill = 3
            logistics_skill = 3
        }
        add_corps_commander_role = {
            character = SOV_Tolstov_vladimir_sergeevich
            traits = {
                cavalry_officer
            }
            skill = 2
            attack_skill = 3
            defense_skill = 1
            planning_skill = 2
            logistics_skill = 3
        }
        add_corps_commander_role = {
            character = SOV_Pisarev_pyotr_konstantinovich
            traits = {
                infantry_officer
            }
            skill = 2
            attack_skill = 2
            defense_skill = 1
            planning_skill = 2
            logistics_skill = 2
        }
        add_corps_commander_role = {
            character = SOV_Pavel_bermondt_avalov
            traits = {
                infantry_officer
            }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 3
        }
        add_corps_commander_role = {
            character = SOV_Abram_dragomirov
            traits = {
                cavalry_officer
            }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 2
        }
        add_corps_commander_role = {
            character = SOV_Mikhail_diterikhs

            skill = 2
            attack_skill = 2
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 2
            legacy_id = 511
        }
        add_corps_commander_role = {
            character = SOV_Alexander_golubintzev
            traits = {
                cavalry_officer
            }
            skill = 4
            attack_skill = 3
            defense_skill = 2
            planning_skill = 1
            logistics_skill = 4
        }
        add_corps_commander_role = {
            character = SOV_Vladimir_kislitsin
            traits = {
                brilliant_strategist
            }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 3
        }
        add_corps_commander_role = {
            character = SOV_Viktorin_molchanov
            traits = {
                winter_specialist
                inflexible_strategist
            }
            skill = 4
            attack_skill = 3
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 2
            legacy_id = 517
        }
        add_corps_commander_role = {
            character = SOV_Grigory_mikhaylovich_semyonov
            traits = {
                harsh_leader
            }
            skill = 3
            attack_skill = 3
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 1
        }
        add_corps_commander_role = {
            character = SOV_Andrei_shkuro
            traits = {
                brilliant_strategist
                trickster
            }
            skill = 3
            attack_skill = 3
            defense_skill = 1
            planning_skill = 2
            logistics_skill = 2
            legacy_id = 518
        }
        add_corps_commander_role = {
            character = SOV_boris_shteifon_RR
            traits = {
                war_hero
                trickster
            }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 2
        }
        add_corps_commander_role = {
            character = SOV_Vladimir_sidorin
            traits = {
                trait_reckless
            }
            skill = 2
            attack_skill = 2
            defense_skill = 3
            planning_skill = 1
            logistics_skill = 1
        }
        add_corps_commander_role = {
            character = SOV_Mikhail_skorodumov
            traits = {
                trait_reckless
                bearer_of_artillery
            }
            skill = 3
            attack_skill = 4
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 1
        }
        add_corps_commander_role = {
            character = SOV_Konstantin_petrovich_nechaev
            traits = {
                cavalry_officer
                inflexible_strategist
            }
            skill = 3
            attack_skill = 4
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 2
        }
        add_corps_commander_role = {
            character = SOV_Mikhail_pleshkov
            traits = {
                cavalry_officer
            }
            skill = 2
            attack_skill = 3
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 1
        }
        add_corps_commander_role = {
            character = SOV_Anton_turkul
            traits = {
                infantry_officer
            }
            skill = 3
            attack_skill = 2
            defense_skill = 2
            planning_skill = 1
            logistics_skill = 2
        }
        add_corps_commander_role = {
            character = SOV_Isaac_bykadorov
            traits = {
                war_hero
                trait_reckless
            }
            skill = 3
            attack_skill = 3
            defense_skill = 1
            planning_skill = 1
            logistics_skill = 2
        }
        add_corps_commander_role = {
            character = SOV_Vyacheslav_naumenko
            traits = {
                war_hero
            }
            skill = 2
            attack_skill = 3
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 3
        }
        add_corps_commander_role = {
            character = SOV_Fedor_abramov
            traits = {
                cavalry_officer
                bearer_of_artillery
            }
            skill = 3
            attack_skill = 2
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 2
        }
        add_corps_commander_role = {
            character = SOV_bronislav_kaminski
            traits = {
                harsh_leader
            }
            skill = 2
            attack_skill = 2
            defense_skill = 1
            planning_skill = 2
            logistics_skill = 2
        }
        add_corps_commander_role = {
            character = SOV_Vladimir_marushevsky
            traits = {
                infantry_officer
            }
            skill = 2
            attack_skill = 2
            defense_skill = 1
            planning_skill = 1
            logistics_skill = 2
        }
        add_corps_commander_role = {
            character = SOV_Vladimir_kharzhevsky
            skill = 2
            attack_skill = 1
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 2
        }
        add_corps_commander_role = {
            character = SOV_Pavel_shatilov
            traits = {
                cavalry_officer
            }
            skill = 4
            attack_skill = 3
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 2
        }
        add_corps_commander_role = {
            character = SOV_Pyotr_vladimirovich_glazenap
            traits = {
                cavalry_officer
            }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            planning_skill = 1
            logistics_skill = 2
        }
        add_corps_commander_role = {
            character = SOV_Alexander_lukomsky
            traits = {
                trait_engineer
            }
            skill = 3
            attack_skill = 2
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 3
        }
        add_field_marshal_role = {
            character = SOV_Yevgeny_miller
            traits = {
                infantry_leader
                brilliant_strategist
                organisational_leader
            }
            skill = 3
            attack_skill = 3
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 2
        }
        add_field_marshal_role = {
            character = SOV_Anton_ivanovich_denikin
            traits = {
                infantry_leader
                bearer_of_artillery
                offensive_doctrine
            }
            skill = 5
            attack_skill = 4
            defense_skill = 3
            planning_skill = 4
            logistics_skill = 3
            legacy_id = 514
        }
        add_field_marshal_role = {
            character = SOV_Alexander_rodzyanko
            traits = {
                inspirational_leader
                cavalry_officer
            }
            skill = 2
            attack_skill = 2
            defense_skill = 2
            planning_skill = 4
            logistics_skill = 2
            legacy_id = 512
        }
        set_politics = {
            ruling_party = neutrality
        }
        set_popularities = {
            democratic = 33
            neutrality = 33
            fascism = 33
            communism = 1
        }
        add_country_leader_role = {
            character = SOV_Anton_ivanovich_denikin
            promote_leader = yes
            country_leader = {
                desc = SOV_Anton_ivanovich_denikin_desc
                ideology = oligarchism
                expire = "1965.1.1.1"
                traits = {
                    russia2_war_veteran
                }
            }
        }
        add_ideas = war_economy
        add_ideas = extensive_conscription
        if = {
            limit = {
                has_war_support < 0.5
            }
            set_war_support = 0.5
        }
    }
}

#Setup SOJ
sov_spawn_soj_scw = {
    every_state = {
        limit = {
            is_core_of = SOV
            is_owned_by = SOV
            NOT = {
                state = 408
                state = 409
                state = 560
                state = 655
                state = 537
                state = 657
                state = 561
                state = 574
                state = 562
                state = 637
                state = 644
                state = 563
                state = 565
                state = 564
                state = 575
                state = 516
                state = 566
                state = 567
                state = 576
                state = 568
                state = 569
                state = 578
                state = 570
                state = 577
                state = 571
                state = 654
                state = 40
                state = 588
                state = 589
                state = 822
                state = 824
                state = 882
                state = 878
                state = 876
                state = 877
                state = 874
                state = 875
            }
        }
        SOJ = {
            add_state_core = PREV
            transfer_state = PREV
        }
    }
    every_state = {
        limit = {
            is_core_of = UKR
            is_owned_by = UKR
        }
        SOJ = {
            add_state_core = PREV
        }
    }
    if = {
        limit = {
            SOV = {
                has_country_flag = control_caucasus
            }
        }
        every_state = {
            limit = {
                is_owned_by = SOJ
                OR = {
                    state = 233
                    state = 232
                    state = 235
                    state = 234
                    state = 827
                    state = 828
                    state = 821
                }
            }
            SOV = {
                transfer_state = PREV
            }
        }
    }
    SOV = {
        every_character = {
            limit = {
                OR = {
                    is_character = SOV_Georgy_zhukov
                    is_character = SOV_Aleksandr_vasilevsky
                    is_character = SOV_Boris_shaposhnikov
                    is_character = SOV_Nikolai_vatutin
                    is_character = SOV_Ivan_konev
                    is_character = SOV_Semyon_timoshenko
                    is_character = SOV_Kliment_voroshilov_military
                    is_character = SOV_Kliment_voroshilov_advisor
                    is_character = SOV_Mikhail_tukhachevsky
                    is_character = SOV_Semyon_budyonny
                    is_character = SOV_Ivan_chernyakhovsky
                    is_character = SOV_Issa_pliyev
                    is_character = SOV_Leonid_govorov
                    is_character = SOV_Grigory_kulik
                    is_character = SOV_Kirill_meretskov
                    is_character = SOV_Filipp_golikov
                    is_character = SOV_Andrey_yeryomenko
                    is_character = SOV_Georgiy_zakharov
                    is_character = SOV_Yakov_cherevichenko
                    is_character = SOV_Nikandr_chibisov
                    is_character = SOV_Vasily_kuznetsov
                    is_character = SOV_Ivan_fedyuninsky
                    is_character = SOV_Maksim_purkayev
                    is_character = SOV_Kuzma_galitsky
                    is_character = SOV_Markian_popov
                    is_character = SOV_Nikolai_berzarin
                    is_character = SOV_Kirill_moskalenko
                    is_character = SOV_Dmitry_lelyushenko
                    is_character = SOV_Andrei_grechko
                    is_character = SOV_Rodion_malinovsky
                    is_character = SOV_Vasily_chuikov
                    is_character = SOV_Vasily_blyukher
                    is_character = SOV_Alexander_yegorov
                    is_character = SOV_Maks_reyter
                }
            }
            set_character_flag = sov_character_switched_to_sou
            set_nationality = SOJ
        }
    }
    SOJ = {
        create_faction = sov_comintern_faction
        if = {
            limit = { has_dlc = "By Blood Alone" }
            load_oob = "SOJ_civil_war_BBA"
        }
        else = {
            load_oob = "SOJ_civil_war_legacy"
        }
        if = {
            limit = {
                NOT = {
                    has_dlc = "No Step Back"
                }
            }
            load_oob = "SOJ_civil_war"
        }
        else_if = {
            limit = {
                has_dlc = "No Step Back"
            }
            load_oob = "SOJ_civil_war_nsb"
        }
        inherit_technology = SOV
        country_event = { id = russia2_russia.186 days = 1 }
        add_ideas = {
            SOV_Second_civil_war_idea_modifier
            SOV_Urals_secret
            SOV_Supply_line
            SOV_Slow_industry
        }
        unlock_national_focus = SOV_great_purge2
        add_ideas = war_economy
        add_ideas = extensive_conscription
    }
}

#Setup CRI
sov_spawn_cri_scw = {
    CRI = {
        if = {
            limit = {
                137 = {
                    NOT = {
                        is_core_of = CRI
                    }
                }
            }
            add_state_core = 137
        }
        transfer_state = 137
        set_politics = {
            ruling_party = democratic
            elections_allowed = no
        }
        add_ideas = CRI_Neutral_zone
        division_template = {
            name = "Crimean Infantry"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 2 y = 0 }
                infantry = { x = 2 y = 1 }
                infantry = { x = 2 y = 2 }
            }
            support = {
                artillery = { x = 0 y = 0 }
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"1st Crimean Infantry\" division_template = \"Crimean Infantry\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = CRI
            }
            create_unit = {
                division = "name = \"2nd Crimean Infantry\" division_template = \"Crimean Infantry\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = CRI
            }
            create_unit = {
                division = "name = \"3rd Crimean Infantry\" division_template = \"Crimean Infantry\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = CRI
            }
            create_unit = {
                division = "name = \"4th Crimean Infantry\" division_template = \"Crimean Infantry\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = CRI
            }
        }
    }
}

#Setup UKR
sov_spawn_ukr_scw = {
    every_state = {
        limit = {
            OR = {
                is_owned_by = SOV
                is_owned_by = SOJ
            }
            is_core_of = UKR
        }
        UKR = {
            transfer_state = PREV
        }
    }
    UKR = {
        add_equipment_to_stockpile = {
            type = motorized_equipment_1
            amount = 200
            producer = UKR
        }
        add_equipment_to_stockpile = {
            type = fighter_equipment_0
            amount = 100
            producer = UKR
        }
        add_equipment_to_stockpile = {
            type = infantry_equipment_0
            amount = 1000
            producer = UKR
        }
        add_equipment_to_stockpile = {
            type = support_equipment_1
            amount = 100
            producer = UKR
        }
        add_equipment_to_stockpile = {
            type = artillery_equipment_1
            amount = 100
            producer = UKR
        }
        division_template = {
            name = "Patrul'nyy Triad Militsiyi"
            is_locked = no
            division_names_group = UKR_CAV_01

            regiments = {
                cavalry = { x = 0 y = 0 }
                cavalry = { x = 0 y = 1 }
                cavalry = { x = 1 y = 0 }
                cavalry = { x = 1 y = 1 }
            }
            support = 	{
                military_police = { x = 0 y = 0 }
            }
        }
        if = {
            limit = {
                is_subject = yes
            }
            OVERLORD = {
                set_autonomy = {
                    target = UKR
                    autonomy_state = autonomy_free
                }
            }
        }
        if = {
            limit = {
                is_in_faction = yes
            }
            leave_faction = yes
        }
        set_politics = {
            ruling_party = neutrality
        }
        add_ideas = UKR_Provisional_government
        set_country_flag = ukr_anarchist_rebels
        country_event = { id = russia2_ukraine.91 days = 5 }
        #Balancing
        random_owned_state = {
            add_extra_state_shared_building_slots = 3
            add_building_construction = {
                type = arms_factory
                level = 3
                instant_build = yes
            }
        }
        country_lock_all_division_template = no
        division_template = {
            name = "Ukrayins'ka Dyviziya"
            division_names_group = UKR_INF_01
            priority = 1
            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 0 y = 4 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
            }
            support = {
                engineer = { x = 0 y = 0 }
                artillery = { x = 0 y = 1 }
            }
        }
        division_template = {
            name = "Ukrayins'ka mekhanizovana Dyviziya"
            division_names_group = UKR_UKR_01
            priority = 1
            regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                light_armor = { x = 1 y = 2 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
                motorized = { x = 2 y = 3 }
            }
            support = {
                engineer = { x = 0 y = 0 }
            }
        }
        201 = {
            create_unit = {
                division = "name = \"1ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 9493
            }
            create_unit = {
                division = "name = \"2ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 11477
            }
            create_unit = {
                division = "name = \"3ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 9466
            }
        }
        202 = {
            create_unit = {
                division = "name = \"4ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 9568
            }
            create_unit = {
                division = "name = \"5ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 489
            }
            create_unit = {
                division = "name = \"6ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 9568
            }
            create_unit = {
                division = "name = \"7ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 489
            }
        }
        193 = {
            create_unit = {
                division = "name = \"8ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 3568
            }
            create_unit = {
                division = "name = \"9ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 546
            }
            create_unit = {
                division = "name = \"10ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 6589
            }
            create_unit = {
                division = "name = \"1st Guards Army\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 238
            }
        }
        225 = {
            create_unit = {
                division = "name = \"13ya Army\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 3225
            }
            create_unit = {
                division = "name = \"38ya Army\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 11553
            }
            create_unit = {
                division = "name = \"11ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 6565
            }
            create_unit = {
                division = "name = \"12ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 522
            }
            create_unit = {
                division = "name = \"13ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 3520
            }
            create_unit = {
                division = "name = \"14ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 501
            }
        }
        221 = {
            create_unit = {
                division = "name = \"15ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 11397
            }
            create_unit = {
                division = "name = \"16ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 418
            }
            create_unit = {
                division = "name = \"16ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 9556
            }
            create_unit = {
                division = "name = \"17ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 3409
            }
            create_unit = {
                division = "name = \"18ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 11541
            }
        }
        228 = {
            create_unit = {
                division = "name = \"19ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 570
            }
            create_unit = {
                division = "name = \"20ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 11513
            }
            create_unit = {
                division = "name = \"21ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 547
            }
            create_unit = {
                division = "name = \"22ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 9476
            }
            create_unit = {
                division = "name = \"23ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 9461
            }
            create_unit = {
                division = "name = \"24ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 9446
            }
        }
        227 = {
            create_unit = {
                division = "name = \"25ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 6493
            }
            create_unit = {
                division = "name = \"26ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 3421
            }
            create_unit = {
                division = "name = \"27ya Ukrayins'ka Dyviziya\" division_template = \"Ukrayins'ka Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
                prioritize_location = 6493
            }
        }
        203 = {
            create_unit = {
                division = "name = \"6ya mekhanizovana Dyviziya\" division_template = \"Ukrayins'ka mekhanizovana Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
            }
            create_unit = {
                division = "name = \"8ya mekhanizovana Dyviziya\" division_template = \"Ukrayins'ka mekhanizovana Dyviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
    }
}

#Liberate the Caucasus if the player has the Country Flag
sov_liberate_caucasus_scw = {
    if= {
        limit = {
            SOV = {
                has_country_flag = control_caucasus
            }
        }
        SOJ = {
            release = GEO
            release = AZR
            release = ARM
            add_state_core = 231
            add_state_core = 230
            add_state_core = 229
            add_state_core = 826
        }
        SOV = {
            set_autonomy = {
                target = GEO
                autonomy_state = autonomy_dominion
            }
        }
        SOV = {
            set_autonomy = {
                target = ARM
                autonomy_state = autonomy_dominion
            }
        }
        SOV = {
            set_autonomy = {
                target = AZR
                autonomy_state = autonomy_dominion
            }
        }
        GEO = {
            random_owned_state = {
                add_extra_state_shared_building_slots = 2
                add_building_construction = {
                    type = arms_factory
                    level = 2
                    instant_build = yes
                }
            }
            division_template = {
                name = "Georgian Imperial Division"
                priority = 1
                regiments = {
                    infantry = { x = 0 y = 0 }
                    infantry = { x = 0 y = 1 }
                    infantry = { x = 0 y = 2 }
                    infantry = { x = 0 y = 3 }
                }
            }
            set_division_template_lock = {
                division_template = "NKVD Pogranichnaya Diviziya"
                is_locked = no
            }
            capital_scope = {
                create_unit = {
                    division = "name = \"1st Georgian Imperial Division\" division_template = \"Georgian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = GEO
                }
                create_unit = {
                    division = "name = \"2nd Georgian Imperial Division\" division_template = \"Georgian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = GEO
                }
                create_unit = {
                    division = "name = \"3rd Georgian Imperial Division\" division_template = \"Georgian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = GEO
                }
                create_unit = {
                    division = "name = \"4th Georgian Imperial Division\" division_template = \"Georgian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = GEO
                }
                create_unit = {
                    division = "name = \"5th Georgian Imperial Division\" division_template = \"Georgian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = GEO
                }
                create_unit = {
                    division = "name = \"6th Georgian Imperial Division\" division_template = \"Georgian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = GEO
                }
            }
        }
        ARM = {
            random_owned_state = {
                add_extra_state_shared_building_slots = 2
                add_building_construction = {
                    type = arms_factory
                    level = 2
                    instant_build = yes
                }
            }
            division_template = {
                name = "Armenian Imperial Division"
                priority = 1
                regiments = {
                    infantry = { x = 0 y = 0 }
                    infantry = { x = 0 y = 1 }
                    infantry = { x = 0 y = 2 }
                    infantry = { x = 0 y = 3 }
                }
            }
            set_division_template_lock = {
                division_template = "NKVD Pogranichnaya Diviziya"
                is_locked = no
            }
            capital_scope = {
                create_unit = {
                    division = "name = \"1st Armenian Imperial Division\" division_template = \"Armenian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = ARM
                }
                create_unit = {
                    division = "name = \"2nd Armenian Imperial Division\" division_template = \"Armenian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = ARM
                }
                create_unit = {
                    division = "name = \"3rd Armenian Imperial Division\" division_template = \"Armenian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = ARM
                }
                create_unit = {
                    division = "name = \"4th Armenian Imperial Division\" division_template = \"Armenian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = ARM
                }
            }
        }
        AZR = {
            random_owned_state = {
                add_extra_state_shared_building_slots = 2
                add_building_construction = {
                    type = arms_factory
                    level = 2
                    instant_build = yes
                }
            }
            division_template = {
                name = "Azerbaijan Imperial Division"
                priority = 1
                regiments = {
                    infantry = { x = 0 y = 0 }
                    infantry = { x = 0 y = 1 }
                    infantry = { x = 0 y = 2 }
                    infantry = { x = 0 y = 3 }
                }
            }
            set_division_template_lock = {
                division_template = "NKVD Pogranichnaya Diviziya"
                is_locked = no
            }
            capital_scope = {
                create_unit = {
                    division = "name = \"1st Azerbaijan Imperial Division\" division_template = \"Azerbaijan Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = AZR
                }
                create_unit = {
                    division = "name = \"2nd Azerbaijan Imperial Division\" division_template = \"Azerbaijan Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = AZR
                }
                create_unit = {
                    division = "name = \"3rd Azerbaijan Imperial Division\" division_template = \"Azerbaijan Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = AZR
                }
                create_unit = {
                    division = "name = \"4th Azerbaijan Imperial Division\" division_template = \"Azerbaijan Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = AZR
                }
            }
        }
        SOV = {
            if = {
                limit = {
                    NOT = {
                        has_country_flag = train_caucasian_soldiers_civil_war
                    }
                }
                division_template = {
                    name = "Kavkazskaya kazach'ya diviziya"
                    priority = 1
                    regiments = {
                        infantry = { x = 0 y = 0 }
                        infantry = { x = 0 y = 1 }
                        infantry = { x = 0 y = 2 }
                        infantry = { x = 0 y = 3 }
                        infantry = { x = 0 y = 4 }
                    }
                }
                234 = {
                    create_unit = {
                        division = "name = \"1ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 6741
                    }
                    create_unit = {
                        division = "name = \"2ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 6783
                    }
                    create_unit = {
                        division = "name = \"3ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 765
                    }
                    create_unit = {
                        division = "name = \"4ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 9744
                    }
                    create_unit = {
                        division = "name = \"5ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 3765
                    }
                    create_unit = {
                        division = "name = \"6ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 6781
                    }
                    create_unit = {
                        division = "name = \"7ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 3734
                    }
                    create_unit = {
                        division = "name = \"8ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 3734
                    }
                }
                235 = {
                    create_unit = {
                        division = "name = \"9ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 9742
                    }
                    create_unit = {
                        division = "name = \"10ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 9688
                    }
                    create_unit = {
                        division = "name = \"11ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 3748
                    }
                    create_unit = {
                        division = "name = \"12ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 11694
                    }
                    create_unit = {
                        division = "name = \"13ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 9705
                    }
                    create_unit = {
                        division = "name = \"14ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 11693
                    }
                    create_unit = {
                        division = "name = \"15ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 11690
                    }
                    create_unit = {
                        division = "name = \"16ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 9707
                    }
                }
                232 = {
                    create_unit = {
                        division = "name = \"17ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 728
                    }
                    create_unit = {
                        division = "name = \"18ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 6748
                    }
                    create_unit = {
                        division = "name = \"19ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 6701
                    }
                }
            }
            else_if = {
                limit = {
                    has_country_flag = train_caucasian_soldiers_civil_war
                }
                division_template = {
                    name = "Opytnyy Kavkazskaya kazach'ya diviziya"
                    priority = 1
                    regiments = {
                        infantry = { x = 0 y = 0 }
                        infantry = { x = 0 y = 1 }
                        infantry = { x = 0 y = 2 }
                        infantry = { x = 0 y = 3 }
                        infantry = { x = 0 y = 4 }
                        infantry = { x = 1 y = 0 }
                        infantry = { x = 1 y = 1 }
                    }
                    support = {
                        engineer = { x = 0 y = 0 }
                        recon = { x = 0 y = 1 }
                    }
                }
                division_template = {
                    name = "Kavkazskaya kazach'ya diviziya"
                    priority = 1
                    regiments = {
                        cavalry = { x = 0 y = 0 }
                        cavalry = { x = 0 y = 1 }
                        cavalry = { x = 0 y = 2 }
                        cavalry = { x = 0 y = 3 }
                    }
                }
                234 = {
                    create_unit = {
                        division = "name = \"1ya Opytnyy Kavkazskaya kazach'ya diviziya\" division_template = \"Opytnyy Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 6741
                    }
                    create_unit = {
                        division = "name = \"2ya Opytnyy Kavkazskaya kazach'ya diviziya\" division_template = \"Opytnyy Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 6783
                    }
                    create_unit = {
                        division = "name = \"3ya Opytnyy Kavkazskaya kazach'ya diviziya\" division_template = \"Opytnyy Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 765
                    }
                    create_unit = {
                        division = "name = \"4ya Opytnyy Kavkazskaya kazach'ya diviziya\" division_template = \"Opytnyy Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 9744
                    }
                    create_unit = {
                        division = "name = \"5ya Opytnyy Kavkazskaya kazach'ya diviziya\" division_template = \"Opytnyy Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 3765
                    }
                    create_unit = {
                        division = "name = \"6ya Opytnyy Kavkazskaya kazach'ya diviziya\" division_template = \"Opytnyy Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 6781
                    }
                    create_unit = {
                        division = "name = \"7ya Opytnyy Kavkazskaya kazach'ya diviziya\" division_template = \"Opytnyy Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 3734
                    }
                    create_unit = {
                        division = "name = \"8ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 3734
                    }
                }
                235 = {
                    create_unit = {
                        division = "name = \"9ya Opytnyy Kavkazskaya kazach'ya diviziya\" division_template = \"Opytnyy Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 9742
                    }
                    create_unit = {
                        division = "name = \"10ya Opytnyy Kavkazskaya kazach'ya diviziya\" division_template = \"Opytnyy Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 9688
                    }
                    create_unit = {
                        division = "name = \"11ya Opytnyy Kavkazskaya kazach'ya diviziya\" division_template = \"Opytnyy Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 748
                    }
                    create_unit = {
                        division = "name = \"12ya Opytnyy Kavkazskaya kazach'ya diviziya\" division_template = \"Opytnyy Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 3748
                    }
                    create_unit = {
                        division = "name = \"13ya Opytnyy Kavkazskaya kazach'ya diviziya\" division_template = \"Opytnyy Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 9705
                    }
                    create_unit = {
                        division = "name = \"14ya Opytnyy Kavkazskaya kazach'ya diviziya\" division_template = \"Opytnyy Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 11693
                    }
                    create_unit = {
                        division = "name = \"15ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 11690
                    }
                    create_unit = {
                        division = "name = \"16ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 11694
                    }
                }
                232 = {
                    create_unit = {
                        division = "name = \"17ya Opytnyy Kavkazskaya kazach'ya diviziya\" division_template = \"Opytnyy Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 728
                    }
                    create_unit = {
                        division = "name = \"18ya Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 6748
                    }
                    create_unit = {
                        division = "name = \"19th Kavkazskaya kazach'ya diviziya\" division_template = \"Kavkazskaya kazach'ya diviziya\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                        owner = SOV
                        prioritize_location = 6701
                    }
                }
            }
        }
    }
    else_if = {
        limit = {
            SOV = {
                NOT = {
                    has_country_flag = control_caucasus
                }
            }
            OR = {
                country_exists = GEO
                country_exists = AZR
                country_exists = ARM
            }
        }
        SOJ = {
            annex_country = {
                target = ARM
                transfer_troops = no
            }
            annex_country = {
                target = GEO
                transfer_troops = no
            }
            annex_country = {
                target = AZR
                transfer_troops = no
            }
            add_state_core = 231
            add_state_core = 230
            add_state_core = 229
            add_state_core = 826
        }
    }
}

#Liberate Central Asia If the Player Has the Country Flag
sov_liberate_central_asia_scw = {
    if= {
        limit = {
            SOV = {
                has_country_flag = control_central_asia
            }
        }
        SOJ = {
            release = KAZ
            release = TMS
            transfer_state = 407
            transfer_state = 406
            add_state_core = 407
            add_state_core = 406
            add_state_core = 402
            add_state_core = 587
            add_state_core = 583
            add_state_core = 404
            add_state_core = 590
            add_state_core = 586
            add_state_core = 732
            add_state_core = 742
            add_state_core = 405
            add_state_core = 585
            add_state_core = 584
            add_state_core = 823
            add_state_core = 831
            add_state_core = 830
        }
        SOV = {
            set_autonomy = {
                target = KAZ
                autonomy_state = autonomy_dominion
            }
            set_autonomy = {
                target = TMS
                autonomy_state = autonomy_dominion
            }
        }
        TMS = {
            transfer_state = 585
            transfer_state = 405
            transfer_state = 742
            transfer_state = 732
            transfer_state = 823
            transfer_state = 831
            transfer_state = 830
            add_state_core = 585
            add_state_core = 405
            add_state_core = 742
            add_state_core = 732
            add_state_core = 823
            add_state_core = 831
            add_state_core = 830
        }
        KAZ = {
            build_railway = {
                level = 1
                build_only_on_allied = yes
                controller_priority = {
                  base = 1
                }
                fallback = yes
                start_province  = 7243
                target_province = 12679
            }
            random_owned_state = {
                add_extra_state_shared_building_slots = 3
                add_building_construction = {
                    type = arms_factory
                    level = 3
                    instant_build = yes
                }
            }
            division_template = {
                name = "Kazakh Imperial Division"
                priority = 1
                regiments = {
                    infantry = { x = 0 y = 0 }
                    infantry = { x = 0 y = 1 }
                    infantry = { x = 0 y = 2 }
                    infantry = { x = 0 y = 3 }
                    infantry = { x = 0 y = 4 }
                    infantry = { x = 1 y = 0 }
                }
                support = {
                    engineer = { x = 0 y = 0 }
                }
            }
            set_division_template_lock = {
                division_template = "NKVD Pogranichnaya Diviziya"
                is_locked = no
            }
            capital_scope = {
                create_unit = {
                    division = "name = \"1st Kazakh Imperial Division\" division_template = \"Kazakh Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = KAZ
                }
                create_unit = {
                    division = "name = \"2nd Kazakh Imperial Division\" division_template = \"Kazakh Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = KAZ
                }
                create_unit = {
                    division = "name = \"3rd Kazakh Imperial Division\" division_template = \"Kazakh Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = KAZ
                }
                create_unit = {
                    division = "name = \"4th Kazakh Imperial Division\" division_template = \"Kazakh Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = KAZ
                }
                create_unit = {
                    division = "name = \"5th Kazakh Imperial Division\" division_template = \"Kazakh Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = KAZ
                }
                create_unit = {
                    division = "name = \"6th Kazakh Imperial Division\" division_template = \"Kazakh Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = KAZ
                }
                create_unit = {
                    division = "name = \"7th Kazakh Imperial Division\" division_template = \"Kazakh Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = KAZ
                }
                create_unit = {
                    division = "name = \"8th Kazakh Imperial Division\" division_template = \"Kazakh Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = KAZ
                }
                create_unit = {
                    division = "name = \"9th Kazakh Imperial Division\" division_template = \"Kazakh Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = KAZ
                }
                create_unit = {
                    division = "name = \"10th Kazakh Imperial Division\" division_template = \"Kazakh Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = KAZ
                }
            }
        }
        TMS = {
            random_owned_state = {
                add_extra_state_shared_building_slots = 2
                add_building_construction = {
                    type = arms_factory
                    level = 2
                    instant_build = yes
                }
            }
            random_owned_state = {
                add_extra_state_shared_building_slots = 2
                add_building_construction = {
                    type = industrial_complex
                    level = 2
                    instant_build = yes
                }
            }
            division_template = {
                name = "Turkmenistan Imperial Division"
                priority = 1
                regiments = {
                    infantry = { x = 0 y = 0 }
                    infantry = { x = 0 y = 1 }
                    infantry = { x = 0 y = 2 }
                    infantry = { x = 0 y = 3 }
                    infantry = { x = 0 y = 4 }
                }
            }
            set_division_template_lock = {
                division_template = "NKVD Pogranichnaya Diviziya"
                is_locked = no
            }
            capital_scope = {
                create_unit = {
                    division = "name = \"1st Turkmenistan Imperial Division\" division_template = \"Turkmenistan Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = TMS
                }
                create_unit = {
                    division = "name = \"2nd Turkmenistan Imperial Division\" division_template = \"Turkmenistan Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = TMS
                }
                create_unit = {
                    division = "name = \"3rd Turkmenistan Imperial Division\" division_template = \"Turkmenistan Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = TMS
                }
                create_unit = {
                    division = "name = \"4th Turkmenistan Imperial Division\" division_template = \"Turkmenistan Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = TMS
                }
                create_unit = {
                    division = "name = \"5th Turkmenistan Imperial Division\" division_template = \"Turkmenistan Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = TMS
                }
                create_unit = {
                    division = "name = \"6th Turkmenistan Imperial Division\" division_template = \"Turkmenistan Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = TMS
                }
                create_unit = {
                    division = "name = \"7th Turkmenistan Imperial Division\" division_template = \"Turkmenistan Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = TMS
                }
                create_unit = {
                    division = "name = \"8th Turkmenistan Imperial Division\" division_template = \"Turkmenistan Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = TMS
                }
            }
        }
    }
    else_if = {
        limit = {
            SOV = {
                NOT = {
                    has_country_flag = control_central_asia
                }
            }
            OR = {
                country_exists = KAZ
                country_exists = TMS
                country_exists = UZB
                country_exists = TAJ
                country_exists = KYR
            }
        }
        SOJ = {
            annex_country = {
                target = KAZ
                transfer_troops = no
            }
            annex_country = {
                target = TMS
                transfer_troops = no
            }
            annex_country = {
                target = UZB
                transfer_troops = no
            }
            annex_country = {
                target = TAJ
                transfer_troops = no
            }
            annex_country = {
                target = KYR
                transfer_troops = no
            }
            transfer_state = 407
            transfer_state = 406
            add_state_core = 407
            add_state_core = 406
            add_state_core = 402
            add_state_core = 587
            add_state_core = 583
            add_state_core = 404
            add_state_core = 590
            add_state_core = 586
            add_state_core = 732
            add_state_core = 742
            add_state_core = 405
            add_state_core = 585
            add_state_core = 584
            add_state_core = 823
            add_state_core = 831
            add_state_core = 830
        }
    }
}

#Liberate Belarus If the Player Has the Country Flag
sov_liberate_belarus_scw = {
    if= {
        limit = {
            SOV = {
                has_country_flag = control_belarus
            }
        }
        SOJ = {
            release = BLR
            add_state_core = 207
            add_state_core = 206
            add_state_core = 241
            add_state_core = 204
            add_state_core = 194
        }
        SOV = {
            set_autonomy = {
                target = BLR
                autonomy_state = autonomy_dominion
            }
        }
        BLR = {
            random_owned_state = {
                add_extra_state_shared_building_slots = 3
                add_building_construction = {
                    type = arms_factory
                    level = 3
                    instant_build = yes
                }
            }
            division_template = {
                name = "Belarusian Imperial Division"
                priority = 1
                regiments = {
                    infantry = { x = 0 y = 0 }
                    infantry = { x = 0 y = 1 }
                    infantry = { x = 0 y = 2 }
                    infantry = { x = 0 y = 3 }
                }
            }
            set_division_template_lock = {
                division_template = "NKVD Pogranichnaya Diviziya"
                is_locked = no
            }
            capital_scope = {
                create_unit = {
                    division = "name = \"1st Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"2nd Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"3rd Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"4th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"5th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"6th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"7th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"8th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"9th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"10th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"11th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"12th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 1.0"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"13th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 0.9"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"14th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 0.8"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"15th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 0.8"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"16th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 0.7"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"17th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 0.7"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"18th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 0.6"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"19th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 0.4"
                    owner = BLR
                }
                create_unit = {
                    division = "name = \"20th Belarusian Imperial Division\" division_template = \"Belarusian Imperial Division\" start_experience_factor = 0.4 start_equipment_factor = 0.4"
                    owner = BLR
                }
            }
        }
    }
    else_if = {
        limit = {
            SOV = {
                NOT = {
                    has_country_flag = control_belarus
                }
            }
            country_exists = BLR
        }
        SOJ = {
            annex_country = {
                target = BLR
                transfer_troops = no
            }
            add_state_core = 207
            add_state_core = 206
            add_state_core = 241
            add_state_core = 204
            add_state_core = 194
        }
    }
}

#Spawn Elite Division if the Player Has the Country Flag
sov_spawn_elite_divisions_scw = {
    if= {
        limit = {
            SOV = {
                has_country_flag = train_elite_soldiers_civil_war
            }
        }
        SOV = {
            division_template = {
                name = "gvardeyskaya pekhotnaya diviziya"
                priority = 1
                regiments = {
                    infantry = { x = 0 y = 0 }
                    infantry = { x = 0 y = 1 }
                    infantry = { x = 0 y = 2 }
                    infantry = { x = 0 y = 3 }
                    infantry = { x = 0 y = 4 }
                    infantry = { x = 1 y = 0 }
                    infantry = { x = 1 y = 1 }
                    infantry = { x = 1 y = 2 }
                    infantry = { x = 1 y = 3 }
                    infantry = { x = 1 y = 4 }
                    artillery_brigade = { x = 2 y = 0 }
                }
                support = {
                    engineer = { x = 0 y = 0 }
                    recon = { x = 0 y = 1 }
                    artillery = { x = 0 y = 2 }
                }
            }
            division_template = {
                name = "Gvardeyskaya kavaleriyskaya diviziya"
                priority = 1
                regiments = {
                    cavalry = { x = 0 y = 0 }
                    cavalry = { x = 0 y = 1 }
                    cavalry = { x = 0 y = 2 }
                    cavalry = { x = 0 y = 3 }
                    cavalry = { x = 0 y = 4 }
                    cavalry = { x = 1 y = 0 }
                }
                support = {
                    engineer = { x = 0 y = 0 }
                    recon = { x = 0 y = 1 }
                    artillery = { x = 0 y = 2 }
                }
            }
            570 = {
                create_unit = {
                    division = "name = \"1ya Gvardeyskaya Pekhotnaya Diviziya\" division_template = \"gvardeyskaya pekhotnaya diviziya\" start_experience_factor = 0.8 start_equipment_factor = 1.0"
                    owner = SOV
                }
                create_unit = {
                    division = "name = \"2ya Gvardeyskaya Pekhotnaya Diviziya\" division_template = \"gvardeyskaya pekhotnaya diviziya\" start_experience_factor = 0.8 start_equipment_factor = 1.0"
                    owner = SOV
                }
                create_unit = {
                    division = "name = \"3ya Gvardeyskaya Pekhotnaya Diviziya\" division_template = \"gvardeyskaya pekhotnaya diviziya\" start_experience_factor = 0.8 start_equipment_factor = 1.0"
                    owner = SOV
                }
                create_unit = {
                    division = "name = \"1ya Gvardeyskaya Kavaleriyskaya Diviziya\" division_template = \"Gvardeyskaya kavaleriyskaya diviziya\" start_experience_factor = 0.8 start_equipment_factor = 1.0"
                    owner = SOV
                }
                create_unit = {
                    division = "name = \"2ya Gvardeyskaya Kavaleriyskaya Diviziya\" division_template = \"Gvardeyskaya kavaleriyskaya diviziya\" start_experience_factor = 0.8 start_equipment_factor = 1.0"
                    owner = SOV
                }
            }
        }
    }
}

#Transfer Navy
sov_transfer_navy_scw = {
    transfer_ship = {
        prefer_name = "Marat"
        type = battleship
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Oktyabrskaya Revolutsiya"
        type = battleship
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Engels"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Artyom"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Volodarskiy"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Yakov Sverdlov"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Frunze"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Lenin"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Voykov"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Rykov"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Karl Libknekht"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-301"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-302"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-303"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-304"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-305"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-306"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-307"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-308"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-113"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-114"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-115"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-116"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-117"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-118"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-119"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-120"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-201"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-202"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-203"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-204"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shch-309"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Stalin"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "L-1"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "L-2"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "L-3"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "D-1"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "D-2"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "D-3"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "D-4"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "D-5"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "D-6"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Marti"
        type = light_cruiser
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "B-2"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "L-55"
        type = submarine
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Dzerzhinskiy"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Nezamozhnik"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Petrovskiy"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Shaumyan"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Izyaslav"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Kalinin"
        type = destroyer
        target = SOJ
    }
    transfer_ship = {
        prefer_name = "Parizhskaya Kommuna"
        type = battleship
        target = CRI
    }
    transfer_ship = {
        prefer_name = "Krasni Kavkaz"
        type = light_cruiser
        target = CRI
    }
    transfer_ship = {
        prefer_name = "Krasny Krym"
        type = light_cruiser
        target = CRI
    }
    transfer_ship = {
        prefer_name = "Chervona Ukraina"
        type = light_cruiser
        target = CRI
    }
    transfer_ship = {
        prefer_name = "Komintern"
        type = light_cruiser
        target = CRI
    }
    transfer_ship = {
        prefer_name = "Bug"
        type = destroyer
        target = CRI
    }
    transfer_ship = {
        prefer_name = "Shch-121"
        type = submarine
        target = CRI
    }
    transfer_ship = {
        prefer_name = "Shch-122"
        type = submarine
        target = CRI
    }
    transfer_ship = {
        prefer_name = "Shch-123"
        type = submarine
        target = CRI
    }
    transfer_ship = {
        prefer_name = "Shch-124"
        type = submarine
        target = CRI
    }
    transfer_ship = {
        prefer_name = "Shch-125"
        type = submarine
        target = CRI
    }
    transfer_ship = {
        prefer_name = "Shch-205"
        type = submarine
        target = CRI
    }
    transfer_ship = {
        prefer_name = "A-1"
        type = submarine
        target = CRI
    }
    transfer_ship = {
        prefer_name = "A-2"
        type = submarine
        target = CRI
    }
    transfer_ship = {
        prefer_name = "A-3"
        type = submarine
        target = CRI
    }
    transfer_ship = {
        prefer_name = "A-4"
        type = submarine
        target = CRI
    }
    transfer_ship = {
        prefer_name = "A-5"
        type = submarine
        target = CRI
    }
    transfer_ship = {
        prefer_name = "L-4"
        type = submarine
        target = CRI
    }
    transfer_ship = {
        prefer_name = "L-5"
        type = submarine
        target = CRI
    }
    transfer_ship = {
        prefer_name = "L-6"
        type = submarine
        target = CRI
    }
}

#Rebalance Industry - Civil War
sov_rebalance_industry_scw = {
    set_temp_variable = { balance_civs_count = 0 }
    while_loop_effect = {
        limit = {
            check_variable = {
                var = balance_civs_count
                value = 8
                compare = less_than
            }
        }
        random_owned_state = {
            limit = {
                NOT = {
                    state = 194
                    state = 204
                    state = 241
                    state = 206
                    state = 207
                    state = 201
                    state = 199
                    state = 198
                    state = 192
                    state = 197
                    state = 196
                    state = 200
                    state = 227
                    state = 228
                    state = 221
                    state = 226
                    state = 203
                    state = 259
                    state = 225
                    state = 193
                    state = 202
                    state = 137
                    state = 231
                    state = 230
                    state = 229
                    state = 590
                    state = 583
                    state = 402
                    state = 587
                    state = 404
                    state = 586
                    state = 589
                    state = 732
                    state = 742
                    state = 405
                    state = 585
                    state = 584
                }
                industrial_complex > 0
                original_white_province_second_civil_war = no
            }
            remove_building = {
                type = industrial_complex
                level = 1
            }
        }
        random_owned_state = {
            limit = {
                original_white_province_second_civil_war = yes
            }
            add_extra_state_shared_building_slots = 1
            add_building_construction = {
                type = industrial_complex
                level = 1
                instant_build = yes
            }
        }
        add_to_temp_variable = { balance_civs_count = 1 }
    }
    set_temp_variable = { balance_mils_count = 0 }
    while_loop_effect = {
        limit = {
            check_variable = {
                var = balance_mils_count
                value = 5
                compare = less_than
            }
        }
        random_owned_state = {
            limit = {
                NOT = {
                    state = 194
                    state = 204
                    state = 241
                    state = 206
                    state = 207
                    state = 201
                    state = 199
                    state = 198
                    state = 192
                    state = 197
                    state = 196
                    state = 200
                    state = 227
                    state = 228
                    state = 221
                    state = 226
                    state = 203
                    state = 259
                    state = 225
                    state = 193
                    state = 202
                    state = 137
                    state = 231
                    state = 230
                    state = 229
                    state = 590
                    state = 583
                    state = 402
                    state = 587
                    state = 404
                    state = 586
                    state = 589
                    state = 732
                    state = 742
                    state = 405
                    state = 585
                    state = 584
                }
                arms_factory > 0
                original_white_province_second_civil_war = no
            }
            remove_building = {
                type = arms_factory
                level = 1
            }
        }
        random_owned_state = {
            limit = {
                original_white_province_second_civil_war = yes
            }
            add_extra_state_shared_building_slots = 1
            add_building_construction = {
                type = arms_factory
                level = 1
                instant_build = yes
            }
        }
        add_to_temp_variable = { balance_mils_count = 1 }
    }
}

#Spawn Elite Panzer if the Player Bought them
sov_spawn_panzer_scw = {
    if = {
        limit = {
            SOV = {
                has_country_flag = has_purchased_panzers_for_civil_war
            }
        }
        SOV = {
            load_oob = "SOV_panzer_elite_civil_war"
        }
    }
}

#Spawn Japanese Elite if the Player Recruited them
sov_spawn_japanese_elite_scw = {
    if = {
        limit = {
            SOV = {
                has_country_flag = has_recruited_japanese_elite_for_civil_war
            }
        }
        SOV = {
            load_oob = "SOV_japanese_volunteers_elite_civil_war"
        }
    }
}

#Spawn Japanese Ships if the Player Bought them
sov_spawn_japanese_ships_scw = { #TODO Check OOB
    if = {
        limit = {
            SOV = {
                has_country_flag = has_recruited_japanese_elite_for_civil_war
            }
            has_dlc = "Man the Guns"
        }
        SOV = {
            load_oob = "SOV_japanese_ships_civil_war"
        }
    }
    else_if = {
        limit = {
            SOV = {
                has_country_flag = has_recruited_japanese_elite_for_civil_war
            }
            NOT ={
                has_dlc = "Man the Guns"
            }
        }
        SOV = {
            load_oob = "SOV_japanese_ships_civil_war_legacy"
        }
    }
}

#Spawn American Planes Player Bought them
sov_spawn_american_planes_scw = { #TODO Replace Plane OOb
    if = {
        limit = {
            SOV = {
                has_country_flag = has_bought_american_planes_for_civil_war
            }
        }
        SOV = {
            add_equipment_to_stockpile = {
                type = fighter_equipment_1
                amount = 250
            }
            add_equipment_to_stockpile = {
                type = tac_bomber_equipment_0
                amount = 250
                producer = USA
            }
        }
    }
}

#Spawn French Artillery and Support Equipment if the Player Bought them
sov_spawn_french_equipment_scw = {
    if = {
        limit = {
            SOV = {
                has_country_flag = has_bought_french_artillery_for_civil_war
            }
        }
        SOV = {
            add_equipment_to_stockpile = {
                type = artillery_equipment
                amount = 750
                producer = FRA
            }
        }
    }

    if = {
        limit = {
            SOV = {
                has_country_flag = has_bought_french_support_equipment_for_civil_war
            }
        }
        SOV = {
            add_equipment_to_stockpile = {
                type = support_equipment
                amount = 500
                producer = FRA
            }
        }
    }
}

#Spawn Italian Volunteers and Mountaineers at the start of the civil war
sov_spawn_italian_volunteers_scw = {
    if = {
        limit = {
            SOV = {
                has_country_flag = has_trained_mountaineers_for_civil_war
                NOT = {
                    has_country_flag = control_caucasus
                }
            }
        }
        SOV = {
            load_oob = "SOV_elite_mountaineers_no_caucasus_civil_war"
        }
    }
    else_if = {
        limit = {
            SOV = {
                has_country_flag = has_trained_mountaineers_for_civil_war
                has_country_flag = control_caucasus
            }
        }
        SOV = {
            load_oob = "SOV_elite_mountaineers_has_caucasus_civil_war"
        }
    }
    if = {
        limit = {
            SOV = {
                has_country_flag = has_engaged_italian_division_for_civil_war
            }
        }
        SOV = {
            load_oob = "SOV_italian_volunteers_caucasus_civil_war"
        }
    }
}

#Event to Spawn English Ships and Marines at the start of the civil war
sov_spawn_english_ships_marines_scw = {
    if = {
        limit = {
            SOV = {
                has_country_flag = has_bought_english_ships_for_civil_war
                has_dlc = "Man the Guns"
            }
        }
        SOV = {
            load_oob = "SOV_english_naval_ships_civil_war"
        }
    }
    else_if = {
        limit = {
            SOV = {
                has_country_flag = has_bought_english_ships_for_civil_war
                NOT = {
                    has_dlc = "Man the Guns"
                }
            }
        }
        SOV = {
            load_oob = "SOV_english_naval_ships_legacy_civil_war"
        }
    }
    if = {
        limit = {
            SOV = {
                has_country_flag = has_trained_russian_marine_for_civil_war
            }
        }
        SOV = {
            set_technology = {
                marines = 1
            }
            load_oob = "SOV_elite_marines_civil_war"
        }
    }
}

sov_clean_scw_arrays = {
    for_each_loop = {
        array = global.russian_scw_participants

        if = {
            limit = {
                var:v = {
                    OR = {
                        tag = D01
                        tag = D02
                        tag = D03
                        tag = D04
                        tag = D05
                        tag = D06
                        tag = D07
                        tag = D08
                        tag = D09
                        tag = D10
                        tag = D11
                        tag = D12
                        tag = D13
                        tag = D14
                        tag = D15
                        tag = D16
                        tag = D17
                        tag = D18
                        tag = D19
                        tag = D20
                        tag = D21
                        tag = D22
                        tag = D23
                        tag = D24
                        tag = D25
                        tag = D26
                        tag = D27
                        tag = D28
                        tag = D29
                        tag = D30
                        tag = D31
                        tag = D32
                        tag = D33
                        tag = D34
                        tag = D35
                        tag = D36
                        tag = D37
                        tag = D38
                        tag = D39
                        tag = D40
                        tag = D41
                        tag = D42
                        tag = D43
                        tag = D44
                        tag = D45
                        tag = D46
                        tag = D47
                        tag = D48
                        tag = D49
                        tag = D50
                    }
                }
            }
            if = {
                limit = {
                    var:v = {
                        OR = {
                            NOT = {
                                if = {
                                    limit = {
                                        sov_in_scw = yes
                                    }
                                    has_war_with = SOV
                                }
                                if = {
                                    limit = {
                                        soj_in_scw = yes
                                    }
                                    has_war_with = SOJ
                                }
                                if = {
                                    limit = {
                                        ukr_in_scw = yes
                                    }
                                    has_war_with = UKR
                                }
                            }
                        }
                    }
                }
                remove_from_array = { global.russian_scw_participants = var:v }
            }

            if = {
                limit = {
                    is_in_array = { global.russian_scw_participants_sov = var:v }
                }
                remove_from_array = { global.russian_scw_participants_sov = var:v }
            }
            if = {
                limit = {
                    is_in_array = { global.russian_scw_participants_soj = var:v }
                }
                remove_from_array = { global.russian_scw_participants_soj = var:v }
            }
            if = {
                limit = {
                    is_in_array = { global.russian_scw_participants_ukr = var:v }
                }
                remove_from_array = { global.russian_scw_participants_ukr = var:v }
            }
            if = {
                limit = {
                    is_in_array = { global.russian_scw_participants_other = var:v }
                }
                remove_from_array = { global.russian_scw_participants_other = var:v }
            }
        }
    }

    for_each_scope_loop = {
        array = global.russian_scw_participants

        if = {
            limit = {
                OR = {
                    exists = no
                    NOT = {
                        has_global_flag = second_russian_civil_war_in_progress
                    }
                    NOT = {
                        if = {
                            limit = {
                                sov_in_scw = yes
                            }
                            has_war_with = SOV
                        }
                        if = {
                            limit = {
                                soj_in_scw = yes
                            }
                            has_war_with = SOJ
                        }
                        if = {
                            limit = {
                                ukr_in_scw = yes
                            }
                            has_war_with = UKR
                        }
                    }
                }
            }
            if = {
                limit = {
                    is_in_array = { global.russian_scw_participants = THIS }
                }
                remove_from_array = { global.russian_scw_participants = THIS }
                log = " Removed [THIS.GetNameDefCap] ([THIS.GetTag]) from global.russian_scw_participants array"
            }
            if = {
                limit = {
                    is_in_array = { global.russian_scw_participants_sov = THIS }
                }
                remove_from_array = { global.russian_scw_participants_sov = THIS }
                log = " Removed [THIS.GetNameDefCap] ([THIS.GetTag]) from global.russian_scw_participants_sov array"
            }
            if = {
                limit = {
                    is_in_array = { global.russian_scw_participants_soj = THIS }
                }
                remove_from_array = { global.russian_scw_participants_soj = THIS }
                log = " Removed [THIS.GetNameDefCap] ([THIS.GetTag]) from global.russian_scw_participants_soj array"
            }
            if = {
                limit = {
                    is_in_array = { global.russian_scw_participants_ukr = THIS }
                }
                remove_from_array = { global.russian_scw_participants_ukr = THIS }
                log = " Removed [THIS.GetNameDefCap] ([THIS.GetTag]) from global.russian_scw_participants_ukr array"
            }
            if = {
                limit = {
                    is_in_array = { global.russian_scw_participants_other = THIS }
                }
                remove_from_array = { global.russian_scw_participants_other = THIS }
                log = " Removed [THIS.GetNameDefCap] ([THIS.GetTag]) from global.russian_scw_participants_other array"
            }
        }
        else = {
            if = {
                limit = {
                    is_in_array = { global.russian_scw_participants_sov = THIS }
                    OR = {
                        NOT = {
                            tag = SOV
                            is_in_faction_with = SOV
                            is_subject_of = SOV
                        }
                        sov_in_scw = no
                    }
                }
                remove_from_array = { global.russian_scw_participants_sov = THIS }
                log = " Removed [THIS.GetNameDefCap] ([THIS.GetTag]) from global.russian_scw_participants_sov array"
            }

            if = {
                limit = {
                    is_in_array = { global.russian_scw_participants_soj = THIS }
                    OR = {
                        NOT = {
                            tag = SOJ
                            is_in_faction_with = SOJ
                            is_subject_of = SOJ
                        }
                        soj_in_scw = no
                    }
                }
                remove_from_array = { global.russian_scw_participants_soj = THIS }
                log = " Removed [THIS.GetNameDefCap] ([THIS.GetTag]) from global.russian_scw_participants_soj array"
            }

            if = {
                limit = {
                    is_in_array = { global.russian_scw_participants_ukr = THIS }
                    OR = {
                        NOT = {
                            tag = UKR
                            is_in_faction_with = UKR
                            is_subject_of = UKR
                        }
                        ukr_in_scw = no
                    }
                }
                remove_from_array = { global.russian_scw_participants_ukr = THIS }
                log = " Removed [THIS.GetNameDefCap] ([THIS.GetTag]) from global.russian_scw_participants_ukr array"
            }

            if = {
                limit = {
                    is_in_array = { global.russian_scw_participants_other = THIS }
                    OR = {
                        is_in_array = { global.russian_scw_participants_sov = THIS }
                        is_in_array = { global.russian_scw_participants_soj = THIS }
                        is_in_array = { global.russian_scw_participants_ukr = THIS }
                        AND = {
                            NOT = {
                                if = {
                                    limit = {
                                        sov_in_scw = yes
                                    }
                                    has_war_with = SOV
                                }
                                if = {
                                    limit = {
                                        sov_in_scw = yes
                                    }
                                    has_war_with = SOJ
                                }
                                if = {
                                    limit = {
                                        ukr_in_scw = yes
                                    }
                                    has_war_with = UKR
                                }
                            }
                        }
                    }
                }
                remove_from_array = { global.russian_scw_participants_other = THIS }
                log = " Removed [THIS.GetNameDefCap] ([THIS.GetTag]) from global.russian_scw_participants_other array"
            }

            if = {
                limit = {
                    NOT = {
                        is_in_array = { global.russian_scw_participants_sov = THIS }
                    }
                    OR = {
                        tag = SOV
                        is_in_faction_with = SOV
                        is_subject_of = SOV
                    }
                    sov_in_scw = yes
                }
                add_to_array = { global.russian_scw_participants_sov = THIS }
                log = " Added [THIS.GetNameDefCap] ([THIS.GetTag]) to global.russian_scw_participants_sov array"
            }
            else_if = {
                limit = {
                    NOT = {
                        is_in_array = { global.russian_scw_participants_soj = THIS }
                    }
                    OR = {
                        tag = SOJ
                        is_in_faction_with = SOJ
                        is_subject_of = SOJ
                    }
                    soj_in_scw = yes
                }
                add_to_array = { global.russian_scw_participants_soj = THIS }
                log = " Added [THIS.GetNameDefCap] ([THIS.GetTag]) to global.russian_scw_participants_soj array"
            }
            else_if = {
                limit = {
                    NOT = {
                        is_in_array = { global.russian_scw_participants_ukr = THIS }
                    }
                    OR = {
                        tag = UKR
                        is_in_faction_with = UKR
                        is_subject_of = UKR
                    }
                    ukr_in_scw = yes
                }
                add_to_array = { global.russian_scw_participants_ukr = THIS }
                log = " Added [THIS.GetNameDefCap] ([THIS.GetTag]) to global.russian_scw_participants_ukr array"
            }
            else_if = {
                limit = {
                    NOT = {
                        is_in_array = { global.russian_scw_participants_other = THIS }
                        is_in_array = { global.russian_scw_participants_sov = THIS }
                        is_in_array = { global.russian_scw_participants_soj = THIS }
                        is_in_array = { global.russian_scw_participants_ukr = THIS }
                        if = {
                            limit = {
                                sov_in_scw = yes
                            }
                            tag = SOV
                            is_in_faction_with = SOV
                            is_subject_of = SOV
                        }
                        if = {
                            limit = {
                                soj_in_scw = yes
                            }
                            tag = SOJ
                            is_in_faction_with = SOJ
                            is_subject_of = SOJ
                        }
                        if = {
                            limit = {
                                ukr_in_scw = yes
                            }
                            tag = UKR
                            is_in_faction_with = UKR
                            is_subject_of = UKR
                        }
                    }
                    OR = {
                        if = {
                            limit = {
                                sov_in_scw = yes
                            }
                            has_war_with = SOV
                        }
                        if = {
                            limit = {
                                sov_in_scw = yes
                            }
                            has_war_with = SOJ
                        }
                        if = {
                            limit = {
                                ukr_in_scw = yes
                            }
                            has_war_with = UKR
                        }
                    }
                }
                add_to_array = { global.russian_scw_participants_other = THIS }
                log = " Added [THIS.GetNameDefCap] ([THIS.GetTag]) to global.russian_scw_participants_other array"
            }
        }
    }
}
#End of Second Civil War

#Increase Great Purge Penalties
sov_increase_great_purge_penalties = {
    custom_effect_tooltip = sov_will_increase_purge_penalties_tt
    subtract_from_variable = { army_org_factor_great_purge = 0.02 }
    clamp_variable = {
        var = army_org_factor_great_purge
        min = var:army_org_factor_great_purge_max
        max = 0
    }
    subtract_from_variable = { send_volunteer_factor_great_purge = 0.02 }
    clamp_variable = {
        var = send_volunteer_factor_great_purge
        min = var:send_volunteer_factor_great_purge_max
        max = 0
    }
    subtract_from_variable = { army_attack_factor_great_purge = 0.02 }
    clamp_variable = {
        var = army_attack_factor_great_purge
        min = var:army_attack_factor_great_purge_max
        max = 0
    }
    subtract_from_variable = { army_defence_factor_great_purge = 0.02 }
    clamp_variable = {
        var = army_defence_factor_great_purge
        min = var:army_defence_factor_great_purge_max
        max = 0
    }
    subtract_from_variable = { party_popularity_stability_factor_great_purge = 0.02 }
    clamp_variable = {
        var = party_popularity_stability_factor_great_purge
        min = var:party_popularity_stability_factor_great_purge_max
        max = 0
    }
    subtract_from_variable = { experience_gain_army_factor_great_purge = 0.02 }
    clamp_variable = {
        var = experience_gain_army_factor_great_purge
        min = var:experience_gain_army_factor_great_purge_max
        max = 0
    }
    add_to_variable = { training_time_factor_great_purge = 0.02 }
    clamp_variable = {
        var = training_time_factor_great_purge
        min = 0
        max = var:training_time_factor_great_purge_max
    }
    add_to_variable = { political_advisor_cost_factor_great_purge = 0.02 }
    clamp_variable = {
        var = political_advisor_cost_factor_great_purge
        min = 0
        max = var:political_advisor_cost_factor_great_purge_max
    }
    hidden_effect = {
        if = {
            limit = {
                check_variable = {
                    var = sov_great_purge_completion
                    value = 100
                    compare = greater_than_or_equals
                }
            }
            country_event = russia2_russia.25
            clr_country_flag = sov_purge_ongoing
        }
    }
}

#Calculate Democratic Custom GUI Bar Progress
calculate_sov_gui_percentage_democratic_vote = {
    if = {
        limit = {
            OR = {
                check_variable = {
                    var = current_democratic_vote^0
                    value = 1
                    compare = greater_than_or_equals
                }
                check_variable = {
                    var = current_democratic_vote^1
                    value = 1
                    compare = greater_than_or_equals
                }
            }
        }
        set_variable = { sov_gui_percentage_democratic_vote = current_democratic_vote^0 }
        divide_variable = { sov_gui_percentage_democratic_vote = current_democratic_vote_registered^num }
        multiply_variable = { sov_gui_percentage_democratic_vote = 100 }
        round_variable = sov_gui_percentage_democratic_vote
        clamp_variable = {
            var = sov_gui_percentage_democratic_vote
            min = 0
            max = 100
        }
    }
    else = {
        set_variable = { sov_gui_percentage_democratic_vote = 50 }
    }
}

rr_lock_all_templates = {
    country_lock_all_division_template = yes
}

rr_unlock_all_templates = {
    country_lock_all_division_template = no
}

black_revolution_division_template_organiser = {
    delete_unit_template_and_units = {
        division_template = "Militsiya Gornostrelkovaya Diviziya"
    }
    delete_unit_template_and_units = {
        division_template = "Povstancheskaya Militsiya Diviziya"
    }
    delete_unit_template_and_units = {
        division_template = "Militsiya Motorizirovannaya Diviziya"
    }
    delete_unit_template_and_units = {
        division_template = "Militsiya Kavaleriyskaya Diviziya"
    }
    set_division_template_lock = {
        division_template = "Povstancheskaya Diviziya"
        is_locked = yes
    }
    set_division_template_lock = {
        division_template = "Gornostrelkovaya Diviziya"
        is_locked = yes
    }
    set_division_template_lock = {
        division_template = "Motorizirovannaya Povstancheskaya Diviziya"
        is_locked = yes
    }
    set_division_template_lock = {
        division_template = "Kavaleriyskaya Povstancheskaya Diviziya"
        is_locked = yes
    }
    set_division_template_lock = {
        division_template = "Tankovaya Povstancheskaya Diviziya"
        is_locked = yes
    }
    set_division_template_lock = {
        division_template = "Vozdushno-Desantnaya Brigada"
        is_locked = yes
    }
    set_division_template_lock = {
        division_template = "Strelkovaya Diviziya"
        is_locked = yes
    }
    set_division_template_lock = {
        division_template = "Patrul'nyy Ttryad Militsii"
        is_locked = yes
    }
}

anarchy_unlock_division_template = {
    set_division_template_lock = {
        division_template = "Povstancheskaya Diviziya"
        is_locked = no
    }
    set_division_template_lock = {
        division_template = "Gornostrelkovaya Diviziya"
        is_locked = no
    }
    set_division_template_lock = {
        division_template = "Motorizirovannaya Povstancheskaya Diviziya"
        is_locked = no
    }
    set_division_template_lock = {
        division_template = "Kavaleriyskaya Povstancheskaya Diviziya"
        is_locked = no
    }
    set_division_template_lock = {
        division_template = "Tankovaya Povstancheskaya Diviziya"
        is_locked = no
    }
    set_division_template_lock = {
        division_template = "Vozdushno-Desantnaya Brigada"
        is_locked = no
    }
    set_division_template_lock = {
        division_template = "Strelkovaya Diviziya"
        is_locked = no
    }
    set_division_template_lock = {
        division_template = "Patrul'nyy Ttryad Militsii"
        is_locked = no
    }
    set_division_template_lock = {
        division_template = "Militsii Diviziya"
        is_locked = no
    }
}

extra_division_soviet_russian_cw = {
    if = {
        limit = {
            SOV = {
                NOT = {
                    has_country_flag = control_caucasus
                }
            }
        }
        SOJ = {
            load_oob = "SOJ_no_control_caucasus"
        }
    }
    if = {
        limit = {
            SOV = {
                NOT = {
                    has_country_flag = control_central_asia
                }
            }
        }
        SOJ = {
            load_oob = "SOJ_no_control_central_asia"
        }
    }
    if = {
        limit = {
            SOV = {
                NOT = {
                    has_country_flag = control_belarus
                }
            }
        }
        SOJ = {
            load_oob = "SOJ_no_control_belarus"
        }
    }
}

kievan_rus_state = {
    for_each_scope_loop = {
        array = SOV.owned_controlled_states
        if = {
            limit = {
                THIS = {
                    OR = {
                        state = 194
                        state = 204
                        state = 241
                        state = 206
                        state = 207
                        state = 210
                        state = 209
                        state = 208
                        state = 195
                        state = 244
                        state = 264
                        state = 216
                        state = 224
                        state = 243
                        state = 242
                        state = 246
                        state = 263
                        state = 234
                        state = 240
                        state = 220
                        state = 222
                        state = 205
                        state = 219
                        state = 247
                        state = 223
                        state = 215
                        state = 214
                        state = 351
                        state = 248
                        state = 253
                        state = 218
                        state = 213
                        state = 880
                        state = 879
                    }
                }
            }
            add_to_array = { global.kievan_rus_state_ukraine = THIS }
        }
    }
}

ukr_check_continents_triggers = {
    set_variable = { ukr.anarchist_continent_cores@europe = 0 }
    set_variable = { ukr.anarchist_continent_cores@north_america = 0 }
    set_variable = { ukr.anarchist_continent_cores@south_america = 0 }
    set_variable = { ukr.anarchist_continent_cores@australia = 0 }
    set_variable = { ukr.anarchist_continent_cores@africa = 0 }
    set_variable = { ukr.anarchist_continent_cores@asia = 0 }
    set_variable = { ukr.anarchist_continent_cores@middle_east = 0 }

    for_each_loop = {
        array = ukr.anarchist_states
        value = v
        index = i
        break = break_array

        if = {
            limit = {
                var:v = {
                    is_on_continent = europe
                    is_core_of = UKR
                }
            }
            add_to_variable = { ukr.anarchist_continent_cores@europe = 0 }
        }
        else_if = {
            limit = {
                var:v = {
                    is_on_continent = north_america
                    is_core_of = UKR
                }
            }
            add_to_variable = { ukr.anarchist_continent_cores@north_america = 0 }
        }
        else_if = {
            limit = {
                var:v = {
                    is_on_continent = south_america
                    is_core_of = UKR
                }
            }
            add_to_variable = { ukr.anarchist_continent_cores@south_america = 0 }
        }
        else_if = {
            limit = {
                var:v = {
                    is_on_continent = australia
                    is_core_of = UKR
                }
            }
            add_to_variable = { ukr.anarchist_continent_cores@australia = 0 }
        }
        else_if = {
            limit = {
                var:v = {
                    is_on_continent = africa
                    is_core_of = UKR
                }
            }
            add_to_variable = { ukr.anarchist_continent_cores@africa = 0 }
        }
        else_if = {
            limit = {
                var:v = {
                    is_on_continent = asia
                    is_core_of = UKR
                }
            }
            add_to_variable = { ukr.anarchist_continent_cores@asia = 0 }
        }
        else_if = {
            limit = {
                var:v = {
                    is_on_continent = middle_east
                    is_core_of = UKR
                }
            }
            add_to_variable = { ukr.anarchist_continent_cores@middle_east = 0 }
        }
    }
}

#Update the state list
ukr_update_anarchist_states = {
    #First, update the main array ukr.controlled_states
    resize_array = { ukr.anarchist_states = 0 }
    for_each_loop = {
        array = ukr.controlled_states
        value = v
        index = i
        break = break_array

        add_to_array = { ukr.anarchist_states = var:v }
    }

    #Update the daily gain of states
    ukr_check_continents_triggers = yes

    for_each_loop = {
        array = ukr.anarchist_states
        value = v
        index = i
        break = break_array

        if = {
            limit = {
                var:v = {
                    is_controlled_by = UKR
                }
            }
            #Base gain is 0.4
            set_variable = { ukr.anarchist_support_daily@var:v = 0.4 }

            #Continent popularity
            if = {
                limit = {
                    var:v = {
                        is_on_continent = europe
                    }
                }
                if = {
                    limit = {
                        ukr_malus_europe_anarchist_states = yes
                    }
                    subtract_from_variable = { ukr.anarchist_support_daily@var:v = 0.2 }
                }
                else_if = {
                    limit = {
                        ukr_bonus_europe_anarchist_states = yes
                    }
                    add_to_variable = { ukr.anarchist_support_daily@var:v = 0.2 }
                }
            }
            else_if = {
                limit = {
                    var:v = {
                        is_on_continent = north_america
                    }
                }
                if = {
                    limit = {
                        ukr_malus_north_america_anarchist_states = yes
                    }
                    subtract_from_variable = { ukr.anarchist_support_daily@var:v = 0.2 }
                }
                else_if = {
                    limit = {
                        ukr_bonus_north_america_anarchist_states = yes
                    }
                    add_to_variable = { ukr.anarchist_support_daily@var:v = 0.2 }
                }
            }
            else_if = {
                limit = {
                    var:v = {
                        is_on_continent = south_america
                    }
                }
                if = {
                    limit = {
                        ukr_malus_south_america_anarchist_states = yes
                    }
                    subtract_from_variable = { ukr.anarchist_support_daily@var:v = 0.2 }
                }
                else_if = {
                    limit = {
                        ukr_bonus_south_america_anarchist_states = yes
                    }
                    add_to_variable = { ukr.anarchist_support_daily@var:v = 0.2 }
                }
            }
            else_if = {
                limit = {
                    var:v = {
                        is_on_continent = australia
                    }
                }
                if = {
                    limit = {
                        ukr_malus_australia_anarchist_states = yes
                    }
                    subtract_from_variable = { ukr.anarchist_support_daily@var:v = 0.2 }
                }
                else_if = {
                    limit = {
                        ukr_bonus_australia_anarchist_states = yes
                    }
                    add_to_variable = { ukr.anarchist_support_daily@var:v = 0.2 }
                }
            }
            else_if = {
                limit = {
                    var:v = {
                        is_on_continent = africa
                    }
                }
                if = {
                    limit = {
                        ukr_malus_africa_anarchist_states = yes
                    }
                    subtract_from_variable = { ukr.anarchist_support_daily@var:v = 0.2 }
                }
                else_if = {
                    limit = {
                        ukr_bonus_africa_anarchist_states = yes
                    }
                    add_to_variable = { ukr.anarchist_support_daily@var:v = 0.2 }
                }
            }
            else_if = {
                limit = {
                    var:v = {
                        is_on_continent = asia
                    }
                }
                if = {
                    limit = {
                        ukr_malus_asia_anarchist_states = yes
                    }
                    subtract_from_variable = { ukr.anarchist_support_daily@var:v = 0.2 }
                }
                else_if = {
                    limit = {
                        ukr_bonus_asia_anarchist_states = yes
                    }
                    add_to_variable = { ukr.anarchist_support_daily@var:v = 0.2 }
                }
            }
            else_if = {
                limit = {
                    var:v = {
                        is_on_continent = middle_east
                    }
                }
                if = {
                    limit = {
                        ukr_malus_middle_east_anarchist_states = yes
                    }
                    subtract_from_variable = { ukr.anarchist_support_daily@var:v = 0.2 }
                }
                else_if = {
                    limit = {
                        ukr_bonus_middle_east_anarchist_states = yes
                    }
                    add_to_variable = { ukr.anarchist_support_daily@var:v = 0.2 }
                }
            }

            #Core
            if = {
                limit = {
                    var:v = {
                        is_core_of = UKR
                    }
                }
                add_to_variable = { ukr.anarchist_support_daily@var:v = 0.8 }
            }

            #Boost
            if = {
                limit = {
                    check_variable = {
                        var = ukr.anarchist_support_boost@var:v
                        value = 0
                        compare = greater_than
                    }
                }
                add_to_variable = { ukr.anarchist_support_daily@var:v = 0.5 }
            }

            clamp_variable = {
                var = ukr.anarchist_support_daily@var:v
                min = 0
                max = 2
            }
        }
    }
}

#Add daily gain
ukr_add_daily_gain_anarchist_states = {
    for_each_loop = {
        array = ukr.anarchist_states
        value = v
        index = i
        break = break_array

        if = {
            limit = {
                check_variable = {
                    var = ukr.anarchist_support@var:v
                    value = 100
                    compare = less_than
                }
            }
            add_to_variable = { ukr.anarchist_support@var:v = ukr.anarchist_support_daily@var:v }
            clamp_variable = {
                var = ukr.anarchist_support@var:v
                min = 0
                max = 100
            }
        }
        if = {
            limit = {
                var:v = {
                    is_core_of = UKR
                }
            }
            if = {
                limit = {
                    var:v = {
                        has_dynamic_modifier = {
                            modifier = ukr_anarchist_state_non_converted
                        }
                    }
                }
                var:v = {
                    remove_dynamic_modifier = {
                        modifier = ukr_anarchist_state_non_converted
                    }
                }
            }
            if = {
                limit = {
                    var:v = {
                        has_dynamic_modifier = {
                            modifier = ukr_anarchist_state_converted
                        }
                    }
                }
                var:v = {
                    remove_dynamic_modifier = {
                        modifier = ukr_anarchist_state_converted
                    }
                }
            }
        }
        else = {
            if = {
                limit = {
                    check_variable = {
                        var = ukr.anarchist_support@var:v
                        value = 100
                        compare = equals
                    }
                    var:v = {
                        NOT = {
                            has_dynamic_modifier = {
                                modifier = ukr_anarchist_state_converted
                            }
                        }
                    }
                }
                var:v = {
                    add_dynamic_modifier = {
                        modifier = ukr_anarchist_state_converted
                    }
                }
                if = {
                    limit = {
                        var:v = {
                            has_dynamic_modifier = {
                                modifier = ukr_anarchist_state_non_converted
                            }
                        }
                    }
                    var:v = {
                        remove_dynamic_modifier = {
                            modifier = ukr_anarchist_state_non_converted
                        }
                    }
                }
            }
            else_if = {
                limit = {
                    check_variable = {
                        var = ukr.anarchist_support@var:v
                        value = 100
                        compare = less_than
                    }
                    var:v = {
                        NOT = {
                            has_dynamic_modifier = {
                                modifier = ukr_anarchist_state_non_converted
                            }
                        }
                    }
                }
                var:v = {
                    add_dynamic_modifier = {
                        modifier = ukr_anarchist_state_non_converted
                    }
                }
                if = {
                    limit = {
                        var:v = {
                            has_dynamic_modifier = {
                                modifier = ukr_anarchist_state_converted
                            }
                        }
                    }
                    var:v = {
                        remove_dynamic_modifier = {
                            modifier = ukr_anarchist_state_converted
                        }
                    }
                }
            }
        }

        if = {
            limit = {
                NOT = {
                    check_variable = {
                        var = ukr.anarchist_support_boost@var:v
                        value = 0
                        compare = equals
                    }
                }
            }
            subtract_from_variable = { ukr.anarchist_support_boost@var:v = 1 }
            clamp_variable = {
                var = ukr.anarchist_support_boost@var:v
                min = 0
                max = 30
            }
        }
    }

    set_temp_variable = { ukr_daily_anarchy_gain_temp = 0 }

    for_each_loop = {
        array = ukr.anarchist_states
        value = v
        index = i
        break = break_array


        if = {
            limit = {
                check_variable = {
                    var = ukr.anarchist_support@var:v
                    value = 100
                    compare = equals
                }
                var:v = {
                    is_core_of = UKR
                }
            }
            add_to_temp_variable = { ukr_daily_anarchy_gain_temp = 0.05 }
        }
    }

    set_variable = { ukr_anarchist_daily_gain = var:ukr_daily_anarchy_gain_temp }
    force_update_dynamic_modifier = yes
}

#Update the state cost
ukr_update_state_cost = {
    for_each_loop = {
        array = ukr.anarchist_states
        value = v
        index = i
        break = break_array

        var:v = {
            set_temp_variable = { state_boost_cost = THIS.state_and_terrain_strategic_value }
            multiply_temp_variable = { state_boost_cost = 5 }
            round_temp_variable = state_boost_cost
            clamp_temp_variable = {
                var = state_boost_cost
                min = 25
                max = 250
            }
            set_variable = { ukr.anarchist_state_boost_cost@THIS = var:state_boost_cost }

            set_temp_variable = { state_core_cost = THIS.state_population_k }
            divide_temp_variable = { state_core_cost = 10 }
            set_temp_variable = { state_core_cost_multiplier = ukr.anarchist_support@THIS }
            divide_temp_variable = { state_core_cost_multiplier = 100 }
            divide_temp_variable = { state_core_cost = state_core_cost_multiplier }
            clamp_temp_variable = {
                var = state_core_cost
                min = 10
                max = 500
            }
            set_variable = { ukr.anarchist_state_core_cost@THIS = var:state_core_cost }
        }
    }
}

#Update current view
ukr_update_current_view = {
    resize_array = { ukr.anarchist_states_current_view = 0 }
    if = {
        limit = {
            check_variable = {
                var = ukr.view_anarchist_states_can_be_cored
                value = 2
                compare = equals
            }
        }
        for_each_loop = {
            array = ukr.anarchist_states
            value = v
            index = i
            break = break_array

            if = {
                limit = {
                    var:v = {
                        is_controlled_by = UKR
                        NOT = {
                            is_core_of = UKR
                        }
                        check_variable = {
                            var = ukr.political_power
                            value = ukr.anarchist_state_core_cost@var:v
                            compare = greater_than_or_equals
                        }
                        any_neighbor_state = {
                            is_core_of = UKR
                        }
                        check_variable = {
                            var = ukr.anarchist_support@var:v
                            value = 50
                            compare = greater_than_or_equals
                        }
                        check_variable = {
                            var = ukr.anarchist_coring_points
                            value = 1
                            compare = greater_than_or_equals
                        }
                    }
                }
                add_to_array = { ukr.anarchist_states_current_view = var:v }
            }
        }
    }
    else = {
        for_each_loop = {
            array = ukr.anarchist_states
            value = v
            index = i
            break = break_array

            if = {
                limit = {
                    var:v = {
                        is_controlled_by = UKR
                        if = {
                            limit = {
                                NOT = {
                                    check_variable = {
                                        var = ukr.view_anarchist_states_core
                                        value = 2
                                        compare = equals
                                    }
                                }
                            }
                            NOT = {
                                is_core_of = UKR
                            }
                        }
                        if = {
                            limit = {
                                NOT = {
                                    check_variable = {
                                        var = ukr.view_anarchist_states_converted
                                        value = 2
                                        compare = equals
                                    }
                                }
                            }
                            check_variable = {
                                var = ukr.anarchist_support@var:v
                                value = 100
                                compare = less_than
                            }
                        }
                    }
                }
                add_to_array = { ukr.anarchist_states_current_view = var:v }
            }
        }
    }
}

ukr_spawn_free_division_decision_scripted_effect = {
    random_owned_controlled_state = {
        limit = {
            is_core_of = FROM
            NOT = {
                is_capital = yes
            }
        }
        create_unit = {
            division = "name = \"Zvil'nennya Dyviziya\" division_template = \"Zvil'nennya Dyviziya\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
            owner = ROOT
            allow_spawning_on_enemy_provs = yes
        }
        create_unit = {
            division = "name = \"Zvil'nennya Dyviziya\" division_template = \"Zvil'nennya Dyviziya\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
            owner = ROOT
            allow_spawning_on_enemy_provs = yes
        }
    }
}

ukr_spawn_free_division_decision_scripted_effect_african_colonist_edition = {
    random_owned_controlled_state = {
        limit = {
            is_on_continent = africa
            NOT = {
                is_core_of = FROM
            }
            NOT = {
                is_capital = yes
            }
        }
        create_unit = {
            division = "name = \"Zvil'nennya Dyviziya\" division_template = \"Zvil'nennya Dyviziya\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
            owner = ROOT
            allow_spawning_on_enemy_provs = yes
        }
        create_unit = {
            division = "name = \"Zvil'nennya Dyviziya\" division_template = \"Zvil'nennya Dyviziya\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
            owner = ROOT
            allow_spawning_on_enemy_provs = yes
        }
    }
}
#TODO START Check once updated new Russian State Core
sov_release_far_east_anarchist_collapse = {
    SOV = {
        release_on_controlled = EFR
    }
    EFR = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Far Eastern Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Far Eastern Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #12 Infantry and 1 Tank
            create_unit = {
                division = "name = \"Free Far Eastern Division\" division_template = \"Free Far Eastern Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = EFR
            }
            create_unit = {
                division = "name = \"Free Far Eastern Division\" division_template = \"Free Far Eastern Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = EFR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Far Eastern Division\" division_template = \"Free Far Eastern Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = EFR
            }
            create_unit = {
                division = "name = \"Free Far Eastern Division\" division_template = \"Free Far Eastern Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = EFR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Far Eastern Division\" division_template = \"Free Far Eastern Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = EFR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Far Eastern Division\" division_template = \"Free Far Eastern Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = EFR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Far Eastern Division\" division_template = \"Free Far Eastern Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = EFR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Far Eastern Division\" division_template = \"Free Far Eastern Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = EFR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Far Eastern Division\" division_template = \"Free Far Eastern Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = EFR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Far Eastern Division\" division_template = \"Free Far Eastern Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = EFR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Far Eastern Division\" division_template = \"Free Far Eastern Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = EFR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Far Eastern Division\" division_template = \"Free Far Eastern Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = EFR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Far Eastern Mechanized Division\" division_template = \"Free Far Eastern Mechanized Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = EFR
            }
        }
    }
}

sov_release_siberia_anarchist_collapse = {
    SIB = {
        remove_state_core = 581
    }
    SOV = {
        release_on_controlled = SIB
    }
    SIB = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        transfer_state = 579
        add_state_core = 579
        transfer_state = 580
        add_state_core = 580
        transfer_state = 403
        add_state_core = 403
        division_template = {
           name = "Free Siberian Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Siberian Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #18 Infantry Divisions 2 Tank Divisions
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
            create_unit = {
                division = "name = \"Free Siberian Division\" division_template = \"Free Siberian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Siberian Mechanized Division\" division_template = \"Free Siberian Mechanized Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
            create_unit = {
                division = "name = \"Free Siberian Mechanized Division\" division_template = \"Free Siberian Mechanized Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = SIB
            }
        }
    }
}

sov_release_urals_anarchist_collapse = {
    URA = {
        remove_state_core = 581
        remove_state_core = 398
    }
    SOV = {
        release_on_controlled = URA
    }
    URA = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        remove_state_core = 579
        remove_state_core = 580
        remove_state_core = 403
        division_template = {
           name = "Free Ural Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Ural Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #7 Infantry Divisions and 1 Tank
            create_unit = {
                division = "name = \"Free Ural Division\" division_template = \"Free Ural Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = URA
            }
            create_unit = {
                division = "name = \"Free Ural Division\" division_template = \"Free Ural Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = URA
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ural Division\" division_template = \"Free Ural Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = URA
            }
            create_unit = {
                division = "name = \"Free Ural Division\" division_template = \"Free Ural Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = URA
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ural Division\" division_template = \"Free Ural Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = URA
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ural Division\" division_template = \"Free Ural Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = URA
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ural Division\" division_template = \"Free Ural Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = URA
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ural Mechanized Division\" division_template = \"Free Ural Mechanized Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = URA
            }
        }
    }
}

sov_release_kazakh_anarchist_collapse = {
    SOV = {
        release_on_controlled = KAZ
    }
    KAZ = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Kazakh Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Kazakh Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #13 Infantry Divisions and 2 Tank
            create_unit = {
                division = "name = \"Free Kazakh Division\" division_template = \"Free Kazakh Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAZ
            }
            create_unit = {
                division = "name = \"Free Kazakh Division\" division_template = \"Free Kazakh Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAZ
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Kazakh Division\" division_template = \"Free Kazakh Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAZ
            }
            create_unit = {
                division = "name = \"Free Kazakh Division\" division_template = \"Free Kazakh Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAZ
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Kazakh Division\" division_template = \"Free Kazakh Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAZ
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Kazakh Division\" division_template = \"Free Kazakh Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAZ
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Kazakh Division\" division_template = \"Free Kazakh Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAZ
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Kazakh Division\" division_template = \"Free Kazakh Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAZ
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Kazakh Division\" division_template = \"Free Kazakh Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAZ
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Kazakh Division\" division_template = \"Free Kazakh Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAZ
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Kazakh Division\" division_template = \"Free Kazakh Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAZ
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Kazakh Division\" division_template = \"Free Kazakh Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAZ
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Kazakh Division\" division_template = \"Free Kazakh Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAZ
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Kazakh Mechanized Division\" division_template = \"Free Kazakh Mechanized Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAZ
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Kazakh Mechanized Division\" division_template = \"Free Kazakh Mechanized Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAZ
            }
        }
    }
}

sov_release_uzbekistan_anarchist_collapse = {
    SOV = {
        release_on_controlled = UZB
    }
    UZB = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Uzbek Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Uzbek Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #5 Infantry Divisions
            create_unit = {
                division = "name = \"Free Uzbek Division\" division_template = \"Free Uzbek Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UZB
            }
            create_unit = {
                division = "name = \"Free Uzbek Division\" division_template = \"Free Uzbek Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UZB
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Uzbek Division\" division_template = \"Free Uzbek Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UZB
            }
            create_unit = {
                division = "name = \"Free Uzbek Division\" division_template = \"Free Uzbek Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UZB
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Uzbek Division\" division_template = \"Free Uzbek Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UZB
            }
        }
    }
}

sov_release_turkmenistan_anarchist_collapse = {
    SOV = {
        release_on_controlled = TMS
    }
    TMS = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Turkmen Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Turkmen Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #5 Infantry Divisions
            create_unit = {
                division = "name = \"Free Turkmen Division\" division_template = \"Free Turkmen Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TMS
            }
            create_unit = {
                division = "name = \"Free Turkmen Division\" division_template = \"Free Turkmen Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TMS
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Turkmen Division\" division_template = \"Free Turkmen Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TMS
            }
            create_unit = {
                division = "name = \"Free Turkmen Division\" division_template = \"Free Turkmen Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TMS
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Turkmen Division\" division_template = \"Free Turkmen Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TMS
            }
        }
    }
}

sov_release_tajikstan_anarchist_collapse = {
    SOV = {
        release_on_controlled = TAJ
    }
    TAJ = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Tajik Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Tajik Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #3 Infantry Divisions
            create_unit = {
                division = "name = \"Free Tajik Division\" division_template = \"Free Tajik Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TAJ
            }
            create_unit = {
                division = "name = \"Free Tajik Division\" division_template = \"Free Tajik Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TAJ
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Tajik Division\" division_template = \"Free Tajik Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TAJ
            }
        }
    }
}

sov_release_kyrghiz_anarchist_collapse = {
    SOV = {
        release_on_controlled = KYR
    }
    KYR = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free kyrghiz Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free kyrghiz Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #3 Infantry Divisions
            create_unit = {
                division = "name = \"Free kyrghiz Division\" division_template = \"Free kyrghiz Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KYR
            }
            create_unit = {
                division = "name = \"Free kyrghiz Division\" division_template = \"Free kyrghiz Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KYR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free kyrghiz Division\" division_template = \"Free kyrghiz Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KYR
            }
        }
    }
}

sov_release_armenia_anarchist_collapse = {
    SOV = {
        release_on_controlled = ARM
    }
    ARM = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Armenian Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Armenian Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #4 Infantry Divisions
            create_unit = {
                division = "name = \"Free Armenian Division\" division_template = \"Free Armenian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = ARM
            }
            create_unit = {
                division = "name = \"Free Armenian Division\" division_template = \"Free Armenian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = ARM
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Armenian Division\" division_template = \"Free Armenian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = ARM
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Armenian Division\" division_template = \"Free Armenian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = ARM
            }
        }
    }
}

sov_release_georgia_anarchist_collapse = {
    SOV = {
        release_on_controlled = GEO
    }
    GEO = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Georgian Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Georgian Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #4 Infantry Divisions
            create_unit = {
                division = "name = \"Free Georgian Division\" division_template = \"Free Georgian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = GEO
            }
            create_unit = {
                division = "name = \"Free Georgian Division\" division_template = \"Free Georgian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = GEO
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Georgian Division\" division_template = \"Free Georgian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = GEO
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Georgian Division\" division_template = \"Free Georgian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = GEO
            }
        }
    }
}

sov_release_azerbaijan_anarchist_collapse = {
    SOV = {
        release_on_controlled = AZR
    }
    AZR = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Azerbaijani Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Azerbaijani Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #4 Infantry Divisions
            create_unit = {
                division = "name = \"Free Azerbaijani Division\" division_template = \"Free Azerbaijani Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = AZR
            }
            create_unit = {
                division = "name = \"Free Azerbaijani Division\" division_template = \"Free Azerbaijani Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = AZR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Azerbaijani Division\" division_template = \"Free Azerbaijani Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = AZR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Azerbaijani Division\" division_template = \"Free Azerbaijani Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = AZR
            }
        }
    }
}

sov_release_volgograd_anarchist_collapse = {
    SOV = {
        release_on_controlled = VLG
    }
    VLG = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Volgograd Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Volgograd Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #4 Infantry Divisions
            create_unit = {
                division = "name = \"Free Volgograd Division\" division_template = \"Free Volgograd Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = VLG
            }
            create_unit = {
                division = "name = \"Free Volgograd Division\" division_template = \"Free Volgograd Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = VLG
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Volgograd Division\" division_template = \"Free Volgograd Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = VLG
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Volgograd Division\" division_template = \"Free Volgograd Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = VLG
            }
        }
    }
}

sov_release_kalmykia_anarchist_collapse = {
    SOV = {
        release_on_controlled = KAL
    }
    KAL = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Kalmyk Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Kalmyk Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #4 Infantry Divisions
            create_unit = {
                division = "name = \"Free Kalmyk Division\" division_template = \"Free Kalmyk Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAL
            }
            create_unit = {
                division = "name = \"Free Kalmyk Division\" division_template = \"Free Kalmyk Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAL
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Kalmyk Division\" division_template = \"Free Kalmyk Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAL
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Kalmyk Division\" division_template = \"Free Kalmyk Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAL
            }
        }
    }
}

sov_release_rostov_anarchist_collapse = {
    SOV = {
        release_on_controlled = ROS
    }
    ROS = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Rostovsky Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Rostovsky Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #4 Infantry Divisions and 1 Tank
            create_unit = {
                division = "name = \"Free Rostovsky Division\" division_template = \"Free Rostovsky Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = ROS
            }
            create_unit = {
                division = "name = \"Free Rostovsky Division\" division_template = \"Free Rostovsky Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = ROS
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Rostovsky Division\" division_template = \"Free Rostovsky Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = ROS
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Rostovsky Division\" division_template = \"Free Rostovsky Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = ROS
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Rostovsky Mechanized Division\" division_template = \"Free Rostovsky Mechanized Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = ROS
            }
        }
    }
}

sov_release_dagestan_anarchist_collapse = {
    SOV = {
        release_on_controlled = DAG
    }
    DAG = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Dagestani Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Dagestani Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #3 Infantry Divisions
            create_unit = {
                division = "name = \"Free Dagestani Division\" division_template = \"Free Dagestani Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = DAG
            }
            create_unit = {
                division = "name = \"Free Dagestani Division\" division_template = \"Free Dagestani Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = DAG
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Dagestani Division\" division_template = \"Free Dagestani Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = DAG
            }
        }
    }
}

sov_release_circassia_anarchist_collapse = {
    SOV = {
        release_on_controlled = CIR
    }
    CIR = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Circassian Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Circassian Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #4 Infantry Divisions
            create_unit = {
                division = "name = \"Free Circassian Division\" division_template = \"Free Circassian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = CIR
            }
            create_unit = {
                division = "name = \"Free Circassian Division\" division_template = \"Free Circassian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = CIR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Circassian Division\" division_template = \"Free Circassian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = CIR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Circassian Division\" division_template = \"Free Circassian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = CIR
            }
        }
    }
}

sov_release_vyatka_anarchist_collapse = {
    SOV = {
        release_on_controlled = VYA
    }
    VYA = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Vyatka Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Vyatka Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #4 Infantry Divisions
            create_unit = {
                division = "name = \"Free Vyatka Division\" division_template = \"Free Vyatka Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = VYA
            }
            create_unit = {
                division = "name = \"Free Vyatka Division\" division_template = \"Free Vyatka Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = VYA
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Vyatka Division\" division_template = \"Free Vyatka Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = VYA
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Vyatka Division\" division_template = \"Free Vyatka Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = VYA
            }
        }
    }
}

sov_release_tatarstan_anarchist_collapse = {
    SOV = {
        release_on_controlled = TAT
    }
    TAT = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Tatar Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Tatar Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #7 Infantry Divisions and 1 Tank
            create_unit = {
                division = "name = \"Free Tatar Division\" division_template = \"Free Tatar Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TAT
            }
            create_unit = {
                division = "name = \"Free Tatar Division\" division_template = \"Free Tatar Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TAT
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Tatar Division\" division_template = \"Free Tatar Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TAT
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Tatar Division\" division_template = \"Free Tatar Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TAT
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Tatar Division\" division_template = \"Free Tatar Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TAT
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Tatar Division\" division_template = \"Free Tatar Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TAT
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Tatar Division\" division_template = \"Free Tatar Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TAT
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Tatar Mechanized Division\" division_template = \"Free Tatar Mechanized Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = TAT
            }
        }
    }
}

sov_release_perm_anarchist_collapse = {
    SOV = {
        release_on_controlled = PRM
    }
    PRM = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Perm Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Perm Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #5 Infantry Divisions
            create_unit = {
                division = "name = \"Free Perm Division\" division_template = \"Free Perm Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = PRM
            }
            create_unit = {
                division = "name = \"Free Perm Division\" division_template = \"Free Perm Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = PRM
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Perm Division\" division_template = \"Free Perm Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = PRM
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Perm Division\" division_template = \"Free Perm Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = PRM
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Perm Division\" division_template = \"Free Perm Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = PRM
            }
        }
    }
}

sov_release_karelia_anarchist_collapse = {
    SOV = {
        release_on_controlled = KAR
    }
    KAR = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Karelian Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Karelian Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #5 Infantry Divisions
            create_unit = {
                division = "name = \"Free Karelian Division\" division_template = \"Free Karelian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAR
            }
            create_unit = {
                division = "name = \"Free Karelian Division\" division_template = \"Free Karelian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Karelian Division\" division_template = \"Free Karelian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Karelian Division\" division_template = \"Free Karelian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Karelian Division\" division_template = \"Free Karelian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KAR
            }
        }
    }
}

sov_release_komi_anarchist_collapse = {
    SOV = {
        release_on_controlled = KMI
    }
    KMI = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Komi Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Komi Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #5 Infantry Divisions
            create_unit = {
                division = "name = \"Free Komi Division\" division_template = \"Free Komi Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KMI
            }
            create_unit = {
                division = "name = \"Free Komi Division\" division_template = \"Free Komi Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KMI
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Komi Division\" division_template = \"Free Komi Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KMI
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Komi Division\" division_template = \"Free Komi Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KMI
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Komi Division\" division_template = \"Free Komi Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = KMI
            }
        }
    }
}

sov_release_novgorod_anarchist_collapse = {
    SOV = {
        release_on_controlled = NOV
    }
    NOV = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        transfer_state = 195
        add_state_core = 195
        division_template = {
           name = "Free Novgorodian Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Novgorodian Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #15 Infantry Divisions and 2 tank
            create_unit = {
                division = "name = \"Free Novgorodian Division\" division_template = \"Free Novgorodian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
            create_unit = {
                division = "name = \"Free Novgorodian Division\" division_template = \"Free Novgorodian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Novgorodian Division\" division_template = \"Free Novgorodian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Novgorodian Division\" division_template = \"Free Novgorodian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Novgorodian Division\" division_template = \"Free Novgorodian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Novgorodian Division\" division_template = \"Free Novgorodian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
            create_unit = {
                division = "name = \"Free Novgorodian Division\" division_template = \"Free Novgorodian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
            create_unit = {
                division = "name = \"Free Novgorodian Division\" division_template = \"Free Novgorodian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Novgorodian Division\" division_template = \"Free Novgorodian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
            create_unit = {
                division = "name = \"Free Novgorodian Division\" division_template = \"Free Novgorodian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Novgorodian Division\" division_template = \"Free Novgorodian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
            create_unit = {
                division = "name = \"Free Novgorodian Division\" division_template = \"Free Novgorodian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Novgorodian Division\" division_template = \"Free Novgorodian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
            create_unit = {
                division = "name = \"Free Novgorodian Division\" division_template = \"Free Novgorodian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Novgorodian Division\" division_template = \"Free Novgorodian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Novgorodian Mechanized Division\" division_template = \"Free Novgorodian Mechanized Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Novgorodian Mechanized Division\" division_template = \"Free Novgorodian Mechanized Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = NOV
            }
        }
    }
}

sov_release_belarus_anarchist_collapse = {
    SOV = {
        release_on_controlled = BLR
    }
    BLR = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Belarusian Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Belarusian Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #7 Infantry Divisions and 1 Tank
            create_unit = {
                division = "name = \"Free Belarusian Division\" division_template = \"Free Belarusian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = BLR
            }
            create_unit = {
                division = "name = \"Free Belarusian Division\" division_template = \"Free Belarusian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = BLR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Belarusian Division\" division_template = \"Free Belarusian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = BLR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Belarusian Division\" division_template = \"Free Belarusian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = BLR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Belarusian Division\" division_template = \"Free Belarusian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = BLR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Belarusian Division\" division_template = \"Free Belarusian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = BLR
            }
            create_unit = {
                division = "name = \"Free Belarusian Division\" division_template = \"Free Belarusian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = BLR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Belarusian Mechanized Division\" division_template = \"Free Belarusian Mechanized Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = BLR
            }
        }
    }
}

sov_release_ukraine_anarchist_collapse = {
    SOV = {
        release_on_controlled = UKR
    }
    UKR = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        set_cosmetic_tag = FUKR
        add_country_leader_role = {
			character = UKR_Council_of_ukraine
			promote_leader = yes
			country_leader = {
				desc = UKR_Council_of_ukraine
				ideology = anarchist
				expire = "1965.1.1.1"
			}
		}
        division_template = {
           name = "Free Ukrainian Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Ukrainian Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #21 Infantry Divisions and 3 tank
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
            create_unit = {
                division = "name = \"Free Ukrainian Division\" division_template = \"Free Ukrainian Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ukrainian Mechanized Division\" division_template = \"Free Ukrainian Mechanized Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ukrainian Mechanized Division\" division_template = \"Free Ukrainian Mechanized Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Ukrainian Mechanized Division\" division_template = \"Free Ukrainian Mechanized Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = UKR
            }
        }
    }
}

sov_release_crimea_anarchist_collapse = {
    SOV = {
        release_on_controlled = CRI
    }
    CRI = {
        hidden_effect = {
            add_ideas = closed_economy
			add_ideas = low_economic_mobilisation
        }
        set_politics = {
            ruling_party = anarchy
            elections_allowed = no
        }
        set_party_name = {
            ideology = anarchy
            long_name = russia2_anarchy_people_council_russian_state_party
            name = russia2_anarchy_people_council_russian_state_party
        }
        set_popularities = {
            anarchy = 90
            democratic = 3
            neutrality = 3
            fascism = 1
            communism = 3
        }
        division_template = {
           name = "Free Crimean Division"
            is_locked = no

            regiments = {
                infantry = { x = 0 y = 0 }
                infantry = { x = 0 y = 1 }
                infantry = { x = 0 y = 2 }
                infantry = { x = 0 y = 3 }
                infantry = { x = 1 y = 0 }
                infantry = { x = 1 y = 1 }
                infantry = { x = 1 y = 2 }
                infantry = { x = 1 y = 3 }
                infantry = { x = 2 y = 0 }
            }
            support = 	{
                artillery = { x = 0 y = 0 }
            }
        }
        division_template = {
            name = "Free Crimean Mechanized Division"
             is_locked = no

             regiments = {
                light_armor = { x = 0 y = 0 }
                light_armor = { x = 0 y = 1 }
                light_armor = { x = 1 y = 0 }
                light_armor = { x = 1 y = 1 }
                motorized = { x = 2 y = 0 }
                motorized = { x = 2 y = 1 }
                motorized = { x = 2 y = 2 }
            }
        }
        delete_unit_template_and_units = {
            division_template = "Strelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Gornostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Motostrelkovaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Kavaleriyskaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "NKVD Pogranichnaya Diviziya"
        }
        delete_unit_template_and_units = {
            division_template = "Mekhanizirovaniy Korpus"
        }
        delete_unit_template_and_units = {
            division_template = "Vozdushno-Desantnaya Brigada"
        }
        random_owned_controlled_state = { #4 Infantry Divisions
            create_unit = {
                division = "name = \"Free Crimean Division\" division_template = \"Free Crimean Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = CRI
            }
            create_unit = {
                division = "name = \"Free Crimean Division\" division_template = \"Free Crimean Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = CRI
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Crimean Division\" division_template = \"Free Crimean Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = CRI
            }
        }
        random_owned_controlled_state = {
            create_unit = {
                division = "name = \"Free Crimean Division\" division_template = \"Free Crimean Division\" start_experience_factor = 0.2 start_equipment_factor = 1.0"
                owner = CRI
            }
        }
    }
}
#TODO End Update Russian State

EUR_corps_commander_generation = {
    EUR = {
        create_field_marshal = {
            name = "Alan Brooke" # Aristocrat
            picture = "gfx/leaders/EUR/Portrait_Britain_Alan_Brooke.dds"
            traits = { defensive_doctrine trait_cautious career_officer }
            skill = 5
            attack_skill = 3
            defense_skill = 5
            planning_skill = 5
            logistics_skill = 3
        }

        create_field_marshal = {
            name = "Bernard Montgomery" # Aristocrat
            picture = "gfx/leaders/EUR/Portrait_Britain_Bernard_Montgomery.dds"
            traits = { logistics_wizard offensive_doctrine media_personality trait_cautious inflexible_strategist organizer }
            skill = 4
            attack_skill = 2
            defense_skill = 4
            planning_skill = 3
            logistics_skill = 4
        }

        create_corps_commander = {
            name = "Claude Auchinleck"
            picture = "gfx/leaders/EUR/Portrait_Britain_Claude_Auchinleck.dds"
            traits = { inflexible_strategist career_officer }
            skill = 5
            attack_skill = 3
            defense_skill = 5
            planning_skill = 3
            logistics_skill = 5
        }

        create_corps_commander = {
            name = "Neil Ritchie"
            picture = "gfx/leaders/EUR/Portrait_Britain_Neil_Ritchie.dds"
            traits = { inflexible_strategist armor_officer politically_connected  }
            skill = 4
            attack_skill = 3
            defense_skill = 4
            planning_skill = 3
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Alan Cunningham"
            picture = "gfx/leaders/EUR/Portrait_Britain_Alan_Cunningham.dds"
            traits = {}
            skill = 4
            attack_skill = 4
            defense_skill = 1
            planning_skill = 4
            logistics_skill = 4
        }

        create_corps_commander = {
            name = "William Slim"
            picture = "gfx/leaders/EUR/Portrait_Britain_William_Slim.dds"
            traits = { trickster war_hero }
            skill = 5
            attack_skill = 3
            defense_skill = 3
            planning_skill = 5
            logistics_skill = 5
        }

        create_corps_commander = {
            name = "Richard O'Connor"
            picture = "gfx/leaders/EUR/Portrait_Britain_Richard_OConnor.dds"
            traits = {  }
            skill = 4
            attack_skill = 2
            defense_skill = 4
            planning_skill = 4
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "William Platt"
            picture = "gfx/leaders/EUR/Portrait_Britain_William_Platt.dds"
            traits = {  }
            skill = 3
            attack_skill = 2
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "George Giffard"
            picture = "gfx/leaders/EUR/Portrait_Britain_George_Giffard.dds"
            traits = { career_officer }
            skill = 3
            attack_skill = 2
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Harold Alexander" # Aristocrat
            picture = "gfx/leaders/EUR/Portrait_Britain_Harold_Alexander.dds"
            traits = { politically_connected }
            skill = 5
            attack_skill = 4
            defense_skill = 4
            planning_skill = 3
            logistics_skill = 5
        }

        create_corps_commander = {
            name = "Jackie Smyth"
            picture = "gfx/leaders/EUR/Portrait_Britain_John_Jackie_Smyth.dds"
            traits = { old_guard }
            skill = 1
            attack_skill = 1
            defense_skill = 1
            planning_skill = 1
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Thomas Jacomb Hutton"
                picture = "gfx/leaders/EUR/Portrait_Britain_Thomas_Jacomb_Hutton.dds"
            traits = { old_guard }
            skill = 2
            attack_skill = 2
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Arthur Percival"
                picture = "gfx/leaders/EUR/Portrait_Britain_Arthur_Percival.dds"
            traits = {  trait_cautious }
            skill = 2
            attack_skill = 2
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Merton Beckwith-Smith"
                picture = "gfx/leaders/EUR/Portrait_Britain_Merton_Beckwith_Smith.dds"
            traits = { commando }
            skill = 1
            attack_skill = 1
            defense_skill = 1
            planning_skill = 1
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Henry Pownall"
            picture = "gfx/leaders/EUR/Portrait_Britain_Henry_Pownall.dds"
            traits = {  trickster }
            skill = 2
            attack_skill = 1
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "John Vereker Lord Gort" # Aristocrat
            picture = "gfx/leaders/EUR/Portrait_Britain_John_Vereker.dds"
            traits = { politically_connected trait_cautious }
            skill = 4
            attack_skill = 3
            defense_skill = 3
            planning_skill = 4
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Henry Wilson"
                picture = "gfx/leaders/EUR/Portrait_Britain_Henry_Maitland_Wilson.dds"
            traits = { old_guard politically_connected }
            skill = 4
            attack_skill = 2
            defense_skill = 4
            planning_skill = 4
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "William Gott"
                picture = "gfx/leaders/EUR/Portrait_Britain_William_Gott.dds"
            traits = { armor_officer war_hero inflexible_strategist }
            skill = 3
            attack_skill = 2
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Jock Campbell"
                picture = "gfx/leaders/EUR/Portrait_Britain_Jock_Campbell.dds"
            traits = { armor_officer  }
            skill = 4
            attack_skill = 4
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 4
        }

        create_corps_commander = {
            name = "Oliver Leese" # Aristocrat
            picture = "gfx/leaders/EUR/Portrait_Britain_Oliver_Leese.dds"
            traits = {  armor_officer harsh_leader politically_connected }
            skill = 4
            attack_skill = 4
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 4
        }

        create_corps_commander = {
            name = "Miles Dempsey"
            picture = "gfx/leaders/EUR/Portrait_Britain_Miles_Dempsey.dds"
            traits = { brilliant_strategist infantry_officer career_officer }
            skill = 4
            attack_skill = 3
            defense_skill = 4
            planning_skill = 4
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Brian Horrocks"
            picture = "gfx/leaders/EUR/Portrait_Britain_Brian_Horrocks.dds"
            traits = {  armor_officer career_officer war_hero }
            skill = 3

            attack_skill = 1
            defense_skill = 3
            planning_skill = 3
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Archibald Wavell" # Aristocrat
            picture = "gfx/leaders/EUR/Portrait_Britain_Archibald_Wavell.dds"
            traits = { career_officer }
            skill = 4
            attack_skill = 4
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 4
        }

        create_navy_leader = {
            name = "James Fownes Somerville" # Aristocrat
                picture = "gfx/leaders/EUR/Portrait_Britain_James_Fownes_Somerville.dds"
            traits = { superior_tactician aviation_enthusiast navy_career_officer }
            skill = 5
            attack_skill = 4
            defense_skill = 3
            maneuvering_skill = 4
            coordination_skill = 5
        }

        create_navy_leader = {
            name = "Henry Harwood" # Aristocrat
                picture = "gfx/leaders/EUR/Portrait_Britain_Henry_Harwood.dds"
            traits = { old_guard_navy bold }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            maneuvering_skill = 3
            coordination_skill = 2
        }

        create_navy_leader = {
            name = "Andrew Cunningham"
                picture = "gfx/leaders/EUR/Portrait_Britain_Andrew_Cunningham.dds"
            traits = { blockade_runner superior_tactician navy_career_officer bold gunnery_expert}
            skill = 5
            attack_skill = 5
            defense_skill = 4
            maneuvering_skill = 3
            coordination_skill = 4
        }

        create_navy_leader = {
            name = "Bruce Fraser"
                picture = "gfx/leaders/EUR/Portrait_Britain_Bruce_Fraser.dds"
            traits = { aviation_enthusiast naval_lineage blockade_runner }
            skill = 4
            attack_skill = 3
            defense_skill = 2
            maneuvering_skill = 4
            coordination_skill = 4
        }

        create_navy_leader = {
            name = "John Tovey" # Aristocrat
                picture = "gfx/leaders/EUR/Portrait_Britain_John_Tovey.dds"
            traits = { gentlemanly naval_lineage superior_tactician }
            skill = 4
            attack_skill = 3
            defense_skill = 3
            maneuvering_skill = 2
            coordination_skill = 5
        }

        create_navy_leader = {
            name = "Bernard Rawlings" # Aristocrat
                picture = "gfx/leaders/EUR/Portrait_Britain_Bernard_Rawlings.dds"
            traits = { gentlemanly }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            maneuvering_skill = 3
            coordination_skill = 2
        }

        create_navy_leader = {
            name = "John Cunningham"
                picture = "gfx/leaders/EUR/Portrait_Britain_John_Cunningham.dds"
            traits = { navy_career_officer green_water_expert }
            skill = 4
            attack_skill = 2
            defense_skill = 4
            maneuvering_skill = 4
            coordination_skill = 3
        }

        create_navy_leader = {
            name = "Charles Forbes"
                picture = "gfx/leaders/EUR/Portrait_Britain_Charles_Forbes.dds"
            traits = { gunnery_expert fly_swatter }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            maneuvering_skill = 2
            coordination_skill = 3
        }

        create_navy_leader = {
            name = "Algernon Willis"
                picture = "gfx/leaders/EUR/Portrait_Britain_Algernon_Willis.dds"
            traits = { battleship_adherent spotter }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            maneuvering_skill = 3
            coordination_skill = 2
        }

        create_navy_leader = {
            name = "Arthur Power"
                picture = "gfx/leaders/EUR/Portrait_Britain_Arthur_Power.dds"
            traits = { gunnery_expert }
            skill = 2
            attack_skill = 3
            defense_skill = 1
            maneuvering_skill = 1
            coordination_skill = 2
        }

        create_corps_commander = {
            name = "Jean de Lattre de Tassigny"
            picture = "gfx/leaders/EUR/Portrait_France_Jean_de_Lattre_de_Tassigny.dds"
            traits = { trickster brilliant_strategist cavalry_officer war_hero }
            skill = 4
            attack_skill = 4
            defense_skill = 2
            planning_skill = 4
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Alphonse Juin"
            picture = "gfx/leaders/EUR/Portrait_France_Alphonse_Juin.dds"
            traits = { armor_officer career_officer trait_cautious  }
            skill = 4
            attack_skill = 3
            defense_skill = 2
            planning_skill = 4
            logistics_skill = 4
        }

        create_field_marshal = {
            name = "Maurice Gamelin"
            picture = "gfx/leaders/EUR/Portrait_France_Maurice_Gamelin.dds"
            traits = { defensive_doctrine old_guard inflexible_strategist career_officer }
            skill = 2
            attack_skill = 1
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 1
        }

        create_field_marshal = {
            name = "Maxime Weygand"
            picture = "gfx/leaders/EUR/Portrait_France_Maxime_Weygand.dds"
            traits = { defensive_doctrine old_guard inflexible_strategist career_officer }
            skill = 3
            attack_skill = 3
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 2
        }

        create_field_marshal = {
            name = "Alphonse Georges"
            picture = "gfx/leaders/EUR/Portrait_France_Alphonse_Joseph_Georges.dds"
            traits = { defensive_doctrine old_guard trait_cautious }
            skill = 3
            attack_skill = 2
            defense_skill = 2
            planning_skill = 4
            logistics_skill = 2
        }

        create_field_marshal = {
            name = "Antoine-Marie-Benoît Besson"
            picture = "gfx/leaders/EUR/Portrait_France_Generic_land_2.dds"
            traits = { defensive_doctrine old_guard }
            skill = 2
            attack_skill = 1
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Charles De Gaulle"
            picture = "gfx/leaders/EUR/Portrait_France_Charles_De_Gaulle.dds"
            traits = {  armor_officer harsh_leader media_personality }
            skill = 4
            attack_skill = 4
            defense_skill = 4
            planning_skill = 3
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "gfx/leaders/EUR/Philippe Leclerc"
            picture = "gfx/leaders/EUR/Portrait_france_philippe_leclerc.dds"
            traits = {  armor_officer trait_reckless career_officer }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Henri Giraud"
            picture = "gfx/leaders/EUR/Portrait_france_henri_giraud.dds"
            traits = {  trickster trait_cautious career_officer infantry_officer }
            skill = 3
            attack_skill = 2
            defense_skill = 2
            planning_skill = 4
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Charles Huntziger"
            picture = "gfx/leaders/EUR/Portrait_france_charles_huntziger.dds"
            traits = { old_guard infantry_officer }
            skill = 3
            attack_skill = 3
            defense_skill = 1
            planning_skill = 3
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Gaston-Henri Billotte"
            picture = "gfx/leaders/EUR/Portrait_France_Generic_land_1.dds"
            traits = { old_guard trait_cautious infantry_officer }
            skill = 2
            attack_skill = 1
            defense_skill = 3
            planning_skill = 1
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Henry Freydenberg"
            picture = "gfx/leaders/EUR/Portrait_France_Generic_land_3.dds"
            traits = { old_guard infantry_officer }
            skill = 2
            attack_skill = 1
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "René Olry"
            picture = "gfx/leaders/EUR/Portrait_France_Generic_land_5.dds"
            traits = { old_guard infantry_officer trait_mountaineer }
            skill = 3
            attack_skill = 2
            defense_skill = 4
            planning_skill = 2
            logistics_skill = 2
        }

        create_navy_leader = {
            name = "François Darlan"
            picture = "gfx/leaders/EUR/Portrait_France_Francois_Darlan.dds"
            traits = { naval_lineage bold superior_tactician }
            skill = 3
            attack_skill = 2
            defense_skill = 2
            maneuvering_skill = 3
            coordination_skill = 3
        }

        create_navy_leader = {
            name = "Jean-Marie Charles Abrial"
            picture = "gfx/leaders/EUR/Portrait_France_Jean-Marie_Charles_Abrial.dds"
            traits = { chief_engineer superior_tactician }
            skill = 3
            attack_skill = 2
            defense_skill = 3
            maneuvering_skill = 3
            coordination_skill = 2
        }

        create_navy_leader = {
            name = "Jean-Pierre Esteva"
            picture = "gfx/leaders/EUR/Portrait_France_Jean-Pierre_Esteva.dds"
            traits = { aviation_enthusiast }
            skill = 2
            attack_skill = 1
            defense_skill = 2
            maneuvering_skill = 2
            coordination_skill = 2
        }

        create_navy_leader = {
            name = "René-Émile Godfroy"
            picture = "gfx/leaders/EUR/Portrait_France_Rene-Emile_Godfroy.dds"
            traits = { gentlemanly battleship_adherent old_guard_navy spotter }
            skill = 2
            attack_skill = 2
            defense_skill = 1
            maneuvering_skill = 2
            coordination_skill = 2
        }

        create_navy_leader = {
            name = "Jean de Laborde"
            picture = "gfx/leaders/EUR/Portrait_France_Jean_de_Laborde.dds"
            traits = { naval_lineage aviation_enthusiast }
            skill = 1
            attack_skill = 1
            defense_skill = 1
            maneuvering_skill = 1
            coordination_skill = 1
        }

        create_field_marshal = {
            name = "Gerd von Rundstedt"
            picture = "gfx/leaders/EUR/Portrait_Germany_Gerd_von_Rundstedt.dds"
            traits = { defensive_doctrine urban_assault_specialist old_guard }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 2
        }

        create_field_marshal = {
            name = "Günther von Kluge"
            picture = "gfx/leaders/EUR/Portrait_Germany_Gunther_von_Kluge.dds"
            traits = {  offensive_doctrine armor_officer }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Friedrich Paulus"
            picture = "gfx/leaders/EUR/Portrait_Germany_Friedrich_Paulus.dds"
            traits = { trait_cautious armor_officer }
            skill = 1
            attack_skill = 1
            defense_skill = 1
            planning_skill = 1
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Erwin Rommel"
            picture = "gfx/leaders/EUR/Portrait_Germany_Erwin_Rommel.dds"
            traits = { trickster trait_reckless war_hero armor_officer media_personality }
            skill = 4
            attack_skill = 4
            defense_skill = 4
            planning_skill = 2
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Erich von Manstein"
            picture = "gfx/leaders/EUR/Portrait_Germany_Erich_von_Manstein.dds"
            traits = { trickster armor_officer brilliant_strategist trait_engineer }
            skill = 4
            attack_skill = 2
            defense_skill = 4
            planning_skill = 3
            logistics_skill = 4
        }

        create_corps_commander = {
            name = "Heinz Guderian"
            picture = "gfx/leaders/EUR/Portrait_Germany_Heinz_Guderian.dds"
            traits = { trickster brilliant_strategist panzer_leader armor_officer career_officer }
            skill = 4
            attack_skill = 2
            defense_skill = 4
            planning_skill = 4
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Wilhelm List"
            picture = "gfx/leaders/EUR/Portrait_Germany_Wilhelm_List.dds"
            traits = { career_officer inflexible_strategist }
            skill = 2
            attack_skill = 2
            defense_skill = 2
            planning_skill = 1
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Ewald von Kleist"
            desc = ""
            picture = "gfx/leaders/EUR/Portrait_Germany_Ewald_von_Kleist.dds"
            traits = { armor_officer trait_cautious }
            skill = 2
            attack_skill = 2
            defense_skill = 1
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Fedor von Bock"
            picture = "gfx/leaders/EUR/Portrait_Germany_Fedor_von_Bock.dds"
            traits = { harsh_leader trait_cautious }
            skill = 4
            attack_skill = 4
            defense_skill = 3
            planning_skill = 4
            logistics_skill = 2
        }

        create_field_marshal = {
            name = "Walter Model"
            picture = "gfx/leaders/EUR/Portrait_Germany_Walter_Model.dds"
            traits = { defensive_doctrine brilliant_strategist trait_cautious politically_connected }
            skill = 3
            attack_skill = 2
            defense_skill = 4
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Maximilian von Weichs"
            picture = "gfx/leaders/EUR/Portrait_Germany_Maximilian_von_Weichs.dds"
            traits = { cavalry_officer }
            skill = 4
            attack_skill = 4
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 4
        }

        create_corps_commander = {
            name = "Wilhelm Ritter von Leeb"
            picture = "gfx/leaders/EUR/Portrait_Germany_Wilhelm_Ritter_von_Leeb.dds"
            traits = { old_guard infantry_officer }
            skill = 3
            attack_skill = 4
            defense_skill = 3
            planning_skill = 1
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Georg-Hans Reinhardt"
            picture = "gfx/leaders/EUR/Portrait_Germany_Georg_von_Reinhardt.dds"
            traits = { trait_cautious armor_officer }
            skill = 3
            attack_skill = 1
            defense_skill = 2
            planning_skill = 4
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Walter Krüger"
            picture = "gfx/leaders/EUR/Portrait_Germany_Walter_Kruger.dds"
            traits = { armor_officer trait_reckless politically_connected}
            skill = 3
            attack_skill = 3
            defense_skill = 3
            planning_skill = 1
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Kurt Student"
            picture = "gfx/leaders/EUR/Portrait_Germany_Kurt_Student.dds"
            traits = { commando trait_reckless }
            skill = 4
            attack_skill = 4
            defense_skill = 2
            planning_skill = 4
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Erwin von Witzleben"
            picture = "gfx/leaders/EUR/Portrait_Germany_Erwin_von_Witzleben.dds"
            traits = { infantry_officer career_officer }
            skill = 4
            attack_skill = 4
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 4
        }

        create_corps_commander = {
            name = "Hermann Hoth"
            picture = "gfx/leaders/EUR/Portrait_Germany_Herman_Hoth.dds"
            traits = { trait_reckless armor_officer }
            skill = 3
            attack_skill = 2
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Johannes Blaskowitz"
            picture = "gfx/leaders/EUR/Portrait_Germany_Johannes_Blaskowitz.dds"
            traits = { infantry_officer }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "gfx/leaders/EUR/Paul Hausser"
            picture = "gfx/leaders/EUR/Portrait_Germany_Paul_Hausser.dds"
            traits = {  armor_officer politically_connected }
            skill = 4
            attack_skill = 3
            defense_skill = 3
            planning_skill = 4
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Friedrich Schulz"
            picture = "gfx/leaders/EUR/Portrait_Germany_Friedrich_Schulz.dds"
            traits = { infantry_officer }
            skill = 3
            attack_skill = 3
            defense_skill = 3
            planning_skill = 1
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Georg von Küchler"
            picture = "gfx/leaders/EUR/Portrait_Germany_Georg_von_Kuchler.dds"
            traits = {  }
            skill = 4
            attack_skill = 3
            defense_skill = 2
            planning_skill = 4
            logistics_skill = 4
        }

        create_corps_commander = {
            name = "Alfred Jodl"
            picture = "gfx/leaders/EUR/Portrait_Germany_Alfred_Jodl.dds"
            traits = { politically_connected career_officer }
            skill = 3
            attack_skill = 2
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Sepp Dietrich"
            picture = "gfx/leaders/EUR/Portrait_Germany_Josef_Dietrich.dds"
            traits = { armor_officer politically_connected brilliant_strategist trait_reckless }
            skill = 4
            attack_skill = 2
            defense_skill = 3
            planning_skill = 4
            logistics_skill = 4
        }

        create_corps_commander = {
            name = "Hasso von Manteuffel"
                picture = "gfx/leaders/EUR/Portrait_Germany_Hasso_von_Manteuffel.dds"
            traits = { armor_officer career_officer trait_cautious }
            skill = 4
            attack_skill = 4
            defense_skill = 3
            planning_skill = 3
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Albert Kesselring"
            picture = "gfx/leaders/EUR/Portrait_Germany_Albert_Kesselring.dds"
            traits = { brilliant_strategist trait_cautious war_hero }
            skill = 4
            attack_skill = 2
            defense_skill = 4
            planning_skill = 3
            logistics_skill = 4
        }

        create_corps_commander = {
            name = "Gotthard Heinrici"
            picture = "gfx/leaders/EUR/Portrait_Germany_Gotthard_Heinrici.dds"
            traits = { trait_engineer infantry_officer trait_cautious }
            skill = 3
            attack_skill = 3
            defense_skill = 1
            planning_skill = 3
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Ernst-Eberhard Hell"
            picture = "gfx/leaders/EUR/Portrait_Germany_Ernst_Eberhard_Hell.dds"
            traits = { winter_specialist trait_engineer war_hero }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Felix Steiner"
            picture = "gfx/leaders/EUR/Portrait_ger_felix_steiner.dds"
            traits = {  }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 2
        }

        create_navy_leader = {
            name = "Karl Dönitz"
            picture = "gfx/leaders/EUR/Portrait_Germany_Karl_Donitz.dds"
            traits = { navy_career_officer seawolf }
            skill = 5
            attack_skill = 5
            defense_skill = 3
            maneuvering_skill = 3
            coordination_skill = 5
        }

        create_navy_leader = {
            name = "Erich Raeder"
                picture = "gfx/leaders/EUR/Portrait_Germany_Erich_Raeder.dds"
            traits = { naval_lineage battleship_adherent }
            skill = 4
            attack_skill = 3
            defense_skill = 4
            maneuvering_skill = 3
            coordination_skill = 3
        }

        create_navy_leader = {
            name = "Alfred Saalwächter"
                picture = "gfx/leaders/EUR/Portrait_Germany_Alfred_Saalwachter.dds"
            traits = { old_guard_navy bold}
            skill = 4
            attack_skill = 4
            defense_skill = 2
            maneuvering_skill = 3
            coordination_skill = 4
        }

        create_navy_leader = {
            name = "Hermann Boehm"
                picture = "gfx/leaders/EUR/Portrait_Germany_Hermann_Boehm.dds"
            traits = { craven superior_tactician }
            skill = 4
            attack_skill = 3
            defense_skill = 4
            maneuvering_skill = 4
            coordination_skill = 2
        }

        create_navy_leader = {
            name = "Wilhelm Marschall"
                picture = "gfx/leaders/EUR/Portrait_Germany_Wilhelm_Marschall.dds"
            traits = { old_guard_navy bold}
            skill = 4
            attack_skill = 4
            defense_skill = 2
            maneuvering_skill = 3
            coordination_skill = 4
        }

        create_navy_leader = {
            name = "Günther Lütjens"
                picture = "gfx/leaders/EUR/Portrait_Germany_Gunter_Lutjens.dds"
            traits = { gentlemanly navy_career_officer superior_tactician }
            skill = 3
            attack_skill = 4
            defense_skill = 1
            maneuvering_skill = 1
            coordination_skill = 4
        }
    }
}

EAR_corps_commander_generation = {
    EAR = {
        create_corps_commander = {
            name = "Tomoyuki Yamashita"
                picture = "Portrait_Japan_Tomoyuki_Yamashita.dds"
            traits = {
                trickster trait_engineer brilliant_strategist politically_connected
            }
            skill = 5
            attack_skill = 4
            defense_skill = 5
            planning_skill = 3
            logistics_skill = 4
        }

        create_field_marshal = {
            name = "Hisaichi Terauchi"
            picture = "Portrait_Japan_Hisaichi_Terauchi.dds"
            traits = {
                offensive_doctrine
                JAP_samurai_lineage   # hakushaku
                politically_connected
            }
            skill = 4
            attack_skill = 4
            defense_skill = 4
            planning_skill = 3
            logistics_skill = 2
        }

        create_field_marshal = {
            name = "Shunroku Hata"
                picture = "Portrait_Japan_Shunroku_Hata.dds"
            traits = { offensive_doctrine JAP_samurai_lineage }
            skill = 4
            attack_skill = 3
            defense_skill = 4
            planning_skill = 2
            logistics_skill = 4
        }

        create_corps_commander = {
            name = "Akira Muto"
                picture = "Portrait_Japan_Akira_Muto.dds"
            traits = { career_officer  }
            skill = 2
            attack_skill = 2
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Kanji Ishiwara"
                picture = "Portrait_Japan_Kanji_Ishiwara.dds"
            traits = { JAP_samurai_lineage }
            skill = 1
            attack_skill = 1
            defense_skill = 1
            planning_skill = 1
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Shizuichi Tanaka"
                picture = "Portrait_Japan_Shizuichi_Tanaka.dds"
            traits = { trickster career_officer infantry_officer }
            skill = 4
            attack_skill = 4
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 4
        }

        create_corps_commander = {
            name = "Yasuji Okamura"
                picture = "Portrait_Japan_Yasuji_Okamura.dds"
            traits = { trait_reckless }
            skill = 1
            attack_skill = 1
            defense_skill = 1
            planning_skill = 1
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Toshizo Nishio" #Toshizo
                picture = "Portrait_Japan_Toshizo_Nishio.dds"
            traits = { brilliant_strategist infantry_officer }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Rikichi Ando" #Ando
                picture = "Portrait_Japan_Rikichi_Ando.dds"
            traits = { career_officer }
            skill = 3
            attack_skill = 1
            defense_skill = 3
            planning_skill = 3
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Naruhiko Higashikuni"
            picture = "Portrait_Japan_Naruhiko_Higashikuni.dds"
            traits = { JAP_samurai_lineage politically_connected }
            skill = 3
            attack_skill = 3
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Seishiro Itagaki"
                picture = "Portrait_Japan_Seishiro_Itagaki.dds"
            traits = { JAP_samurai_lineage inflexible_strategist trait_reckless }
            skill = 3
            attack_skill = 3
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Takashi Sakai"
                picture = "Portrait_Japan_Takashi_Sakai.dds"
            traits = { infantry_officer trait_reckless }
            skill = 3
            attack_skill = 2
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Kenji Doihara"
                picture = "Portrait_Japan_Kenji_Doihara.dds"
            traits = { career_officer substance_abuser }
            skill = 1
            attack_skill = 1
            defense_skill = 1
            planning_skill = 1
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Kenkichi Ueda"
                picture = "Portrait_Japan_Kenkichi_Ueda.dds"
            traits = { old_guard cavalry_officer trait_reckless }
            skill = 4
            attack_skill = 3
            defense_skill = 2
            planning_skill = 4
            logistics_skill = 4
        }

        create_corps_commander = {
            name = "Shigeru Honjo"
                picture = "Portrait_Japan_Shigeru_Honjo.dds"
            traits = { old_guard war_hero }
            skill = 1
            attack_skill = 1
            defense_skill = 1
            planning_skill = 1
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Yoshijiro Umezu"
                picture = "Portrait_Japan_Yoshijiro_Umezu.dds"
            traits = { trait_cautious politically_connected }
            skill = 3
            attack_skill = 3
            defense_skill = 3
            planning_skill = 1
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Otozo Yamada"
                picture = "Portrait_Japan_Otozo_Yamada.dds"
            traits = { cavalry_officer career_officer }
            skill = 3
            attack_skill = 3
            defense_skill = 1
            planning_skill = 3
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Hatazo Adachi"
                picture = "Portrait_Japan_Hatazo_Adachi.dds"
            traits = { trickster JAP_samurai_lineage trait_reckless infantry_officer }
            skill = 2
            attack_skill = 1
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Iwane Matsui"
                picture = "Portrait_Japan_Iwane_Matsui.dds"
            traits = { old_guard trait_reckless }
            skill = 1
            attack_skill = 1
            defense_skill = 1
            planning_skill = 1
            logistics_skill = 1
        }
        create_corps_commander = {
            name = "Sadao Araki"
                picture = "Portrait_Japan_Sadao_Araki.dds"
            traits = { JAP_samurai_lineage }
            skill = 2
            attack_skill = 1
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Keisuke Fujie"
                picture = "Portrait_Japan_Keisuke_Fujie.dds"
            traits = { fortress_buster career_officer politically_connected }
            skill = 3
            attack_skill = 1
            defense_skill = 3
            planning_skill = 3
            logistics_skill = 3
        }
        create_corps_commander = {
            name = "Kiichiro Higuchi"
                picture = "Portrait_Japan_Kiichiro_Higuchi.dds"
            traits = { career_officer trait_cautious }
            skill = 2
            attack_skill = 2
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Masaharu Homma"
                picture = "Portrait_Japan_Masaharu_Homma.dds"
            traits = { media_personality trait_cautious }
            skill = 2
            attack_skill = 2
            defense_skill = 2
            planning_skill = 1
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Harukichi Hyakutake"
                picture = "Portrait_Japan_Harukichi_Hyakutake.dds"
            traits = { infantry_officer  }
            skill = 3
            attack_skill = 2
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Jo Iimura"
                picture = "Portrait_Japan_Jo_Iimura.dds"
            traits = { career_officer }
            skill = 2
            attack_skill = 1
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Hitoshi Imamura"
                picture = "Portrait_Japan_Hitoshi_Imamura.dds"
            traits = {  commando career_officer infantry_officer }
            skill = 3
            attack_skill = 3
            defense_skill = 1
            planning_skill = 3
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Masatane Kanda"
                picture = "Portrait_Japan_Masatane_Kanda.dds"
            traits = { trait_cautious }
            skill = 2
            attack_skill = 2
            defense_skill = 2
            planning_skill = 1
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Kuniaki Koiso"
                picture = "Portrait_Japan_Kuniaki_Koiso.dds"
            traits = { JAP_samurai_lineage old_guard politically_connected }
            skill = 2
            attack_skill = 2
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 1
        }

        create_field_marshal = {
            name = "Tu Yu-ming"
            picture = "GFX_portrait_chi_du_yuming"
            traits = { defensive_doctrine trait_cautious armor_officer harsh_leader }
            skill = 4
            attack_skill = 4
            defense_skill = 4
            planning_skill = 2
            logistics_skill = 3
        }

        create_field_marshal = {
            name = "Hsueh Yueh"
            picture = "GFX_portrait_chi_xue_yue"
            traits = { offensive_doctrine trait_reckless brilliant_strategist war_hero }
            skill = 3
            attack_skill = 3
            defense_skill = 3
            planning_skill = 1
            logistics_skill = 3
        }

        create_field_marshal = {
            name = "Tai An-lan"
            picture = "GFX_portrait_chi_tai_an_lan"
            traits = {  offensive_doctrine trait_reckless career_officer }
            skill = 3
            attack_skill = 3
            defense_skill = 3
            planning_skill = 3
            logistics_skill = 1
        }

        create_field_marshal = {
            name = "Wang Yao-wu"
            picture = "GFX_portrait_chi_wang_yaowu"
            traits = { defensive_doctrine trait_cautious infantry_officer }
            skill = 2
            attack_skill = 2
            defense_skill = 1
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Sun Li Jen"
            picture = "GFX_portrait_chi_sun_li_jen"
            traits = { brilliant_strategist }
            skill = 4
            attack_skill = 5
            defense_skill = 4
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Hu Zongnan"
            picture = "GFX_portrait_chi_hu_zongnan"
            traits = { politically_connected }
            skill = 4
            attack_skill = 4
            defense_skill = 3
            planning_skill = 3
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Gu Zhutong"
            picture = "GFX_portrait_chi_gu_zhutong"
            traits = { career_officer }
            skill = 3
            attack_skill = 3
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Wei Lihuang"
            picture = "GFX_portrait_chi_wei_lihuang"
            traits = { infantry_officer }
            skill = 3
            attack_skill = 3
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Fu Zuoyi"
            picture = "GFX_portrait_chi_fu_zuoyi"
            traits = { }
            skill = 3
            attack_skill = 3
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 2
        }

        create_field_marshal = {
            name = "Zhang Xueliang"
            picture = "GFX_portrait_chi_zhang_xueliang"
            traits = { }
            skill = 3
            attack_skill = 3
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 2
        }

        create_navy_leader = {
            name = "Isoroku Yamamoto"
                picture = "Portrait_Japan_Isoroku_Yamamoto.dds"
            traits = { aviation_enthusiast bold air_controller flight_deck_manager superior_tactician spotter }
            skill = 5
            attack_skill = 5
            defense_skill = 2
            maneuvering_skill = 3
            coordination_skill = 6
        }

        create_navy_leader = {
            name = "Mineichi Koga"
                picture = "Portrait_Japan_Mineichi_Koga.dds"
            traits = { bold battleship_adherent superior_tactician spotter }
            skill = 4
            attack_skill = 4
            defense_skill = 2
            maneuvering_skill = 4
            coordination_skill = 3
        }

        create_navy_leader = {
            name = "Kiyoshi Hasegawa"
                picture = "Portrait_Japan_Hasegawa_Kiyoshi.dds"
            traits = { gentlemanly }
            skill = 2
            attack_skill = 2
            defense_skill = 2
            maneuvering_skill = 1
            coordination_skill = 2
        }

        # Keen on planes
        create_navy_leader = {
            name = "Shigeyoshi Inoue"
                picture = "Portrait_Japan_Shigeyoshi_Inoue.dds"
            traits = { aviation_enthusiast navy_career_officer }
            skill = 2
            attack_skill = 2
            defense_skill = 1
            maneuvering_skill = 1
            coordination_skill = 3
        }

        create_navy_leader = {
            name = "Nobutake Kondō"
                picture = "Portrait_Japan_Nobutake_Kondo.dds"
            traits = { battleship_adherent naval_lineage fly_swatter }
            skill = 3
            attack_skill = 4
            defense_skill = 2
            maneuvering_skill = 2
            coordination_skill = 2
        }

        create_navy_leader = {
            name = "Takeo Takagi"
                picture = "Portrait_Japan_Takeo_Takagi.dds"
            traits = { spotter }
            skill = 3
            attack_skill = 3
            defense_skill = 1
            maneuvering_skill = 3
            coordination_skill = 3
        }

        create_navy_leader = {
            name = "Soemu Toyoda"
                picture = "Portrait_Japan_Soemu_Toyoda.dds"
            traits = { bold ironside old_guard_navy }
            skill = 3
            attack_skill = 5
            defense_skill = 1
            maneuvering_skill = 2
            coordination_skill = 2
        }

        create_navy_leader = {
            name = "Jisaburo Ozawa"
                picture = "Portrait_Japan_Jisaburo_Ozawa.dds"
            traits = { bold aviation_enthusiast navy_career_officer blockade_runner superior_tactician }
            skill = 5
            attack_skill = 5
            defense_skill = 3
            maneuvering_skill = 3
            coordination_skill = 4
        }

        create_navy_leader = {
            name = "Zengo Yoshida"
                picture = "Portrait_Japan_Zengo_Yoshida.dds"
            traits = { old_guard_navy }
            skill = 2
            attack_skill = 2
            defense_skill = 2
            maneuvering_skill = 1
            coordination_skill = 2
        }

        create_navy_leader = {
            name = "Hiroaki Abe"
                picture = "Portrait_Japan_Hiroaki_Abe.dds"
            traits = { battleship_adherent }
            skill = 2
            attack_skill = 3
            defense_skill = 1
            maneuvering_skill = 2
            coordination_skill = 1
        }

        create_navy_leader = {
            name = "Tadashige Daigo"
                picture = "Portrait_Japan_Tadashige_Daigo.dds"
            traits = { navy_career_officer seawolf }
            skill = 1
            attack_skill = 1
            defense_skill = 1
            maneuvering_skill = 1
            coordination_skill = 1
        }

        create_navy_leader = {
            name = "Gengo Hyakutake"
                picture = "Portrait_Japan_Gengo_Hyakutake.dds"
            traits = { gentlemanly }
            skill = 2
            attack_skill = 1
            defense_skill = 2
            maneuvering_skill = 2
            coordination_skill = 2
        }
    }
}

NAF_corps_commander_generation = {
    NAF = {
        create_corps_commander = {
            name = "George S. Patton"
            picture = "Portrait_USA_George_S_Patton.dds"
            traits = {  trickster armor_officer panzer_leader war_hero trait_reckless }
            skill = 5

            attack_skill = 7
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 4
        }

        create_corps_commander = {
            name = "Omar Bradley"
            picture = "Portrait_USA_Omar_Bradley.dds"
            traits = {  trait_engineer trait_cautious brilliant_strategist harsh_leader }
            skill = 5

            attack_skill = 3
            defense_skill = 5
            planning_skill = 4
            logistics_skill = 4
        }

        create_field_marshal = {
            name = "Dwight D. Eisenhower"
            picture = "Portrait_USA_Dwight_D_Eisenhower.dds"
            traits = { logistics_wizard organizer offensive_doctrine trait_cautious armor_officer politically_connected }
            skill = 5
            attack_skill = 3
            defense_skill = 3
            planning_skill = 5
            logistics_skill = 5
        }

        create_corps_commander = {
            name = "Geoffrey Keyes"
            picture = "Portrait_USA_Geoffrey_Keyes.dds"
            traits = { armor_officer career_officer }
            skill = 2

            attack_skill = 2
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Lucian Truscott"
            picture = "Portrait_USA_Lucian_Truscott.dds"
            traits = { trait_engineer commando cavalry_officer }
            skill = 3

            attack_skill = 3
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Mark Clark"
            picture = "Portrait_USA_Mark_W_Clark.dds"
            traits = { infantry_officer trait_reckless }
            skill = 4

            attack_skill = 5
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 3
        }

        create_field_marshal = {
            name = "Douglas MacArthur"
            picture = "Portrait_USA_Douglas_MacArthur.dds"
            traits = {  offensive_doctrine brilliant_strategist career_officer media_personality politically_connected }
            skill = 4

            attack_skill = 4
            defense_skill = 3
            planning_skill = 4
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Walter Krueger"
            picture = "Portrait_USA_Walter_Krueger.dds"
            traits = { armor_officer career_officer brilliant_strategist }
            skill = 3

            attack_skill = 3
            defense_skill = 3
            planning_skill = 1
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Lloyd Fredendall"
            picture = "Portrait_USA_Lloyd_Fredendall.dds"
            traits = { old_guard infantry_officer inflexible_strategist }
            skill = 2

            attack_skill = 3
            defense_skill = 2
            planning_skill = 1
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Leslie McNair"
            picture = "Portrait_USA_Lesley_McNair.dds"
            traits = {  old_guard career_officer armor_officer }
            skill = 3

            attack_skill = 1
            defense_skill = 2
            planning_skill = 4
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Jonathan Wainwright"
            picture = "Portrait_USA_Jonathan_Wainwright.dds"
            traits = {  }
            skill = 1
            attack_skill = 1
            defense_skill = 1
            planning_skill = 1
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Russell Hartle"
            picture = "Portrait_USA_Russell_P_Hartle.dds"
            traits = { infantry_officer }
            skill = 1
            attack_skill = 1
            defense_skill = 1
            planning_skill = 1
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Leonard Gerow"
            picture = "Portrait_USA_Leonard_T_Gerow.dds"
            traits = { infantry_officer }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Edward Brooks"
            picture = "Portrait_USA_Edward_Brooks.dds"
            traits = { armor_officer trait_reckless }
            skill = 2
            attack_skill = 2
            defense_skill = 1
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Clarence Huebner"
            picture = "Portrait_USA_Clarence_Huebner.dds"
            traits = { old_guard harsh_leader }
            skill = 2
            attack_skill = 1
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Alexander Patch"
            picture = "Portrait_USA_Alexander_Patch.dds"
            traits = {  commando infantry_officer }
            skill = 3

            attack_skill = 3
            defense_skill = 2
            planning_skill = 2
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "William Simpson"
            picture = "Portrait_USA_William_Hood_Simpson.dds"
            traits = { infantry_officer }
            skill = 3

            attack_skill = 2
            defense_skill = 4
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "J. Lawton Collins"
            picture = "Portrait_USA_Lawton_Collins.dds"
            traits = {  trickster career_officer }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            planning_skill = 3
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Courtney Hodges"
            picture = "Portrait_USA_Cortney_Hodges.dds"
            traits = {  panzer_leader career_officer infantry_officer }
            skill = 4
            attack_skill = 4
            defense_skill = 3
            planning_skill = 2
            logistics_skill = 4
        }

        create_corps_commander = {
            name = "Joseph Stilwell"
            picture = "Portrait_USA_Joseph_Stilwell.dds"
            traits = { politically_connected infantry_officer career_officer harsh_leader }
            skill = 1
            attack_skill = 1
            defense_skill = 1
            planning_skill = 1
            logistics_skill = 1
        }

        create_corps_commander = {
            name = "Oscar Griswold"
            picture = "Portrait_USA_Oscar_Griswold.dds"
            traits = { infantry_officer  }
            skill = 2
            attack_skill = 2
            defense_skill = 1
            planning_skill = 2
            logistics_skill = 2
        }

        create_corps_commander = {
            name = "Maurice Rose"
            picture = "Portrait_USA_Maurice_Rose.dds"
            traits = { armor_officer trait_reckless brilliant_strategist  }
            skill = 3
            attack_skill = 4
            defense_skill = 1
            planning_skill = 2
            logistics_skill = 3
        }

        create_navy_leader = {
            name = "Ernest King"
                picture = "Portrait_USA_Earnest_King.dds"
            traits = { navy_career_officer aviation_enthusiast caustic_personality blockade_runner superior_tactician }
            skill = 5
            attack_skill = 4
            defense_skill = 3
            maneuvering_skill = 3
            coordination_skill = 6
        }

        create_navy_leader = {
            name = "Chester W. Nimitz"
                picture = "Portrait_USA_Chester_W_Nimitz.dds"
            traits = { gentlemanly blue_water_expert naval_lineage superior_tactician spotter }
            skill = 5
            attack_skill = 3
            defense_skill = 3
            maneuvering_skill = 5
            coordination_skill = 5
        }

        create_navy_leader = {
            name = "William Halsey, Jr."
                picture = "Portrait_USA_William_Halsey_Jr.dds"
            traits = { bold aviation_enthusiast superior_tactician spotter }
            skill = 4
            attack_skill = 5
            defense_skill = 3
            maneuvering_skill = 3
            coordination_skill = 2
        }

        create_navy_leader = {
            name = "Frank Jack Fletcher"
                picture = "Portrait_USA_Frank_Jack_Fletcher.dds"
            traits = { gunnery_expert superior_tactician spotter }
            skill = 3
            attack_skill = 2
            defense_skill = 2
            maneuvering_skill = 3
            coordination_skill = 3
        }

        create_navy_leader = {
            name = "Raymond A. Spruance"
                picture = "Portrait_USA_Raymond_A_Spruance.dds"
            traits = { navy_career_officer gentlemanly superior_tactician }
            skill = 4
            attack_skill = 4
            defense_skill = 3
            maneuvering_skill = 3
            coordination_skill = 3
        }

        create_navy_leader = {
            name = "Harold Rainsford Stark"
                picture = "Portrait_USA_Harold_Rainsford_Stark.dds"
            traits = { cuts_corners blockade_runner spotter }
            skill = 2
            attack_skill = 2
            defense_skill = 1
            maneuvering_skill = 2
            coordination_skill = 2
        }

        create_navy_leader = {
            name = "Arleigh Burke"
                picture = "Portrait_USA_Arleigh_Burke.dds"
            traits = { bold fleet_protector old_guard_navy superior_tactician }
            skill = 4
            attack_skill = 3
            defense_skill = 3
            maneuvering_skill = 3
            coordination_skill = 4
        }

        create_navy_leader = {
            name = "Charles M. Cooke, Jr."
                picture = "Portrait_USA_Charles_M_Cooke.dds"
            traits = { career_officer }
            skill = 2
            attack_skill = 1
            defense_skill = 1
            maneuvering_skill = 2
            coordination_skill = 3
        }

        create_corps_commander = {
            name = "Thomas Victor Anderson"
            picture = "gfx/leaders/Europe/Portrait_Europe_Generic_land_3.dds"
            traits = {  }
            skill = 4
            attack_skill = 2
            defense_skill = 3
            planning_skill = 3
            logistics_skill = 5
        }

        create_field_marshal = {
            name = "Charles Foulkes"
            picture = "GFX_CAN_charles_foulkes"
            traits = { }
            skill = 4
            attack_skill = 4
            defense_skill = 2
            planning_skill = 4
            logistics_skill = 3
        }

        create_corps_commander = {
            name = "Percival John Montague"
            picture = "gfx/leaders/Europe/Portrait_Europe_Generic_land_2.dds"
            traits = { }
            skill = 3
            attack_skill = 1
            defense_skill = 1
            planning_skill = 3
            logistics_skill = 5
        }
        create_corps_commander = {
            name = "Bert Hoffmeister"
            picture = "GFX_CAN_bert_hoffmeister"
            traits = { hill_fighter }
            skill = 4
            attack_skill = 4
            defense_skill = 3
            planning_skill = 3
            logistics_skill = 3
        }

        create_navy_leader = {
            name = "Leonard W. Murray"
            picture = "GFX_CAN_leonard_warren_murray"
            traits = { }
            skill = 4
            attack_skill = 4
            defense_skill = 3
            maneuvering_skill = 3
            coordination_skill = 3
        }

        create_navy_leader = {
            name = "H.T. Baillie-Grohman"
            picture = "gfx/leaders/Europe/Portrait_Europe_Generic_navy_2.dds"
            traits = { spotter }
            skill = 4
            attack_skill = 3
            defense_skill = 3
            maneuvering_skill = 3
            coordination_skill = 4
        }
        create_navy_leader = {
            name = "James D. Prentice"
            picture = "GFX_CAN_james_prentice"
            traits = { spotter }
            skill = 3
            attack_skill = 3
            defense_skill = 2
            maneuvering_skill = 3
            coordination_skill = 2
        }
        create_navy_leader = {
            name = "Harry DeWolf"
            picture = "GFX_CAN_harry_dewolf"
            traits = { superior_tactician bold }
            skill = 4
            attack_skill = 3
            defense_skill = 2
            maneuvering_skill = 3
            coordination_skill = 5
        }
    }
}

give_core_to_EAC_puppet = {
    every_state = {
        limit = {
            OR = {
               state = 766
               state = 78
               state = 80
               state = 79
               state = 46
               state = 77
               state = 76
               state = 84
               state = 83
               state = 82
               state = 81
               state = 89
               state = 91
               state = 93
               state = 94
               state = 95
               state = 96
               state = 784
               state = 11
               state = 814
               state = 815
               state = 189
               state = 188
               state = 810
               state = 809
               state = 12
               state = 808
               state = 190
               state = 191
               state = 13
               state = 813
               state = 812
               state = 811
               state = 211
               state = 801
               state = 212
               state = 48
               state = 797
               state = 341
               state = 184
               state = 731
               state = 47
               state = 185
               state = 186
               state = 187
               state = 182
               state = 164
               state = 183
               state = 805
               state = 44
               state = 106
               state = 803
               state = 802
               state = 108
               state = 107
               state = 764
               state = 45
               state = 109
               state = 104
               state = 804
               state = 105
               state = 103
               state = 102
               state = 163
               state = 154
               state = 43
               state = 155
               state = 73
               state = 88
               state = 92
               state = 97
               state = 98
               state = 10
               state = 90
               state = 762
               state = 87
               state = 73
               state = 71
               state = 70
               state = 664
               state = 72
               state = 152
               state = 4
               state = 69
               state = 9
               state = 75
               state = 74
               state = 66
               state = 67
               state = 86
               state = 68
               state = 853
               state = 934
               state = 970
               state = 971
               state = 972
               state = 973
               state = 974
               state = 975
               state = 976
            }
        }
        EAC = {
            add_state_core = PREV
        }
    }
}

give_core_to_NAC_puppet = {
    every_state = {
        limit = {
            OR = {
               state = 763
               state = 5
               state = 807
               state = 85
               state = 63
               state = 62
               state = 61
               state = 58
               state = 99
               state = 37
               state = 138
               state = 139
               state = 124
               state = 140
               state = 141
               state = 145
               state = 38
               state = 666
               state = 111
               state = 146
               state = 150
               state = 149
               state = 148
               state = 147
               state = 722
               state = 144
               state = 143
               state = 142
               state = 110
               state = 123
               state = 127
               state = 338
               state = 126
               state = 125
               state = 129
               state = 128
               state = 122
               state = 132
               state = 130
               state = 131
               state = 133
               state = 121
               state = 136
               state = 120
               state = 337
               state = 100
               state = 101
               state = 119
               state = 134
               state = 135
               state = 113
               state = 909
               state = 910
               state = 911
               state = 912
               state = 913
               state = 914
               state = 915
               state = 916
               state = 917
               state = 918
               state = 919
               state = 920
               state = 921
               state = 922
               state = 923
               state = 924
               state = 925
               state = 926
               state = 927
               state = 928
               state = 929
               state = 930
               state = 931
               state = 932
               state = 933
            }
        }
        NAC = {
            add_state_core = PREV
        }
    }
}

give_core_to_WAC_puppet = {
    every_state = {
        limit = {
            OR = {
               state = 64
               state = 65
               state = 60
               state = 54
               state = 53
               state = 52
               state = 153
               state = 50
               state = 42
               state = 55
               state = 51
               state = 57
               state = 56
               state = 59
               state = 36
               state = 7
               state = 35
               state = 34
               state = 6
               state = 8
               state = 29
               state = 785
               state = 18
               state = 17
               state = 28
               state = 3
               state = 151
               state = 735
               state = 32
               state = 21
               state = 22
               state = 20
               state = 26
               state = 25
               state = 31
               state = 806
               state = 19
               state = 23
               state = 30
               state = 14
               state = 15
               state = 33
               state = 27
               state = 24
               state = 16
               state = 158
               state = 161
               state = 159
               state = 160
               state = 39
               state = 736
               state = 162
               state = 157
               state = 2
               state = 117
               state = 156
               state = 115
               state = 165
               state = 794
               state = 167
               state = 168
               state = 173
               state = 118
               state = 169
               state = 789
               state = 175
               state = 170
               state = 41
               state = 793
               state = 166
               state = 176
               state = 172
               state = 792
               state = 791
               state = 788
               state = 174
               state = 790
               state = 171
               state = 180
               state = 181
               state = 112
               state = 795
               state = 179
               state = 116
               state = 177
               state = 114
               state = 1
               state = 849
               state = 852
               state = 850
               state = 848
               state = 846
               state = 847
               state = 845
               state = 851
               state = 977
               state = 978
               state = 980
            }
        }
        WAC = {
            add_state_core = PREV
        }
    }
}

give_core_to_SWA_puppet = {
    every_state = {
        limit = {
            OR = {
              state = 340
              state = 339
              state = 342
              state = 343
              state = 346
              state = 49
              state = 347
              state = 356
              state = 798
              state = 345
              state = 344
              state = 348
              state = 349
              state = 355
              state = 354
              state = 349
              state = 353
              state = 800
              state = 352
              state = 350
              state = 680
              state = 677
              state = 799
              state = 553
              state = 554
              state = 454
              state = 455
              state = 679
              state = 293
              state = 659
              state = 294
              state = 658
              state = 765
              state = 678
              state = 292
              state = 656
              state = 675
              state = 291
              state = 676
              state = 413
              state = 421
              state = 419
              state = 420
              state = 417
              state = 411
              state = 412
              state = 410
              state = 414
              state = 411
              state = 266
              state = 418
              state = 416
              state = 415
              state = 267
              state = 444
              state = 445
              state = 440
              state = 442
              state = 787
              state = 441
              state = 439
              state = 433
              state = 428
              state = 443
              state = 429
              state = 425
              state = 321
              state = 423
              state = 320
              state = 281
              state = 422
              state = 424
              state = 427
              state = 426
              state = 436
              state = 437
              state = 438
              state = 323
              state = 435
              state = 431
              state = 758
              state = 322
              state = 757
              state = 855
              state = 854
              state = 857
              state = 859
              state = 856
              state = 858
              state = 982
              state = 983
              state = 984
              state = 985
              state = 986
              state = 987
              state = 988
              state = 989
              state = 991
              state = 992
              state = 1000
              state = 1001
              state = 1002
              state = 1003
              state = 1005
              state = 1006
              state = 1007
              state = 1008
              state = 1009
              state = 1010
              state = 1011
              state = 1012
              state = 1015
              state = 1016
            }
        }
        SWA = {
            add_state_core = PREV
        }
    }
}

give_core_to_AEA_puppet = {
    every_state = {
        limit = {
            OR = {
                state = 756
                state = 619
                state = 287
                state = 759
                state = 760
                state = 617
                state = 618
                state = 818
                state = 817
                state = 330
                state = 820
                state = 819
                state = 759
                state = 755
                state = 604
                state = 754
                state = 616
                state = 283
                state = 753
                state = 601
                state = 752
                state = 751
                state = 603
                state = 748
                state = 605
                state = 744
                state = 622
                state = 615
                state = 746
                state = 621
                state = 612
                state = 611
                state = 761
                state = 714
                state = 715
                state = 610
                state = 716
                state = 328
                state = 717
                state = 527
                state = 525
                state = 745
                state = 609
                state = 536
                state = 533
                state = 282
                state = 534
                state = 535
                state = 532
                state = 531
                state = 529
                state = 530
                state = 528
                state = 526
                state = 524
                state = 645
                state = 608
                state = 614
                state = 597
                state = 743
                state = 607
                state = 598
                state = 613
                state = 606
                state = 749
                state = 596
                state = 595
                state = 600
                state = 620
                state = 750
                state = 602
                state = 593
                state = 599
                state = 592
                state = 594
                state = 591
                state = 728
                state = 729
                state = 326
                state = 555
                state = 1018
                state = 1019
                state = 1020
                state = 1028
                state = 1029
                state = 1030
                state = 1031
                state = 1032
                state = 1033
                state = 1034
                state = 1035
                state = 1036
                state = 1037
                state = 1038
                state = 1039
                state = 1040
                state = 1041
                state = 1042
                state = 1044
                state = 1043
                state = 1045
                state = 1046
            }
        }
        AEA = {
            add_state_core = PREV
        }
    }
}

give_core_to_SAE_puppet = {
    every_state = {
        limit = {
            OR = {
                state = 325
                state = 747
                state = 640
                state = 434
                state = 324
                state = 430
                state = 432
                state = 288
                state = 671
                state = 670
                state = 286
                state = 741
                state = 289
                state = 724
                state = 336
                state = 733
                state = 672
                state = 335
                state = 667
                state = 721
                state = 334
                state = 333
                state = 626
                state = 624
                state = 623
                state = 327
                state = 625
                state = 628
                state = 627
                state = 673
                state = 668
                state = 669
                state = 738
                state = 523
                state = 737
                state = 634
                state = 647
                state = 684
                state = 638
                state = 646
                state = 633
                state = 648
                state = 632
                state = 639
                state = 725
                state = 635
                state = 734
                state = 636
                state = 284
                state = 723
                state = 518
                state = 517
                state = 519
                state = 285
                state = 521
                state = 520
                state = 522
                state = 674
                state = 712
                state = 711
                state = 643
                state = 726
                state = 869
                state = 868
                state = 870
                state = 871
                state = 873
                state = 872
                state = 979
                state = 990
                state = 993
                state = 994
                state = 995
                state = 996
                state = 997
                state = 998
                state = 999
                state = 1017
                state = 1021
                state = 1022
                state = 1023
                state = 1024
                state = 1025
                state = 1026
                state = 1027
            }
        }
        SAE = {
            add_state_core = PREV
        }
    }
}

set_variable_anarchist_election_to_0 = {
    set_variable = { anarchy_intellect_party_research = 0 }
    set_variable = { anarchy_industry_party_factory = 0 }
    set_variable = { anarchy_industry_party_resources = 0 }
    set_variable = { anarchy_military_industry_party_guns = 0 }
    set_variable = { anarchy_military_industry_party_guns_fabrication = 0 }
    set_variable = { anarchy_militarist_party_training = 0 }
    set_variable = { anarchy_militarist_party_attack = 0 }
    set_variable = { anarchy_militarist_party_defence = 0 }
    set_variable = { anarchy_militarist_party_organization = 0 }
    set_variable = { anarchy_aviation_party_accident = 0 }
    set_variable = { anarchy_aviation_party_ace_generation = 0 }
    set_variable = { anarchy_aviation_party_attack = 0 }
    set_variable = { anarchy_aviation_party_defence = 0 }
    set_variable = { anarchy_aviation_party_agility = 0 }
    set_variable = { anarchy_ship_party_dockyard_cap = 0 }
    set_variable = { anarchy_ship_party_dockyard_speed = 0 }
    set_variable = { anarchy_logistic_infrastructure_build = 0 }
    set_variable = { anarchy_logistic_railway_build = 0 }
    set_variable = { anarchy_logistic_supply_consumption = 0 }
    set_variable = { anarchy_internal_sec_decryption_fac = 0 }
    set_variable = { anarchy_internal_sec_encryption_fac = 0 }
    set_variable = { anarchy_internal_sec_anarchy_drift_fac = 0 }
    set_variable = { anarchy_country_side_party_globalbuilding_slot = 0 }
    set_variable = { anarchy_theorist_party_refinery_speed = 0 }
    set_variable = { anarchy_theorist_party_nuclear_speed = 0 }
    set_variable = { anarchy_theorist_party_rocket_speed = 0 }
}

set_variable_for_winning_anarchist_party_election = {
    if = {
        limit = {
            check_variable = {
                var = sov_anarchist_election_current_ruling_party
                value = 0
                compare = equals
            }
        }
        custom_effect_tooltip = research_anarchist_election_bonus_3_months
        hidden_effect = {
            set_variable = { anarchy_intellect_party_research = 0.10 }
        }
        random_tech_anarchist_election = yes
    }
    if = {
        limit = {
            check_variable = {
                var = sov_anarchist_election_current_ruling_party
                value = 1
                compare = equals
            }
        }
        custom_effect_tooltip = civilian_industry_anarchist_election_bonus_3_months
        set_variable = { anarchy_industry_party_factory = 0.10 }
        set_variable = { anarchy_industry_party_resources = 0.25 }
    }
    if = {
        limit = {
            check_variable = {
                var = sov_anarchist_election_current_ruling_party
                value = 2
                compare = equals
            }
        }
        custom_effect_tooltip = military_industry_anarchist_election_bonus_3_months
        set_variable = { anarchy_military_industry_party_guns = 0.15 }
        set_variable = { anarchy_military_industry_party_guns_fabrication = 0.1 }
    }
    if = {
        limit = {
            check_variable = {
                var = sov_anarchist_election_current_ruling_party
                value = 3
                compare = equals
            }
        }
        custom_effect_tooltip = militarist_bonus_anarchist_election_bonus_3_months
        set_variable = { anarchy_militarist_party_training = -0.15 }
        set_variable = { anarchy_militarist_party_attack = 0.05 }
        set_variable = { anarchy_militarist_party_defence = 0.05 }
        set_variable = { anarchy_militarist_party_organization = 0.05 }
    }
    if = {
        limit = {
            check_variable = {
                var = sov_anarchist_election_current_ruling_party
                value = 4
                compare = equals
            }
        }
        custom_effect_tooltip = aviation_bonus_anarchist_election_bonus_3_months
        set_variable = { anarchy_aviation_party_accident = -0.15 }
        set_variable = { anarchy_aviation_party_ace_generation = 0.25 }
        set_variable = { anarchy_aviation_party_attack = 0.05 }
        set_variable = { anarchy_aviation_party_defence = 0.05 }
        set_variable = { anarchy_aviation_party_agility = 0.05 }
    }
    if = {
        limit = {
            check_variable = {
                var = sov_anarchist_election_current_ruling_party
                value = 5
                compare = equals
            }
        }
        custom_effect_tooltip = naval_bonus_anarchist_election_bonus_3_months
        custom_effect_tooltip = naval_bonus_anarchist_random_boat
        set_variable = { anarchy_ship_party_dockyard_cap = 0.15 }
        set_variable = { anarchy_ship_party_dockyard_speed = 0.1 }
        hidden_effect = {
            random_list = {
                25 = {
                    SOV = {
                        load_oob = "SOV_destroyer_anarchist"
                    }
                }
                25 = {
                    SOV = {
                        load_oob = "SOV_light_cruiser_anarchist"
                    }
                }
                20 = {
                    SOV = {
                        load_oob = "SOV_battle_cruiser_anarchist"
                    }
                }
                20 = {
                    SOV = {
                        load_oob = "SOV_heavy_cruiser_anarchist"
                    }
                }
                10 = {
                    SOV = {
                        load_oob = "SOV_battleship_anarchist"
                    }
                }
            }
        }
    }
    if = {
        limit = {
            check_variable = {
                var = sov_anarchist_election_current_ruling_party
                value = 6
                compare = equals
            }
        }
        custom_effect_tooltip = logistic_bonus_anarchist_election_bonus_3_months
        set_variable = { anarchy_logistic_infrastructure_build = 0.15 }
        set_variable = { anarchy_logistic_railway_build = 0.2 }
        set_variable = { anarchy_logistic_supply_consumption = -0.1 }
        random_owned_controlled_state = {
            limit = {
                infrastructure < 5
            }
            add_building_construction = {
                type = infrastructure
                level = 1
                instant_build = yes
            }
        }
        random_owned_controlled_state = {
            limit = {
                infrastructure < 5
            }
            add_building_construction = {
                type = infrastructure
                level = 1
                instant_build = yes
            }
        }
        random_owned_controlled_state = {
            limit = {
                infrastructure < 5
            }
            add_building_construction = {
                type = infrastructure
                level = 1
                instant_build = yes
            }
        }
    }
    if = {
        limit = {
            check_variable = {
                var = sov_anarchist_election_current_ruling_party
                value = 7
                compare = equals
            }
        }
        custom_effect_tooltip = internal_security_bonus_anarchist_election_bonus_3_months
        set_variable = { anarchy_internal_sec_decryption_fac = 0.15 }
        set_variable = { anarchy_internal_sec_encryption_fac = 0.15 }
        set_variable = { anarchy_internal_sec_anarchy_drift_fac = 0.05 }
        add_stability = 0.05
    }
    if = {
        limit = {
            check_variable = {
                var = sov_anarchist_election_current_ruling_party
                value = 8
                compare = equals
            }
        }
        set_variable = { global_building_slots = 0.35 }
        custom_effect_tooltip = countryside_bonus_anarchist_election_bonus_3_months
        random_owned_controlled_state = {
            limit = {
                OR = {
                    has_state_category = wasteland
                    has_state_category = pastoral
                    has_state_category = enclave
                    has_state_category = rural
                    has_state_category = small_island
                    has_state_category = tiny_island
                }
            }
            add_extra_state_shared_building_slots = 5
        }
        random_owned_controlled_state = {
            limit = {
                OR = {
                    has_state_category = wasteland
                    has_state_category = pastoral
                    has_state_category = enclave
                    has_state_category = rural
                    has_state_category = small_island
                    has_state_category = tiny_island
                }
            }
            add_extra_state_shared_building_slots = 5
        }
        random_owned_controlled_state = {
            limit = {
                OR = {
                    has_state_category = wasteland
                    has_state_category = pastoral
                    has_state_category = enclave
                    has_state_category = rural
                    has_state_category = small_island
                    has_state_category = tiny_island
                }
            }
            add_extra_state_shared_building_slots = 5
        }
        random_owned_controlled_state = {
            limit = {
                OR = {
                    has_state_category = wasteland
                    has_state_category = pastoral
                    has_state_category = enclave
                    has_state_category = rural
                    has_state_category = small_island
                    has_state_category = tiny_island
                }
            }
            add_extra_state_shared_building_slots = 5
        }
    }
    if = {
        limit = {
            check_variable = {
                var = sov_anarchist_election_current_ruling_party
                value = 9
                compare = equals
            }
        }
        set_variable = { anarchy_theorist_party_refinery_speed = 0.25 }
        set_variable = { anarchy_theorist_party_nuclear_speed = 0.25 }
        set_variable = { anarchy_theorist_party_rocket_speed = 0.25 }
        custom_effect_tooltip = theorist_bonus_anarchist_election_bonus_3_months
        random_list = {
            25 = {
                add_tech_bonus = {
                    name = SOV_anarchist_election_tech_bonus
                    bonus = 1.0
                    uses = 1
                    category = nuclear
                }
            }
            35 = {
                add_tech_bonus = {
                    name = SOV_anarchist_election_tech_bonus
                    bonus = 1.0
                    uses = 1
                    category = synth_resources
                }
            }
            30 = {
                add_tech_bonus = {
                    name = SOV_anarchist_election_tech_bonus
                    bonus = 1.0
                    uses = 1
                    category = rocketry
                }
            }
        }
    }
}

random_tech_anarchist_election = {
    random_list = {
        10 = {
            add_tech_bonus = {
                name = SOV_anarchist_election_tech_bonus
                bonus = 1.0
                uses = 1
                category = industry
            }
        }
        10 = {
            add_tech_bonus = {
                name = SOV_anarchist_election_tech_bonus
                bonus = 1.0
                uses = 1
                category = synth_resources
            }
        }
        10 = {
            add_tech_bonus = {
                name = SOV_anarchist_election_tech_bonus
                bonus = 1.0
                uses = 1
                category = radar_tech
            }
        }
        10 = {
            add_tech_bonus = {
                name = SOV_anarchist_election_tech_bonus
                bonus = 1.0
                uses = 1
                category = cas_bomber
            }
        }
        10 = {
            add_tech_bonus = {
                name = SOV_anarchist_election_tech_bonus
                bonus = 1.0
                uses = 1
                category = light_fighter
            }
        }
        10 = {
            add_tech_bonus = {
                name = SOV_anarchist_election_tech_bonus
                bonus = 1.0
                uses = 1
                category = armor
            }
        }
        10 = {
            add_tech_bonus = {
                name = SOV_anarchist_election_tech_bonus
                bonus = 1.0
                uses = 1
                category = cat_mechanized_equipment
            }
        }
        10 = {
            add_tech_bonus = {
                name = SOV_anarchist_election_tech_bonus
                bonus = 1.0
                uses = 1
                category = bb_tech
            }
        }
        10 = {
            add_tech_bonus = {
                name = SOV_anarchist_election_tech_bonus
                bonus = 1.0
                uses = 1
                category = marine_tech
            }
        }
        10 = {
            add_tech_bonus = {
                name = SOV_anarchist_election_tech_bonus
                bonus = 1.0
                uses = 1
                category = tactical_bomber
            }
        }
    }
}

create_ships_variant_for_anarchist_election = {
    create_equipment_variant = { #Destroyer
        name = "Russkiy Esminets Klassa"
        type = ship_hull_light_1
        parent_version = 0
        NAME_GROUP = SOV_DD_HISTORICAL
		modules = {
			fixed_ship_battery_slot = ship_light_battery_2
			fixed_ship_anti_air_slot = empty
			fixed_ship_fire_control_system_slot = ship_fire_control_system_0
			fixed_ship_radar_slot = ship_sonar_1
			fixed_ship_engine_slot = light_ship_engine_2
			fixed_ship_torpedo_slot = ship_torpedo_1
			mid_1_custom_slot = ship_torpedo_1
			rear_1_custom_slot = ship_depth_charge_1
		}
    }
    create_equipment_variant = { #Light Cruiser
        name = "Russkiy Legkiy Kreyser Klassa"
        type = ship_hull_cruiser_1
        parent_version = 0
        NAME_GROUP = SOV_CL_HISTORICAL
        modules = {
			fixed_ship_battery_slot = ship_light_medium_battery_1
			fixed_ship_anti_air_slot = ship_anti_air_1
			fixed_ship_fire_control_system_slot = ship_fire_control_system_0
			fixed_ship_radar_slot = empty
			fixed_ship_engine_slot = cruiser_ship_engine_2
			fixed_ship_armor_slot = ship_armor_cruiser_1
			mid_1_custom_slot = ship_torpedo_1
			mid_2_custom_slot = ship_torpedo_1
			rear_1_custom_slot = ship_light_medium_battery_1
		}
    }
    create_equipment_variant = { #Heavy Cruiser
        name = "Russkiy Lineynyy Kreyser Klassa"
        type = ship_hull_cruiser_1
        parent_version = 0
        NAME_GROUP = SOV_CA_HISTORICAL
		modules = {
			fixed_ship_battery_slot = ship_medium_battery_2
			fixed_ship_anti_air_slot = ship_anti_air_1
			fixed_ship_fire_control_system_slot = ship_fire_control_system_0
			fixed_ship_radar_slot = empty
			fixed_ship_engine_slot = cruiser_ship_engine_1
			fixed_ship_armor_slot = ship_armor_cruiser_1
			fixed_ship_secondaries_slot = ship_secondaries_1
			mid_1_custom_slot = ship_airplane_launcher_1
			mid_2_custom_slot = ship_torpedo_1
			rear_1_custom_slot = ship_medium_battery_2
		}
    }
    create_equipment_variant = { #Battle Cruiser
        name = "Russkiy Tyazhelyy Kreyser Klassa"
        type = ship_hull_heavy_1
        parent_version = 0
		modules = {
			fixed_ship_battery_slot = ship_heavy_battery_1
			fixed_ship_anti_air_slot = ship_anti_air_1
			fixed_ship_fire_control_system_slot = ship_fire_control_system_1
			fixed_ship_radar_slot = empty
			fixed_ship_engine_slot = heavy_ship_engine_2
			fixed_ship_secondaries_slot = ship_secondaries_1
			fixed_ship_armor_slot = ship_armor_bc_1
			front_1_custom_slot = ship_anti_air_1
			mid_1_custom_slot = ship_airplane_launcher_1
			mid_2_custom_slot = ship_secondaries_1
			rear_1_custom_slot = empty
		}
    }
    create_equipment_variant = { #Battleship
        name = "Russkiy Linkor Klassa"
        type = ship_hull_heavy_1
        parent_version = 0
        NAME_GROUP = SOV_BB_HISTORICAL
		modules = {
			fixed_ship_battery_slot = ship_heavy_battery_2
			fixed_ship_anti_air_slot = ship_anti_air_1
			fixed_ship_fire_control_system_slot = ship_fire_control_system_1
			fixed_ship_radar_slot = empty
			fixed_ship_engine_slot = heavy_ship_engine_2
			fixed_ship_secondaries_slot = ship_secondaries_2
			fixed_ship_armor_slot = ship_armor_bb_2
			front_1_custom_slot = ship_heavy_battery_2
			mid_1_custom_slot = empty
			mid_2_custom_slot = empty
			rear_1_custom_slot = empty
		}
    }
}

# damn thats some great coding there Paradox
sov_unlock_nkvd_chiefs = {
    if = {
        limit = {
            has_character = SOV_Genrikh_yagoda
        }
        set_can_be_fired_in_advisor_role = {
            character = SOV_genrikh_yagoda 
            value = yes
        }
    }

    if = {
        limit = {
            has_character = SOV_Nikolay_yezhov
        }
        set_can_be_fired_in_advisor_role = {
            character = SOV_Nikolay_yezhov
            value = yes
        }
    }

    if = {
        limit = {
            has_character = SOV_Lavrentiy_beria
        }
        set_can_be_fired_in_advisor_role = {
            character = SOV_Lavrentiy_beria
            value = yes
        }
    }
}

#Just in Case
SOV_unlock_propaganda_campaign_slot_effect_russia2 = {
	hidden_effect = {
		if = {
			limit = {
				check_variable = { SOV_poster_left_icon_frame = SOV_propaganda_locked_slot_index }
			}
			set_variable = { SOV_poster_left_icon_frame = SOV_propaganda_empty_slot_index }
		}
		else_if = {
			limit = {
				check_variable = { SOV_poster_center_icon_frame = SOV_propaganda_locked_slot_index }
			}
			set_variable = { SOV_poster_center_icon_frame = SOV_propaganda_empty_slot_index }
		}
		else = {
			set_variable = { SOV_poster_right_icon_frame = SOV_propaganda_empty_slot_index }
		}
	}
}

sov_transfer_baltic_puppet_scw = {
    if = {
        limit = {
            LIT = {
                is_subject_of = SOV
                has_civil_war = yes
                has_government = communism
            }
        }
        every_country = {
            limit = {
                original_tag = LIT
                NOT = {
                    has_government = communism
                }
            }
            LIT = {
                annex_country = {
                    target = PREV
                }
            }
        }
    }
    if = {
        limit = {
            LAT = {
                is_subject_of = SOV
                has_civil_war = yes
                has_government = communism
            }
        }
        every_country = {
            limit = {
                original_tag = LAT
                NOT = {
                    has_government = communism
                }
            }
            LAT = {
                annex_country = {
                    target = PREV
                }
            }
        }
    }
    if = {
        limit = {
            EST = {
                is_subject_of = SOV
                has_civil_war = yes
                has_government = communism
            }
        }
        every_country = {
            limit = {
                original_tag = EST
                NOT = {
                    has_government = communism
                }
            }
            EST = {
                annex_country = {
                    target = PREV
                }
            }
        }
    }
    every_country = {
        limit = {
            is_subject_of = SOV
            has_government = communism
        }
        SOJ = {
            set_autonomy = {
                target = PREV
                autonomy_state = autonomy_puppet
            }
        }
    }
}

SOV_regain_lost_cores = {
    UKR = {
        every_core_state = {
            limit = {
                NOT = {
                    is_core_of = POL
                    is_core_of = ROM
                    is_core_of = SLO
                }					
            }
            add_core_of = SOV
        }					
    }
    BLR = {
        every_core_state = {
            limit = {
                NOT = {
                    is_core_of = POL
                }					
            }
            add_core_of = SOV
        }					
    }	
    GEO = {
        every_core_state = {
            add_core_of = SOV
        }					
    }	
    ARM = {
        every_core_state = {
            add_core_of = SOV
        }					
    }  
    AZR = {
        every_core_state = {
            limit = {
                NOT = {
                    is_core_of = PER
                }
            }
            add_core_of = SOV
        }					
    }   
    KAZ = {
        every_core_state = {
            add_core_of = SOV
        }					
    } 
    TMS = {
        every_core_state = {
            limit = {
                NOT = {
                    is_core_of = AFG
                }
            }
            add_core_of = SOV
        }					
    }
    CRI = {
        every_core_state = {
            add_core_of = SOV
        }					
    }                 
}