 qol_internal_state_management = {

	qol_activate_internal_state_management_map_mode = {
		
		name = qol_activate_internal_state_management_map_mode

		fire_only_once = no

		visible = {
			has_country_flag = qol_internal_map_mode_hidden_flag
		}

		complete_effect = {
			clr_country_flag = qol_internal_map_mode_hidden_flag
		}
	}

	qol_deactivate_internal_state_management_map_mode = {
		
		name = qol_deactivate_internal_state_management_map_mode

		fire_only_once = no

		visible = {
			NOT = { has_country_flag = qol_internal_map_mode_hidden_flag }
		}

		complete_effect = {
			set_country_flag = qol_internal_map_mode_hidden_flag
		}
	}

	qol_encourage_minor_state_immigration = {

		name = qol_encourage_minor_state_immigration

		icon = generic_political_discourse

		allowed = {
			NOT = { has_government = fascism }
			NOT = { has_government = nationalist }
		}

		available = {
			FROM = {
				is_core_of = ROOT
				is_owned_by = ROOT
				state_population > 999
				state_population < 1000000
			}
		}

		state_target = yes

		on_map_mode = map_only

		#targets = {  }

		target_array = controlled_states

		target_trigger = {
			FROM = {
				is_core_of = ROOT
				is_owned_by = ROOT
				state_population > 999
				state_population < 1000000
			}
		}

		cost = 10

		fire_only_once = no

		days_remove = 30
		days_re_enable = 330

		modifier = {
			political_power_gain = -0.05
			population_tax_income_multiplier_modifier = -0.01

		}

		visible = {
			NOT = { has_country_flag = qol_internal_map_mode_hidden_flag }
		}

		complete_effect = {

		}

		remove_effect = {
			FROM = {
				set_temp_variable =  { temp_population = state_population_k }
				multiply_temp_variable = { temp_population = 5 }
				add_to_temp_variable = { temp_population = 500 }
				add_manpower = temp_population
			}
		}
	}

	qol_encourage_medium_state_immigration = {

		name = qol_encourage_medium_state_immigration

		icon = generic_political_discourse

		allowed = {
			NOT = { has_government = fascism }
			NOT = { has_government = nationalist }
		}

		available = {
			FROM = {
				is_core_of = ROOT
				is_owned_by = ROOT
				state_population > 999999
				state_population < 10000000
			}
		}

		state_target = yes

		on_map_mode = map_only

		#targets = {  }

		target_array = controlled_states

		target_trigger = {
			FROM = {
				is_core_of = ROOT
				is_owned_by = ROOT
				state_population > 999999
				state_population < 10000000
			}
		}

		cost = 25

		fire_only_once = no

		days_remove = 60
		days_re_enable = 300

		modifier = {
			political_power_gain = -0.10
			population_tax_income_multiplier_modifier = -0.02
			nationalist_drift = 0.01
		}

		visible = {
			NOT = { has_country_flag = qol_internal_map_mode_hidden_flag }
		}

		complete_effect = {

		}

		remove_effect = {
			FROM = {
				set_temp_variable =  { temp_population = state_population_k }
				multiply_temp_variable = { temp_population = 3 }
				add_to_temp_variable = { temp_population = 5000 }
				add_manpower = temp_population
			}
		}
	}

	qol_encourage_major_state_immigration = {

		name = qol_encourage_major_state_immigration

		icon = generic_political_discourse

		allowed = {
			NOT = { has_government = fascism }
			NOT = { has_government = nationalist }
		}

		available = {
			FROM = {
				is_core_of = ROOT
				is_owned_by = ROOT
				state_population > 9999999
			}
		}

		state_target = yes

		on_map_mode = map_only

		#targets = {  }

		target_array = controlled_states

		target_trigger = {
			FROM = {
				is_core_of = ROOT
				is_owned_by = ROOT
				state_population > 9999999
			}
		}

		cost = 50

		fire_only_once = no

		days_remove = 90
		days_re_enable = 270

		modifier = {
			political_power_gain = -0.15
			population_tax_income_multiplier_modifier = -0.03
			nationalist_drift = 0.02
		}

		visible = {
			NOT = { has_country_flag = qol_internal_map_mode_hidden_flag }
		}

		complete_effect = {

		}

		remove_effect = {
			FROM = {
				set_temp_variable =  { temp_population = state_population_k }
				multiply_temp_variable = { temp_population = 2 }
				add_to_temp_variable = { temp_population = 25000 }
				add_manpower = temp_population
			}
		}
	}

	qol_invest_in_state_productivity = {

		name = qol_invest_in_state_productivity

		icon = generic_welfare

		allowed = {
		}

		available = {
			FROM = {
				is_core_of = ROOT
				is_owned_by = ROOT
			}
		}

		state_target = yes

		on_map_mode = map_only

		#targets = {  }

		target_array = controlled_states

		target_trigger = {
			FROM = {
				is_core_of = ROOT
				is_owned_by = ROOT
			}
		}

		cost = 25

		fire_only_once = no

		days_remove = 60
		days_re_enable = 180

		modifier = {
			corporate_tax_income_multiplier_modifier = -0.01
		}

		visible = {
			NOT = { has_country_flag = qol_internal_map_mode_hidden_flag }
		}

		complete_effect = {
			FROM = {
				set_temp_variable = { money_amount = state_population_k }
			}
			divide_temp_variable = { money_amount = 10000 }
			multiply_temp_variable = { money_amount = gdp_per_capita }
			multiply_temp_variable = { money_amount = -1 }
			set_temp_variable = { treasury_change = money_amount }
			modify_treasury_effect = yes

		}

		remove_effect = {
			custom_effect_tooltip = invest_in_state_productivity_tt
			FROM = {
				add_to_variable = { productivity_state_var = 10 }
			}
		}
	}

	qol_prospect_further_resource_deposits = {

		name = qol_prospect_further_resource_deposits

		icon = eng_trade_unions_demand

		allowed = {
		}

		available = {
			FROM = {
				is_core_of = ROOT
				is_owned_by = ROOT
			}
		}

		state_target = yes

		on_map_mode = map_only

		#targets = {  }

		target_array = controlled_states

		target_trigger = {
			FROM = {
				is_core_of = ROOT
				is_owned_by = ROOT
				OR = {
					has_resources_amount = {
						resource = steel
						amount > 0
					}
					has_resources_amount = {
						resource = chromium
						amount > 0
					}
					has_resources_amount = {
						resource = aluminium
						amount > 0
					}
					has_resources_amount = {
						resource = tungsten
						amount > 0
					}
					has_resources_amount = {
						resource = oil
						amount > 0
					}
					has_resources_amount = {
						resource = rubber
						amount > 0
					}
				}
			}
		}

		cost = 75

		fire_only_once = no

		days_remove = 120
		days_re_enable = 360

		modifier = {
		}

		visible = {
			NOT = { has_country_flag = qol_internal_map_mode_hidden_flag }
		}

		complete_effect = {
			FROM = {
				set_temp_variable = { resource_amount = 0 }
				set_temp_variable = { money_amount = -12.5 }
				if = {
					limit = {
						has_resources_amount = {
							resource = steel
							amount > 0
						}
					}
					add_to_temp_variable = { resource_amount = 1 }
				}
				if = {
					limit = {
						has_resources_amount = {
							resource = aluminium
							amount > 0
						}
					}
					add_to_temp_variable = { resource_amount = 1 }
				}
				if = {
					limit = {
						has_resources_amount = {
							resource = tungsten
							amount > 0
						}
					}
					add_to_temp_variable = { resource_amount = 1 }
				}
				if = {
					limit = {
						has_resources_amount = {
							resource = chromium
							amount > 0
						}
					}
					add_to_temp_variable = { resource_amount = 1 }
				}
				if = {
					limit = {
						has_resources_amount = {
							resource = rubber
							amount > 0
						}
					}
					add_to_temp_variable = { resource_amount = 1 }
				}
				if = {
					limit = {
						has_resources_amount = {
							resource = oil
							amount > 0
						}
					}
					add_to_temp_variable = { resource_amount = 1 }
				}
				
			}
			
			multiply_temp_variable = { money_amount = resource_amount }
			set_temp_variable = { treasury_change = money_amount }
			modify_treasury_effect = yes

		}

		remove_effect = {
#			custom_effect_tooltip = prospect_further_resource_deposits_tt
			FROM = {
				set_temp_variable =  { temp_population = state_population_k }
				multiply_temp_variable = { temp_population = -2.5 }
				add_manpower = temp_population

				if = {
					limit = {
						steel > 0
						steel < 50
					}
					add_resource = {
						type = steel
						amount = 1
					}
				}
				if = {
					limit = {
						aluminium > 0
						aluminium < 50
					}
					add_resource = {
						type = aluminium
						amount = 1
					}
				}
				if = {
					limit = {
						tungsten > 0
						tungsten < 50
					}
					add_resource = {
						type = tungsten
						amount = 1
					}
				}
				if = {
					limit = {
						chromium > 0
						chromium < 50
					}
					add_resource = {
						type = chromium
						amount = 1
					}
				}
				if = {
					limit = {
						rubber > 0
						rubber < 50
					}
					add_resource = {
						type = rubber
						amount = 1
					}
				}
				if = {
					limit = {
						oil > 0
						oil < 50
					}
					add_resource = {
						type = oil
						amount = 1
					}
				}
				if = {
					limit = {
						steel > 49
						steel < 100
					}
					add_resource = {
						type = steel
						amount = 2
					}
				}
				if = {
					limit = {
						aluminium > 49
						aluminium < 100
					}
					add_resource = {
						type = aluminium
						amount = 2
					}
				}
				if = {
					limit = {
						tungsten > 49
						tungsten < 100
					}
					add_resource = {
						type = tungsten
						amount = 2
					}
				}
				if = {
					limit = {
						chromium > 49
						chromium < 100
					}
					add_resource = {
						type = chromium
						amount = 2
					}
				}
				if = {
					limit = {
						rubber > 49
						rubber < 100
					}
					add_resource = {
						type = rubber
						amount = 2
					}
				}
				if = {
					limit = {
						oil > 49
						oil < 100
					}
					add_resource = {
						type = oil
						amount = 2
					}
				}
				if = {
					limit = {
						steel > 99
					}
					add_resource = {
						type = steel
						amount = 3
					}
				}
				if = {
					limit = {
						aluminium > 99
					}
					add_resource = {
						type = aluminium
						amount = 3
					}
				}
				if = {
					limit = {
						tungsten > 99
					}
					add_resource = {
						type = tungsten
						amount = 3
					}
				}
				if = {
					limit = {
						chromium > 99
					}
					add_resource = {
						type = chromium
						amount = 3
					}
				}
				if = {
					limit = {
						rubber > 99
					}
					add_resource = {
						type = rubber
						amount = 3
					}
				}
				if = {
					limit = {
						oil > 99
					}
					add_resource = {
						type = oil
						amount = 3
					}
				}
			}
		}
	}

	qol_conduct_national_censuss = {

		name = qol_conduct_national_census

		icon = eng_trade_unions_support

		allowed = {
		}

		available = {
			has_stability > 0.50
		}

		cost = 150

		fire_only_once = no

		days_remove = 120
		days_re_enable = 1460

		modifier = {
			political_power_cost = 0.25
			bureaucracy_cost_multiplier_modifier = 0.15
			monthly_population = 0.5
		}

		visible = {
		}

		complete_effect = {
			set_temp_variable = { money_amount = gdp_total }
			divide_temp_variable = { money_amount = 125 }
			multiply_temp_variable = { money_amount = -1 }
			set_temp_variable = { treasury_change = money_amount }
			modify_treasury_effect = yes

		}

		remove_effect = {
			custom_effect_tooltip = conduct_national_census_tt
			add_to_variable = { productivity_state_var = 5 }
		}
	}

	qol_invest_state_funds_into_research_and_development = {

		name = qol_invest_state_funds_into_research_and_development

		icon = hol_attract_foreign_investors

		allowed = {
		}

		available = {
			has_stability > 0.50
			NOT = { has_idea = depression }
			NOT = { has_idea = recession }
		}

		cost = 100

		fire_only_once = no

		days_remove = 180
		days_re_enable = 720

		modifier = {
			research_speed_factor = 0.10
			country_productivity_growth_modifier = 0.15
			production_speed_buildings_factor = 0.25
		}

		visible = {
		}

		complete_effect = {
			set_temp_variable = { money_amount = gdp_total }
			divide_temp_variable = { money_amount = 175 }
			add_to_temp_variable = { money_amount = 1 }
			multiply_temp_variable = { money_amount = -1 }
			set_temp_variable = { treasury_change = money_amount }
			modify_treasury_effect = yes

		}
	}

	qol_bolster_national_soft_power = {

		name = qol_bolster_national_soft_power

		icon = generic_intelligence_operation

		allowed = {
		}

		available = {
			NOT = { has_idea = depression }
			NOT = { has_idea = recession }
		}

		cost = 50

		fire_only_once = no

		days_remove = 180
		days_re_enable = 180

		modifier = {
			foreign_influence_modifier = 0.15
			political_power_cost = 0.50
			bureaucracy_cost_multiplier_modifier = 0.05
		}

		visible = {
		}

		complete_effect = {
		}
	}

	qol_encourage_remote_working = {

		name = qol_encourage_remote_working

		icon = generic_independence

		allowed = {
		}

		available = {
			NOT = { has_idea = qol_remote_working_encouraged }
			has_tech = wifi
		}

		cost = 50

		fire_only_once = no

		visible = {
			NOT = { has_idea = qol_remote_working_encouraged }
		}

		complete_effect = {
			add_ideas = qol_remote_working_encouraged
		}
	}

	qol_discourage_remote_working = {

		name = qol_discourage_remote_working

		icon = generic_independence

		allowed = {
		}

		available = {
			has_idea = qol_remote_working_encouraged
		}

		cost = 25

		fire_only_once = no

		visible = {
			has_idea = qol_remote_working_encouraged
		}

		complete_effect = {
			remove_ideas = qol_remote_working_encouraged
		}
	}

	qol_the_ai_question = {

		name = qol_the_ai_question

		icon = generic_brainwash
		allowed = {
		}

		available = {
			has_tech = advanced_ai
		}

		cost = 50

		fire_only_once = no

		days_re_enable = 180

		modifier = {
		}

		visible = {
		}

		complete_effect = {
			country_event = {
				id = qol.1
			}
		}
	}
}