###############################################
# === xenomorph_captor_buildings.txt ===
###############################################
###############################################
# XENOMORPH CAPTOR BUILDINGS (non-hive empires)
#
# Buildings that let non-hive empires exploit captured Xenomorphs.
# Gated to non-gestalt empires that have Xeno livestock (a pacified-Xeno
# deposit OR enslaved Xenomorph pops). Most require a tech to unlock.
#
# Building -> tech:
#   Zoo            -> tech_xeno_containment (the entry tech)
#   Pleasure Den   -> tech_xeno_exploitation
#   Vivisection Lab-> tech_xeno_vivisection (also unlocks Xeno soldiers)
#   Egg Hatchery   -> tech_xeno_husbandry
#   Breeding Vats  -> tech_xeno_husbandry
###############################################

@cb_time = 480

# Shared gate: a non-gestalt empire that owns Xeno livestock on this planet
# (either a pacified-Xeno deposit or enslaved Xenomorph pops present).

# --- XENO ZOO (entry building): amenities + research ---
building_xeno_zoo = {
	base_buildtime = @cb_time
	category = amenity

	building_sets = {
		urban
	}

	potential = {
		exists = owner
		owner = { is_gestalt = no }
		owner = { has_technology = tech_xeno_containment }
	}
	allow = {
		OR = {
			has_deposit = d_pacified_xenomorphs
			any_owned_pop_group = { is_xenomorph = yes }
		}
	}
	destroy_trigger = {
		exists = owner
		owner = { is_gestalt = yes }
	}

	planet_modifier = {
		job_xeno_keeper_add = 2
		job_xeno_specimen_add = 2
	}

	resources = {
		category = planet_buildings
		cost = { minerals = 400 }
		upkeep = { energy = 3 }
	}
}

# --- XENO PLEASURE DEN: amenities + trade (commercial exploitation) ---
building_xeno_pleasure_den = {
	icon = building_lv_brothel
	base_buildtime = @cb_time
	category = amenity

	building_sets = {
		urban
	}

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

	planet_modifier = {
		job_xeno_pleasure_handler_add = 2
		job_xeno_pleasure_specimen_add = 3
	}

	resources = {
		category = planet_buildings
		cost = { minerals = 500 }
		upkeep = { energy = 4 }
	}
}

# --- XENO VIVISECTION LAB: research (and unlocks Xeno soldier armies) ---
building_xeno_vivisection_lab = {
	icon = building_research_lab_1
	base_buildtime = @cb_time
	category = research

	building_sets = {
		research
	}

	potential = {
		exists = owner
		owner = { is_gestalt = no }
		owner = { has_technology = tech_xeno_vivisection }
	}
	allow = {
		OR = {
			has_deposit = d_pacified_xenomorphs
			any_owned_pop_group = { is_xenomorph = yes }
		}
	}
	destroy_trigger = {
		exists = owner
		owner = { is_gestalt = yes }
	}

	planet_modifier = {
		job_xeno_vivisector_add = 2
		job_xeno_specimen_add = 1
	}

	resources = {
		category = planet_buildings
		cost = { minerals = 500 alloys = 100 }
		upkeep = { energy = 4 }
	}
}

# --- XENO EGG HATCHERY: produces eggs ---
building_xeno_egg_hatchery = {
	icon = building_clone_vats
	base_buildtime = @cb_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_brood_specimen_add = 3
	}

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

# --- XENO BREEDING VATS: reproduces more Xenos (eggs + offspring) ---
building_xeno_breeding_vats = {
	icon = building_clone_vats
	base_buildtime = @cb_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_breeder_add = 2
		job_xeno_brood_specimen_add = 2
		planet_pop_assembly_mult = 0.10
	}

	resources = {
		category = planet_buildings
		cost = { minerals = 600 food = 300 }
		upkeep = { energy = 5 food = 2 }
	}
}

###############################################
# === xenomorph_captor_lv_buildings.txt ===
###############################################
###############################################
# XENOMORPH CAPTOR x LUSTFUL VOID BUILDINGS (compat)
#
# Optional deeper integration: buildings that put captive Xenomorphs to work
# in Lustful Void's own job systems (milk, breeding). These ONLY appear when
# Lustful Void is loaded (global flag lustful_void_mod_loaded), so the base
# mod has no hard dependency on LV.
#
# Flavour is LV-inspired but written in a commercial/biological register.
# Jobs referenced (lv_milk_cow, lv_breeder) are LV's; guarded by the flag so
# they are never referenced unless LV is present.
###############################################

@lvcb_time = 480

# --- XENO DAIRY (LV milk integration) ---
# Captive Xenomorphs worked as LV milk-stock. Requires LV + Xeno husbandry.
building_xeno_lv_dairy = {
	icon = building_lv_corporate_dairy
	base_buildtime = @lvcb_time
	category = resource

	building_sets = {
		urban
	}

	potential = {
		exists = owner
		has_global_flag = lustful_void_mod_loaded
		owner = { is_gestalt = no }
		owner = { has_technology = tech_xeno_husbandry }
	}
	allow = {
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { has_global_flag = lustful_void_mod_loaded }
			owner = { is_gestalt = yes }
		}
	}

	# Uses LV's milk-cow job (only ever evaluated when LV is loaded).
	planet_modifier = {
		job_lv_milk_cow_add = 3
	}

	resources = {
		category = planet_buildings
		cost = { minerals = 500 food = 200 }
		upkeep = { energy = 4 }
	}
}

# --- XENO BREEDING PENS (LV breeder integration) ---
# Captive Xenomorphs worked as LV breeding-stock. Requires LV + Xeno husbandry.
building_xeno_lv_breeding_pens = {
	icon = building_clone_vats
	base_buildtime = @lvcb_time
	category = resource

	building_sets = {
		urban
	}

	potential = {
		exists = owner
		has_global_flag = lustful_void_mod_loaded
		owner = { is_gestalt = no }
		owner = { has_technology = tech_xeno_husbandry }
	}
	allow = {
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { has_global_flag = lustful_void_mod_loaded }
			owner = { is_gestalt = yes }
		}
	}

	planet_modifier = {
		job_lv_breeder_add = 3
		planet_pop_assembly_mult = 0.10
	}

	resources = {
		category = planet_buildings
		cost = { minerals = 600 food = 300 }
		upkeep = { energy = 5 food = 2 }
	}
}

###############################################
# === xenomorph_hive_lv_buildings.txt ===
###############################################
###############################################
# XENOMORPH HIVE — LV-INSPIRED BUILDINGS
#
# Two groups:
#  A) NATIVE buildings (no dependency): use the hive's own LV-inspired drone
#     jobs (brood nectar / nurture / pheromone pleasure). Always available to
#     a Xenomorph hive.
#  B) LV-INTEGRATION buildings (compat-gated by lustful_void_mod_loaded): put
#     Xenomorph drones to work in Lustful Void's own drone-job systems.
#
# All gestalt-gated to a Xenomorph hive. Descriptions in a hive register.
###############################################

@hlv_time = 480

# ==================================================================
# A) NATIVE LV-INSPIRED HIVE BUILDINGS
# ==================================================================

# --- BROOD NECTAR GALLERY: royal-jelly/food "milk" analogue ---
building_xenomorph_brood_nectar_gallery = {
	icon = building_gene_clinic
	base_buildtime = @hlv_time
	category = resource

	building_sets = {
		government
		urban
		farming
	}

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

	planet_modifier = {
		job_xenomorph_brood_nectar_drone_add = 200
	}

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

# --- HATCHLING NURSERY: nurture/amenities + offspring ---
building_xenomorph_hatchling_nursery = {
	icon = building_clone_vats
	base_buildtime = @hlv_time
	category = manufacturing

	building_sets = {
		government
		urban
	}

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

	planet_modifier = {
		job_xenomorph_nurture_drone_add = 200
		planet_amenities_add = 100
	}

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

# --- PHEROMONE PLEASURE WARRENS: comfort/amenities + unity ---

# ==================================================================
# B) LV-INTEGRATION HIVE BUILDINGS (only if Lustful Void is loaded)
# ==================================================================

# --- HIVE DAIRY WARREN: Xeno drones in LV's milk system ---
building_xenomorph_hive_lv_dairy = {
	icon = building_lv_corporate_dairy
	base_buildtime = @hlv_time
	category = resource

	building_sets = {
		government
		urban
		farming
	}

	potential = {
		exists = owner
		has_global_flag = lustful_void_mod_loaded
		owner = { xeno_is_xenomorph_hive_country = yes }
	}
	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { has_global_flag = lustful_void_mod_loaded }
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
		}
	}

	# LV's milk drone (only ever evaluated when LV is loaded).
	planet_modifier = {
		job_lv_milk_drone_add = 300
	}

	resources = {
		category = planet_buildings
		cost = { food = 400 minerals = 150 }
		upkeep = { energy = 4 }
	}
}

# --- HIVE BREEDING WARREN: Xeno drones in LV's breeding system ---
building_xenomorph_hive_lv_breeding = {
	icon = building_clone_vats
	base_buildtime = @hlv_time
	category = resource

	building_sets = {
		government
		urban
		farming
	}

	potential = {
		exists = owner
		has_global_flag = lustful_void_mod_loaded
		owner = { xeno_is_xenomorph_hive_country = yes }
	}
	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { has_global_flag = lustful_void_mod_loaded }
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
		}
	}

	planet_modifier = {
		job_lv_breeder_drone_add = 300
		planet_pop_assembly_mult = 0.10
	}

	resources = {
		category = planet_buildings
		cost = { food = 500 minerals = 200 }
		upkeep = { energy = 5 }
	}
}

# --- HIVE PLEASURE WARREN: Xeno drones in LV's pleasure system ---

