#is_unemployment_job = yes - this job category is treated as unemployment
#is_civilian_job = yes - this job category is treated as civilian

ruler = {
	rank = 4
	change_job_threshold = 1.14 # A pop that is 4.5% better than me will displace me (1.045^3 = 1.14)
	job_reshuffle_interval = 13

	weight = {
		weight = 3
	}

	automation_resources = {
		category = planet_automated_jobs
		upkeep = {
			energy = @automation_upkeep_elite
		}
	}

	pop_group_modifier = {
		pop_housing_usage_base = 1
		pop_amenities_usage_base = 1
	}

	# scope: pop to be resettled
	allow_resettlement = {
		always = yes
	}

	inline_script = "pop_categories/resettlement_costs"

	# Triggered Modifiers
	inline_script = "pop_categories/social_classes_triggered_modifiers"
	inline_script = "pop_categories/social_classes_triggered_modifiers_no_happiness"

	resources = {
		category = pop_category_rulers
		# Living Standard Trait Output
		inline_script = "pop_categories/living_standard_ruler_production"

		produces = {
			trigger = {
				prosperity_gospel_check_trigger = yes
			}
			trade = @trade_value_prosperity_gospel
			mult = value:pop_ethic_percentage_value|ETHIC|spiritualist|
		}

		produces = {
			trigger = {
				planet = {
					has_modifier = pm_gaseous_fauna
				}
			}
			exotic_gases = @gaseous_fauna_exotic_gases_production
		}
	}
}

specialist = {
	rank = 3
	change_job_threshold = 1.07 # A pop that is 2.3% better than me will displace me (1.023^3 = 1.07)
	job_reshuffle_interval = 7

	weight = {
		weight = 2
	}

	automation_resources = {
		category = planet_automated_jobs
		upkeep = {
			energy = @automation_upkeep_specialist
		}
	}

	pop_group_modifier = {
		pop_housing_usage_base = 1
		pop_amenities_usage_base = 1
	}

	# scope: pop to be resettled
	allow_resettlement = {
		always = yes
	}

	inline_script = "pop_categories/resettlement_costs"

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { has_civic = civic_dystopian_society }
		}
		planet_crime_add = 1
	}

	# Triggered Modifiers
	inline_script = "pop_categories/social_classes_triggered_modifiers"
	inline_script = "pop_categories/social_classes_triggered_modifiers_no_happiness"

	resources = {
		category = pop_category_specialists
		# Living Standard Trait Output
		inline_script = "pop_categories/living_standard_specialist_production"

		inline_script = "pop_categories/indentured_assets_slave_produce"

		produces = {
			trigger = {
				prosperity_gospel_check_trigger = yes
			}
			trade = @trade_value_prosperity_gospel
			mult = value:pop_ethic_percentage_value|ETHIC|spiritualist|
		}

		produces = {
			trigger = {
				planet = {
					has_modifier = pm_gaseous_fauna
				}
			}
			exotic_gases = @gaseous_fauna_exotic_gases_production
		}
	}
}

worker = {
	rank = 2
	job_reshuffle_interval = 3

	change_job_threshold = 1.03 # A pop that is 1% better than me will displace me (1.01^3 = 1.03) 

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { has_civic = civic_dystopian_society }
		}
		planet_crime_add = 1
	}

	triggered_planet_modifier = {
		potential = {
			is_unemployed = no
			planet = { has_modifier = penal_colony }
		}
		planet_crime_add = 3
	}

	weight = {
		weight = 1
	}

	automation_resources = {
		category = planet_automated_jobs
		upkeep = {
			energy = @automation_upkeep_worker
		}
	}

	pop_group_modifier  = {
		pop_housing_usage_base = 1
		pop_amenities_usage_base = 1
	}

	# scope: pop to be resettled
	allow_resettlement = {
		always = yes
	}

	inline_script = "pop_categories/resettlement_costs"

	# Triggered Modifiers
	inline_script = "pop_categories/social_classes_triggered_modifiers"
	inline_script = "pop_categories/social_classes_triggered_modifiers_no_happiness"

	resources = {
		category = pop_category_workers
		# Living Standard Trait Output
		inline_script = "pop_categories/living_standard_worker_production"

		inline_script = "pop_categories/indentured_assets_slave_produce"

		produces = {
			trigger = {
				prosperity_gospel_check_trigger = yes
			}
			trade = @trade_value_prosperity_gospel
			mult = value:pop_ethic_percentage_value|ETHIC|spiritualist|
		}

		produces = {
			trigger = {
				planet = {
					has_modifier = pm_gaseous_fauna
				}
			}
			exotic_gases = @gaseous_fauna_exotic_gases_production
		}

		produces = {
			trigger = {
				planet = {
					has_modifier = pm_raining_corpses
				}
			}
			minor_artifacts = @raining_corpses_resource_amount
		}

		produces = {
			trigger = {
				planet = {
					has_modifier = pm_raining_corpses_no_ancrel
				}
			}
			consumer_goods = @raining_corpses_resource_amount
		}
	}
}
