###############################################
# === xenomorph_branch_office_buildings_updated.txt ===
###############################################
###############################################
# XENOMORPH BRANCH OFFICE BUILDINGS
# Split from xenomorph_buildings_combined.txt.
###############################################

@b1_time = 360
@b2_time = 720
@b3_time = 1080

building_xenomorph_infestation_relay = {
	base_buildtime = @b1_time
	category = unity
	branch_office_building = yes
	base_cap_amount = 1

	building_sets = {
		government
		urban
		unity
	}

	potential = {
		exists = owner
		owner = {
			is_gestalt = no
			any_owned_species = { has_trait = trait_xenomorph }
		}
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_xenomorph_pheromone_drone_gestalt_add = 100
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_xenomorph_pheromone_drone_add = 100
	}

	planet_modifier = {
		planet_stability_add = -3
	}

	resources = {
		category = planet_branch_office_buildings
		cost = {
			food = 300
			xenomorph_eggs = 10
			xenomorph_offspring = 25
		}
		upkeep = { food = 1 }
	}
}


building_xenomorph_specimen_acquisition = {
	base_buildtime = @b1_time
	category = research
	branch_office_building = yes
	base_cap_amount = 1

	building_sets = {
		government
		urban
		research
	}

	potential = {
		exists = owner
		owner = {
			is_gestalt = no
			any_owned_species = { has_trait = trait_xenomorph }
		}
	}

	# Branch-office version of captive specimen research, using the new non-duplicate slave research job.
	planet_modifier = {
		job_xenomorph_specimen_thrall_add = 200
		planet_stability_add = -1
	}

	resources = {
		category = planet_branch_office_buildings
		cost = {
			food = 400
			energy = 200
			xenomorph_eggs = 15
			xenomorph_offspring = 40
		}
		upkeep = { energy = 2 food = 2 }
	}
}




building_xenomorph_biological_depot = {
	base_buildtime = @b1_time
	category = resource
	branch_office_building = yes
	base_cap_amount = 1

	building_sets = {
		government
		urban
		industrial
	}

	potential = {
		exists = owner
		owner = {
			is_gestalt = no
			any_owned_species = { has_trait = trait_xenomorph }
		}
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_xenomorph_extraction_drone_gestalt_add = 200
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_xenomorph_extraction_drone_add = 200
	}

	resources = {
		category = planet_branch_office_buildings
		cost = {
			food = 600
			xenomorph_eggs = 25
			xenomorph_offspring = 75
		}
		upkeep = { food = 2 }
	}
}

###############################################
# === xenomorph_queen_buildings.txt ===
###############################################
###############################################
# XENOMORPH QUEEN BUILDINGS (non-hive empires)
#
# Buildings that exploit captive Xenomorph QUEENS for egg production.
# Two flavours of the same role, so empires can lean tactical or thematic:
#
#  - Royal Egg Chamber (TACTICAL): a stripped-down, efficient industrial
#    operation. Maximum egg yield, minimal frills.
#  - Brood Matron's Bower (FLAVORFUL): an LV-inspired establishment that
#    pampers its captive queens, producing eggs alongside trade and amenities.
#
# Both require tech_xeno_husbandry and a captive Xenomorph present.
###############################################

@qb_time = 540

# --- ROYAL EGG CHAMBER (tactical: pure egg output) ---
building_xeno_royal_egg_chamber = {
	base_buildtime = @qb_time
	category = manufacturing

	building_sets = {
		urban
	}

	potential = {
		exists = owner
		owner = { is_gestalt = no }
		owner = { has_technology = tech_xeno_husbandry }
	}
	allow = {
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		owner = { is_gestalt = yes }
	}

	planet_modifier = {
		job_xeno_captive_queen_add = 2
		job_xeno_brood_specimen_add = 2
	}

	resources = {
		category = planet_buildings
		cost = { minerals = 700 alloys = 150 }
		upkeep = { energy = 6 food = 3 }
	}

	upgrades = { building_xeno_grand_hatchery }
}

# --- GRAND HATCHERY (tactical upgrade: more queens, more eggs) ---
building_xeno_grand_hatchery = {
	base_buildtime = @qb_time
	category = manufacturing

	building_sets = {
		urban
	}

	potential = {
		exists = owner
		owner = { is_gestalt = no }
		owner = { has_technology = tech_xeno_warrior_conscription }
	}
	allow = {
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		owner = { is_gestalt = yes }
	}

	planet_modifier = {
		job_xeno_captive_queen_add = 4
		job_xeno_brood_specimen_add = 3
	}

	resources = {
		category = planet_buildings
		cost = { minerals = 1200 alloys = 300 }
		upkeep = { energy = 10 food = 5 }
	}
}

# --- BROOD MATRON'S BOWER (flavorful: eggs + trade + amenities) ---
# LV-inspired: the captive queen is kept in indulgent comfort, her
# contentment turned to the empire's profit as well as her fertility.
building_xeno_brood_matrons_bower = {
	base_buildtime = @qb_time
	category = amenity

	building_sets = {
		urban
	}

	potential = {
		exists = owner
		owner = { is_gestalt = no }
		owner = { has_technology = tech_xeno_husbandry }
	}
	allow = {
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		owner = { is_gestalt = yes }
	}

	planet_modifier = {
		job_xeno_captive_queen_add = 2
		job_xeno_pleasure_handler_add = 1
		planet_amenities_add = 10
	}

	resources = {
		category = planet_buildings
		cost = { minerals = 600 consumer_goods = 100 }
		upkeep = { energy = 5 consumer_goods = 2 }
	}
}

###############################################
# === xenomorph_slave_sex_buildings.txt ===
###############################################
###############################################
# XENOMORPH SLAVE / SEX / HOST BUILDINGS
# Pass 20 redesign: 4 chains x 3 tiers + 2 standalone = 14 buildings.
#
# Chain 1 - OFFSPRING (slave breeding for xenomorph_offspring resource):
#   T1 Oviposition Chamber -> T2 Broodmare Pens -> T3 Royal Broodstock Hive
#   Civic-gated to civic_xenomorph_offspring_egg_economy OR
#   has_technology = tech_xenomorph_offspring_economy.
#
# Chain 2 - HOST IMPLANTATION (implanting hosts -> offspring + research):
#   T1 Host Processing -> T2 Breeding Pit -> T3 Apex Breeding Hive
#
# Chain 3 - SLAVE RESEARCH (slave brainpower):
#   T1 Host Observation Pens -> T2 Neural Harvest Alcoves -> T3 Apex Specimen Vault
#
# Chain 4 - SLAVE INDUSTRY (slave labor for minerals/alloys):
#   T1 Resin Labor Pits -> T2 Refined Resin Smelter -> T3 Apex Resin Forge
#
# Standalone (no chain):
#   Pheromone Conditioning (amenity / pacification)
#   Hunt Arena (amenity / recreation)
#
# All buildings: base_cap_amount = 1, T1 buildable, T2/T3 tech-gated.
# Scaling: T1 = 100 jobs, T2 = 200 jobs, T3 = 400 jobs (vanilla scale).
###############################################

@b1_time = 360
@b2_time = 720
@b3_time = 1080


#################################################################
# CHAIN 1 - OFFSPRING (civic OR research path required)
#################################################################

# T1 Oviposition Chamber
building_xenomorph_oviposition_chamber = {
	base_buildtime = @b1_time
	category = manufacturing
	base_cap_amount = 1

	building_sets = {
		government
		urban
		farming
	}

	potential = {
		exists = owner
		owner = {
			xeno_is_xenomorph_hive_country = yes
			has_technology = tech_xenomorph_offspring_economy
		}
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { owner = { has_technology = tech_xenomorph_offspring_economy } }
		}
	}

	planet_modifier = {
		job_xenomorph_broodmother_slave_add = 100
		planet_stability_add = -2
	}

	resources = {
		category = planet_buildings
		cost = { food = 400 minerals = 100 }
		upkeep = { food = 2 energy = 2 }
	}

	upgrades = { building_xenomorph_broodmare_pens }
}


# T2 Broodmare Pens
building_xenomorph_broodmare_pens = {
	base_buildtime = @b2_time
	category = manufacturing
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_broodmare_pens tech_xenomorph_broodmare_pens_researched }

	building_sets = {
		government
		urban
		farming
	}

	potential = {
		exists = owner
		owner = {
			xeno_is_xenomorph_hive_country = yes
			OR = {
				has_civic = civic_xenomorph_offspring_egg_economy
				has_technology = tech_xenomorph_offspring_economy
				has_country_flag = xenomorph_breeding_pits_unlocked
			}
		}
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			AND = {
				NOT = { owner = { has_civic = civic_xenomorph_offspring_egg_economy } }
				NOT = { owner = { has_technology = tech_xenomorph_offspring_economy } }
			}
		}
	}

	planet_modifier = {
		job_xenomorph_broodmare_thrall_add = 200
		planet_amenities_add = 250
		planet_stability_add = -4
	}

	resources = {
		category = planet_buildings
		cost = { food = 700 minerals = 200 exotic_gases = 25 }
		upkeep = { food = 4 energy = 3 xenomorph_offspring = 1 }
	}

	upgrades = { building_xenomorph_royal_broodstock_hive }
}


# T3 Royal Broodstock Hive (NEW)
building_xenomorph_royal_broodstock_hive = {
	base_buildtime = @b3_time
	category = manufacturing
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_royal_broodstock_hive tech_xenomorph_royal_broodstock_hive_researched }

	building_sets = {
		government
		urban
		farming
	}

	potential = {
		exists = owner
		owner = {
			xeno_is_xenomorph_hive_country = yes
			OR = {
				has_civic = civic_xenomorph_offspring_egg_economy
				has_technology = tech_xenomorph_offspring_economy
				has_country_flag = xenomorph_breeding_pits_upgraded
			}
		}
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			AND = {
				NOT = { owner = { has_civic = civic_xenomorph_offspring_egg_economy } }
				NOT = { owner = { has_technology = tech_xenomorph_offspring_economy } }
			}
		}
	}

	planet_modifier = {
		job_xenomorph_broodmother_slave_add = 200
		job_xenomorph_broodmare_thrall_add = 200
		planet_amenities_add = 500
		planet_stability_add = -6
	}

	resources = {
		category = planet_buildings
		cost = { food = 1000 minerals = 300 exotic_gases = 50 rare_crystals = 25 }
		upkeep = { food = 6 energy = 4 xenomorph_offspring = 2 rare_crystals = 1 }
	}
}


#################################################################
# CHAIN 2 - HOST IMPLANTATION
#################################################################

# T1 Host Processing
building_xenomorph_host_processing = {
	base_buildtime = @b1_time
	category = resource
	base_cap_amount = 1

	building_sets = {
		government
		urban
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_xenomorph_implantation_drone_gestalt_add = 100
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_xenomorph_implantation_drone_add = 100
	}

	planet_modifier = {
		planet_stability_add = -2
		pop_purge_speed = 0.15
	}

	resources = {
		category = planet_buildings
		cost = { food = 500 minerals = 100 }
		upkeep = { food = 2 energy = 2 }
	}

	upgrades = { building_xenomorph_breeding_pit }
}


# T2 Breeding Pit
building_xenomorph_breeding_pit = {
	base_buildtime = @b2_time
	category = manufacturing
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_breeding_pit }

	building_sets = {
		government
		urban
		farming
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
		planet = { num_pops >= 12 }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_xenomorph_pit_warden_gestalt_add = 200
		job_xenomorph_broodmother_slave_add = 100
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_xenomorph_pit_warden_add = 200
	}

	planet_modifier = {
		planet_stability_add = -5
		pop_purge_speed = 0.35
	}

	resources = {
		category = planet_buildings
		cost = { food = 800 minerals = 200 exotic_gases = 25 }
		upkeep = { food = 5 energy = 3 xenomorph_offspring = 1 }
	}

	upgrades = { building_xenomorph_apex_breeding_hive }
}


# T3 Apex Breeding Hive (NEW)
building_xenomorph_apex_breeding_hive = {
	base_buildtime = @b3_time
	category = manufacturing
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_apex_breeding_hive }

	building_sets = {
		government
		urban
		farming
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
		planet = { num_pops >= 12 }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_xenomorph_pit_warden_gestalt_add = 400
		job_xenomorph_broodmother_slave_add = 200
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_xenomorph_pit_warden_add = 400
	}

	planet_modifier = {
		planet_stability_add = -8
		planet_crime_add = 10
		pop_purge_speed = 0.60
	}

	resources = {
		category = planet_buildings
		cost = { food = 1200 minerals = 400 exotic_gases = 50 rare_crystals = 25 }
		upkeep = { food = 8 energy = 5 xenomorph_offspring = 2 rare_crystals = 1 }
	}
}


#################################################################
# CHAIN 3 - SLAVE RESEARCH
#################################################################

# T1 Host Observation Pens
building_xenomorph_host_observation_pens = {
	base_buildtime = @b1_time
	category = research
	base_cap_amount = 1
	prerequisites = { tech_xenomorph_host_observation_protocols }

	building_sets = {
		government
		urban
		research
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	planet_modifier = {
		job_xenomorph_specimen_thrall_add = 100
		planet_stability_add = -1
	}

	resources = {
		category = planet_buildings
		cost = { food = 500 energy = 200 }
		upkeep = { food = 3 energy = 2 }
	}

	upgrades = { building_xenomorph_neural_harvest_alcoves }
}


# T2 Neural Harvest Alcoves
building_xenomorph_neural_harvest_alcoves = {
	base_buildtime = @b2_time
	category = research
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_neural_harvesting }

	building_sets = {
		government
		urban
		research
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	planet_modifier = {
		job_xenomorph_synaptic_battery_add = 200
		planet_stability_add = -3
	}

	resources = {
		category = planet_buildings
		cost = { food = 800 energy = 400 exotic_gases = 25 }
		upkeep = { food = 5 energy = 4 xenomorph_offspring = 1 }
	}

	upgrades = { building_xenomorph_apex_specimen_vault }
}


# T3 Apex Specimen Vault (NEW)
building_xenomorph_apex_specimen_vault = {
	base_buildtime = @b3_time
	category = research
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_apex_specimen_vault }

	building_sets = {
		government
		urban
		research
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	planet_modifier = {
		job_xenomorph_specimen_thrall_add = 200
		job_xenomorph_synaptic_battery_add = 200
		planet_stability_add = -5
	}

	resources = {
		category = planet_buildings
		cost = { food = 1200 energy = 600 exotic_gases = 50 rare_crystals = 25 }
		upkeep = { food = 8 energy = 5 xenomorph_offspring = 2 rare_crystals = 1 }
	}
}


#################################################################
# CHAIN 4 - SLAVE INDUSTRY
#################################################################

# T1 Resin Labor Pits
building_xenomorph_resin_labor_pits = {
	base_buildtime = @b1_time
	category = resource
	base_cap_amount = 1
	prerequisites = { tech_xenomorph_resin_labor_conditioning }

	building_sets = {
		government
		urban
		industrial
		mining
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	planet_modifier = {
		job_xenomorph_resin_thrall_add = 100
	}

	resources = {
		category = planet_buildings
		cost = { food = 400 minerals = 300 }
		upkeep = { food = 3 }
	}

	upgrades = { building_xenomorph_refined_resin_smelter }
}


# T2 Refined Resin Smelter (NEW)
building_xenomorph_refined_resin_smelter = {
	base_buildtime = @b2_time
	category = resource
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_refined_resin_smelter }

	building_sets = {
		government
		urban
		industrial
		mining
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	planet_modifier = {
		job_xenomorph_resin_thrall_add = 200
		planet_jobs_alloys_produces_mult = 0.05
	}

	resources = {
		category = planet_buildings
		cost = { food = 700 minerals = 500 exotic_gases = 25 }
		upkeep = { food = 5 energy = 2 xenomorph_offspring = 1 }
	}

	upgrades = { building_xenomorph_apex_resin_industrial_forge }
}


# T3 Apex Resin Industrial Forge (NEW)
building_xenomorph_apex_resin_industrial_forge = {
	base_buildtime = @b3_time
	category = resource
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_apex_resin_industrial_forge }

	building_sets = {
		government
		urban
		industrial
		mining
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	planet_modifier = {
		job_xenomorph_resin_thrall_add = 400
		planet_jobs_alloys_produces_mult = 0.10
		planet_jobs_minerals_produces_mult = 0.05
	}

	resources = {
		category = planet_buildings
		cost = { food = 1000 minerals = 800 exotic_gases = 50 rare_crystals = 25 }
		upkeep = { food = 8 energy = 4 xenomorph_offspring = 2 rare_crystals = 1 }
	}
}


#################################################################
# STANDALONE - Pheromone Conditioning (amenity / pacification)
#################################################################

building_xenomorph_pheromone_conditioning = {
	base_buildtime = @b1_time
	category = amenity
	base_cap_amount = 1

	building_sets = {
		government
		urban
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_xenomorph_pheromone_drone_gestalt_add = 100
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_xenomorph_pheromone_drone_add = 100
	}

	planet_modifier = {
		planet_stability_add = 5
		planet_crime_add = -10
	}

	resources = {
		category = planet_buildings
		cost = { food = 400 }
		upkeep = { food = 2 energy = 1 }
	}
}


#################################################################
# STANDALONE - Hunt Arena (amenity / recreation)
#################################################################

building_xenomorph_hunt_arena = {
	base_buildtime = @b1_time
	category = amenity
	base_cap_amount = 1

	building_sets = {
		government
		urban
		entertainment
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	planet_modifier = {
		job_xenomorph_pit_plaything_add = 100
		planet_amenities_add = 200
		planet_stability_add = 1
	}

	resources = {
		category = planet_buildings
		cost = { food = 500 }
		upkeep = { food = 3 energy = 1 }
	}
}

# ============================================================
# Host Conditioning Chamber - slave-processing equivalent (reduces slave political power)
# ============================================================
building_xenomorph_host_conditioning = {
	base_buildtime = @b1_time
	category = government
	base_cap_amount = 1

	building_sets = { government urban }

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}
	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}
	planet_modifier = {
		pop_political_power = -0.30
		planet_stability_add = 3
	}
	resources = {
		category = planet_buildings
		cost = { food = 300 minerals = 75 }
		upkeep = { energy = 2 }
	}
}

# ============================================================
# XENOMORPH OFFSPRING PRODUCTION CHAIN (Xeno-only, nonlethal)
# ============================================================
building_xenomorph_self_seeding_brood_hive = {
	base_buildtime = @b1_time
	category = pop_assembly
	base_cap_amount = 1
	building_sets = { government urban farming }

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_xenomorph_self_seeding_brood_layer_gestalt_add = 2
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_xenomorph_self_seeding_brood_layer_add = 2
	}

	planet_modifier = {
		pop_growth_speed = 0.1
	}

	resources = {
		category = planet_buildings
		cost = { food = 300 minerals = 75 }
		upkeep = { food = 2 energy = 1 }
	}
	upgrades = { building_xenomorph_autogenic_breeding_warren }
}
building_xenomorph_autogenic_breeding_warren = {
	base_buildtime = @b2_time
	category = pop_assembly
	base_cap_amount = 1
	can_build = no
	building_sets = { government urban farming }

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_xenomorph_self_seeding_brood_layer_gestalt_add = 3
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_xenomorph_self_seeding_brood_layer_add = 3
	}

	planet_modifier = {
		pop_growth_speed = 0.2
	}

	resources = {
		category = planet_buildings
		cost = { food = 600 minerals = 150 }
		upkeep = { food = 4 energy = 2 xenomorph_eggs = 1 }
	}
	upgrades = { building_xenomorph_royal_self_breeding_hive }
}
building_xenomorph_royal_self_breeding_hive = {
	base_buildtime = @b3_time
	category = pop_assembly
	base_cap_amount = 1
	can_build = no
	building_sets = { government urban farming }

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_xenomorph_self_seeding_brood_layer_gestalt_add = 4
		job_xenomorph_royal_jelly_tender_gestalt_add = 1
		job_xenomorph_brood_nectar_drone_add = 1
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_xenomorph_self_seeding_brood_layer_add = 4
		job_xenomorph_royal_jelly_tender_add = 1
	}

	planet_modifier = {
		pop_growth_speed = 0.3
		planet_jobs_unity_produces_mult = 0.1
	}

	resources = {
		category = planet_buildings
		cost = { food = 1000 minerals = 300 exotic_gases = 25 }
		upkeep = { food = 6 energy = 3 xenomorph_eggs = 2 }
	}
}
