# from = country
# this = species

population_control_yes = {
	can_reproduce = no
	pop_group_modifier = {
		pop_happiness = -0.1
	}

	allow = {
		hidden_trigger = { exists = from }
		from = {
			NOT = { has_policy_flag = population_controls_not_allowed }
		}
		if = {
			limit = {
				OR = {
					has_citizenship_type = { country = from type = citizenship_purge }
					has_citizenship_type = { country = from type = citizenship_purge_machine }
				}
			}
			hidden_trigger = { always = yes }
		}
		else = {
			custom_tooltip = {
				fail_text = same_species_disallowed
				NOT = { is_same_species = from }
			}
			custom_tooltip = {
				fail_text = is_broken_shackles_origin
				NOT = {
					from = {
						has_origin = origin_broken_shackles
					}
				}
			}
			custom_tooltip = {
				fail_text = empire_xenophile
				from = {
					is_xenophile = no
				}
			}
		}
	}
	ai_will_do = {
		factor = 2
		modifier = {
			factor = 0
			NOR = {
				has_citizenship_type = { country = from type = citizenship_purge_machine }
				has_citizenship_type = { country = from type = citizenship_purge }
			}
		}
	}
}

population_control_no = {
	potential = {
		always = yes
	}

	allow = {
		hidden_trigger = { exists = from }
		custom_tooltip = {
			NOR = {
				has_citizenship_type = { country = from type = citizenship_purge_machine }
				has_citizenship_type = { country = from type = citizenship_purge }
			}
			fail_text = is_undesirables_tooltip
		}
		custom_tooltip = {
			fail_text = "HIVE_MIND_SPECIES_CITIZENS_ONLY"
			OR = {
				from = {
					OR = {
						is_hive_empire = no
						has_origin = origin_necrophage
						has_origin = origin_forever_cruise
						has_civic = civic_hive_bodysnatcher
					}
				}
				has_trait = trait_hive_mind
			}
		}
	}
	ai_will_do = {
		factor = 1
	}
}
