


MEL_state_integration_category = {
    show_hide_integration_decisions = {
        priority = 100
        visible = { always = yes }

        complete_effect = { 
            if = {
                limit = { has_country_flag = show_integration_decisions }
                clr_country_flag = show_integration_decisions
            }
            else = {
                set_country_flag = show_integration_decisions
            }
        }
    }

    integrate_the_state_of_FROM_peacefully = {
        icon = GFX_decision_generic_nationalism

        on_map_mode = map_only
        state_target = yes 
        target_array = controlled_states

        ai_will_do = { base = 0 }

        target_trigger = {
            FROM = {
                is_fully_controlled_by = ROOT
                NOT = { is_core_of = ROOT }
            }
        }

        available = {
            FROM = {
                compliance > 69
                resistance < 26
            }
            has_manpower > 500
            has_equipment = {
                infantry_equipment >250
            }
        }

        visible = {
            NOT = { has_country_flag = show_integration_decisions }
            FROM = { 
                NOT = { is_core_of = ROOT } 
                NOT = { has_state_flag = being_cored } 
            }
        }

        custom_cost_trigger = {
            has_political_power > 50
        }

        custom_cost_text = MEL_35_pol_power
        days_remove = 50

        complete_effect = {
            set_temp_variable = { 500_t = 500 }
            set_temp_variable = { 50_t = 50 }
            set_temp_variable = {250_t =250 }
            multiply_temp_variable = { 500_t = -1 }
            multiply_temp_variable = { 50_t = -1 }
            multiply_temp_variable = {250_t = -1 }

            add_manpower = 500_t
            add_political_power = 50_t
            add_equipment_to_stockpile = {
                type = infantry_equipment
                amount =250_t
            }

            hidden_effect = {
                FROM = { set_state_flag = being_cored }
                random_list = {
                    40 = {
                        add_popularity = { ideology = democratic popularity = 0.02 }
                        add_stability = 0.02
                    }
                    40 = {
                        add_popularity = { ideology = neutrality popularity = 0.02 }
                        add_stability = 0.03
                    }
                    20 = {
                        add_stability = -0.02
                   
                    }
                }
            }
        }

        remove_effect = {
            FROM = {
                add_core_of = ROOT
                clr_state_flag = being_cored
            }
            random_list = {
                50 = { add_political_power = 25 }
                30 = { add_stability = 0.02 }
                20 = { add_manpower = 1500 }
            }
        }
    }
    integrate_the_state_of_FROM_by_force = {
        icon = GFX_decision_oppression

        on_map_mode = map_only
        state_target = yes
        target_array = controlled_states

        ai_will_do = { base = 0 }

        target_trigger = {
            FROM = {
                is_fully_controlled_by = ROOT
                NOT = { is_core_of = ROOT }
            }
        }

        available = {
            NOT = {
                OR = {
                    has_government = neutrality
                    has_government = democratic
                }
            }
            FROM = {
                compliance > 34
                resistance < 36
            }
            has_manpower >8500
            has_equipment = {
                infantry_equipment > 1600
            }
        }

        visible = {
		    NOT = {
                OR = {
                    has_government = neutrality
                    has_government = democratic
                }
            }
            NOT = { has_country_flag = show_integration_decisions }
            FROM = {
                NOT = { is_core_of = ROOT }
                NOT = { has_state_flag = being_cored }
            }
        }

        custom_cost_trigger = {
            has_manpower >8500
        }

        custom_cost_text = MEL_1000_inf_eqmnt
        days_remove = 75

        modifier = {
            weekly_manpower = -150
        }

        complete_effect = {
            set_temp_variable = {8500_t =8500 }
            set_temp_variable = { 1600_t = 1600 }
            multiply_temp_variable = {8500_t = -1 }
            multiply_temp_variable = { 1600_t = -1 }

            add_manpower =8500_t
            add_equipment_to_stockpile = {
                type = infantry_equipment
                amount = 1600_t
            }

            hidden_effect = {
                FROM = { set_state_flag = being_cored }


                add_stability = -0.03
                add_war_support = -0.02

            }
        }

        remove_effect = {
            FROM = {
                add_core_of = ROOT
                clr_state_flag = being_cored
            }
            random_list = {
                40 = { add_war_support = 0.03 }
                40 = { add_manpower = 2500 }
                20 = { add_stability = -0.01 }
            }
            
        }
    }
}
