GLO_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 = {
			has_political_power > FROM.RSI_cost
			if = {
				limit = { has_global_flag = easy_difficulty }
				FROM = {
					compliance > 69
					resistance < 26
				}
			}
			if = {
				limit = { has_global_flag = medium_difficulty }
				FROM = {
					compliance > 79
					resistance < 21
				}
			}
			if = {
				limit = { has_global_flag = hard_difficulty }
				FROM = {
					compliance > 89
					resistance < 11
				}
			}
			if = {
				limit = { has_global_flag = very_hard_difficulty }
				FROM = {
					compliance > 94
					resistance < 6
				}
			}
            has_manpower > GLO_p_mp_cost
            has_equipment = {
                infantry_equipment > GLO_p_inf_cost
            }
        }

        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 > FROM.RSI_cost }
		
		custom_cost_text = GLO_35_pol_power
		
        days_remove = 50

        complete_effect = {
			set_temp_variable = { GLO_p_mp_cost_t = GLO_p_mp_cost }
			set_temp_variable = { GLO_p_pp_cost_t = FROM.RSI_cost }
			set_temp_variable = { GLO_p_inf_cost_t = GLO_p_inf_cost }
			multiply_temp_variable = { GLO_p_mp_cost_t = -1 }
			multiply_temp_variable = { GLO_p_pp_cost_t = -1 }
			multiply_temp_variable = { GLO_p_inf_cost_t = -1 }
            add_manpower = GLO_p_mp_cost_t
			add_political_power = GLO_p_pp_cost_t
            add_equipment_to_stockpile = {
			    type = infantry_equipment
			    amount = GLO_p_inf_cost_t
			}
			hidden_effect = {
				FROM = { 
					set_state_flag = being_cored
				}
				if = {
					limit = { check_variable = { GLO_p_pp_cost < 20 } }
					every_country = {
						set_variable = { GLO_p_pp_cost = 50 }
						set_variable = { GLO_p_comp_cost = 80 }
						set_variable = { GLO_p_res_cost = 20 }
						set_variable = { GLO_p_mp_cost = 500 }
						set_variable = { GLO_p_inf_cost = 250 }
						set_variable = { GLO_f_comp_cost = 35 }
						set_variable = { GLO_f_res_cost = 35 }
						set_variable = { GLO_f_mp_cost = 8500 }
						set_variable = { GLO_f_inf_cost = 1600 }
					}
				}
			}
        }

        remove_effect = {
            FROM = {
                add_core_of = ROOT
				clr_state_flag = being_cored
            }
        }
    }

    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 = {
			has_manpower > FROM.RSI_MP_cost
            NOT = {
				OR = {
					has_government = democratic
					AND = {
						has_government = neutrality
						has_war_support < 0.7
					}
				}
			}
            if = {
				limit = { has_global_flag = easy_difficulty }
				FROM = {
					compliance > 29
					resistance < 41
				}
			}
			if = {
				limit = { has_global_flag = medium_difficulty }
				FROM = {
					compliance > 34
					resistance < 36
				}
			}
			if = {
				limit = { has_global_flag = hard_difficulty }
				FROM = {
					compliance > 39
					resistance < 31
				}
			}
			if = {
				limit = { has_global_flag = very_hard_difficulty }
				FROM = {
					compliance > 44
					resistance < 26
				}
			}
			has_equipment = {
				infantry_equipment > FROM.RSI_INF_cost
			}
        }

        visible = {
            NOT = { has_country_flag = show_integration_decisions }
			FROM = {
				NOT = { is_core_of = ROOT }
				NOT = { has_state_flag = being_cored }
			}
        }
		
		custom_cost_trigger = { has_manpower > FROM.RSI_MP_cost }
		
		custom_cost_text = GLO_1000_inf_eqmnt

        days_remove = 75

		modifier = {
			weekly_manpower = -150
		}

        complete_effect = {
			set_temp_variable = { GLO_f_mp_cost_t = FROM.RSI_MP_cost }
			set_temp_variable = { GLO_f_inf_cost_t = FROM.RSI_INF_cost }
			multiply_temp_variable = { GLO_f_mp_cost_t = -1 }
			multiply_temp_variable = { GLO_f_inf_cost_t = -1 }
            add_manpower = GLO_f_mp_cost_t
            add_equipment_to_stockpile = {
			    type = infantry_equipment
			    amount = GLO_f_inf_cost_t
			}
			hidden_effect = {
				FROM = { 
					set_state_flag = being_cored
				}
				if = {
					limit = { check_variable = { GLO_p_pp_cost < 20 } }
					every_country = {
						set_variable = { GLO_p_pp_cost = 50 }
						set_variable = { GLO_p_comp_cost = 80 }
						set_variable = { GLO_p_res_cost = 20 }
						set_variable = { GLO_p_mp_cost = 500 }
						set_variable = { GLO_p_inf_cost = 250 }
						set_variable = { GLO_f_comp_cost = 35 }
						set_variable = { GLO_f_res_cost = 35 }
						set_variable = { GLO_f_mp_cost = 8500 }
						set_variable = { GLO_f_inf_cost = 1600 }
					}
				}
			}
        }

        remove_effect = {
            FROM = {
                add_core_of = ROOT
				clr_state_flag = being_cored
            }
        }
    }
}