#############
# Government buildings
#############
building_noble_estates = {
	base_buildtime = @b2_time
	icon = building_palace
	planet_limit = 1

	category = government

	building_sets = {
		government
		urban
	}

	potential = {
		exists = owner
		owner = {
			has_valid_civic = civic_aristocratic_elite
		}
		NOT = { has_modifier = slave_colony }
	}

	allow = {
		has_upgraded_capital = yes
		orbital_ring_and_arkship_equivalent_absent = {
			RING = ring_noble_estates
			ARKSHIP = arkship_noble_estates
		}
	}

	destroy_trigger = {
		exists = owner
		NOT = {
			owner = { has_civic = civic_aristocratic_elite }
		}
	}

	planet_modifier = {
		planet_housing_add = 100
	}

	inline_script = {
		script = "jobs/politician_add"
		AMOUNT = @building_static_jobs_low
	}

	resources = {
		category = planet_buildings
		inline_script = {
			script = buildings/nomadic_cost_switcher
			REGULAR_RESOURCE = minerals
			NOMADIC_RESOURCE = alloys
			COST = @b1_minerals
			NOMADIC_COST_MULT = @nomadic_minerals_to_strategic_ratio
		}
		upkeep = {
			energy = 2
		}
	}
}

building_slave_processing = {
	base_buildtime = @b1_time
	planet_limit = 1

	category = government

	building_sets = {
		government
		urban
	}

	potential = {
		owner = {
			is_regular_empire = yes
			OR = {
				has_policy_flag = slavery_allowed
				has_exploited_disconnected_drones = yes
			}
		}
		NOT = { has_modifier = resort_colony }
	}

	allow = {
		has_upgraded_capital = yes
		orbital_ring_and_arkship_equivalent_absent = {
			RING = ring_slave_processing_facility
			ARKSHIP = arkship_slave_processing_facility
		}
	}

	destroy_trigger = { # destroys if true
		exists = owner
		OR = {
			owner = {
				NOR = {
					is_regular_empire = yes
					has_policy_flag = slavery_allowed
					has_exploited_disconnected_drones = yes
				}
			}
			has_modifier = resort_colony
		}
	}

	planet_modifier = {
		pop_slave_bonus_workforce_mult = 0.10
		pop_slave_political_power = -0.25
		planet_resettlement_unemployed_mult = -0.50
	}

	resources = {
		category = planet_buildings
		inline_script = {
			script = buildings/nomadic_cost_switcher
			REGULAR_RESOURCE = minerals
			NOMADIC_RESOURCE = alloys
			COST = @b1_minerals
			NOMADIC_COST_MULT = @nomadic_minerals_to_strategic_ratio
		}
		upkeep = {
			energy = 2
		}
	}

	prerequisites = {
		"tech_neural_implants"
	}

	triggered_desc = {
		text = building_slave_processing_slave_army_effect_desc
	}
}

building_precinct_house = {
	base_buildtime = @b1_time

	category = government

	building_sets = {
		government
		urban
	}

	potential = {
		owner = {
			is_regular_empire = yes
			NOT = { has_valid_civic = civic_civil_education }
		}
		NOT = { has_modifier = slave_colony }
	}

	allow = {
		hidden_trigger = {
			OR = {
				owner = { is_ai = no }
				AND = {
					NOT = { has_forbidden_jobs = enforcer }
					NOT = { has_available_jobs = enforcer }
				}
			}
		}
	}

	destroy_trigger = {
		OR = {
			AND = {
				exists = owner
				owner = { is_regular_empire = no }
			}
			AND = {
				exists = owner
				owner = { has_valid_civic = civic_civil_education }
			}
			has_modifier = slave_colony
		}
	}

	convert_to = {
		building_state_academy
	}

	inline_script = {
		script = jobs/enforcers_add
		AMOUNT = 200
	}

	resources = {
		category = planet_buildings
		inline_script = {
			script = buildings/nomadic_cost_switcher
			REGULAR_RESOURCE = minerals
			NOMADIC_RESOURCE = alloys
			COST = @b1_minerals
			NOMADIC_COST_MULT = @nomadic_minerals_to_strategic_ratio
		}
		upkeep = {
			energy = 2
		}
	}

	prerequisites = {
		"tech_planetary_government"
	}

	show_tech_unlock_if = {
		is_regular_empire = yes
		NOT = { has_valid_civic = civic_civil_education }
	}

	upgrades = {
		building_hall_judgment
	}
}

building_hall_judgment = {
	base_buildtime = @b2_time

	category = government
	can_build = no

	building_sets = {
		government
		urban
	}

	potential = {
		owner = {
			is_regular_empire = yes
			NOT = { has_valid_civic = civic_civil_education }
		}
		NOT = { has_modifier = slave_colony }
		if = {
			limit = {
				owner = { is_ai = yes }
			}
			NOT = { has_forbidden_jobs = enforcer }
			NOT = { has_available_jobs = enforcer }
		}
	}

	destroy_trigger = {
		exists = owner
		owner = {
			OR = {
				is_regular_empire = no
				has_valid_civic = civic_civil_education
			}
		}
	}

	convert_to = {
		building_center_of_guidance
	}

	inline_script = {
		script = jobs/enforcers_add
		AMOUNT = 500
	}

	resources = {
		category = planet_buildings
		inline_script = {
			script = buildings/nomadic_cost_switcher
			REGULAR_RESOURCE = minerals
			NOMADIC_RESOURCE = alloys
			COST = @b2_minerals
			NOMADIC_COST_MULT = @nomadic_minerals_to_strategic_ratio
		}
		cost = {
			volatile_motes = @b2_rare_cost
		}
		upkeep = {
			energy = @b1_upkeep
			volatile_motes = @b2_rare_upkeep
		}
	}

	prerequisites = {
		"tech_colonial_centralization"
	}

	show_tech_unlock_if = {
		is_regular_empire = yes
		NOT = { has_valid_civic = civic_civil_education }
	}
}

building_state_academy = {
	base_buildtime = @b1_time
	planet_limit = 3
	category = government

	building_sets = {
		government
		urban
	}

	potential = {
		exists = owner
		owner = { has_valid_civic = civic_civil_education }
		NOT = { has_modifier = slave_colony }
	}

	destroy_trigger = {
		exists = owner
		NOT = {	owner = { has_valid_civic = civic_civil_education } }
	}

	convert_to = {
		building_precinct_house
	}

	planet_modifier = {
		planet_civilians_physics_research_produces_add = 0.1
		planet_civilians_society_research_produces_add = 0.1
		planet_civilians_engineering_research_produces_add = 0.1
		planet_civilians_consumer_goods_upkeep_add = 0.25
	}

	inline_script = {
		script = jobs/enforcers_add
		AMOUNT = 200
	}

	resources = {
		category = planet_buildings
		inline_script = {
			script = buildings/nomadic_cost_switcher
			REGULAR_RESOURCE = minerals
			NOMADIC_RESOURCE = alloys
			COST = @b1_minerals
			NOMADIC_COST_MULT = @nomadic_minerals_to_strategic_ratio
		}
		upkeep = {
			energy = 2
		}
	}

	prerequisites = {
		"tech_planetary_government"
	}

	show_tech_unlock_if = {
		is_regular_empire = yes
		has_valid_civic = civic_civil_education
	}

	upgrades = {
		building_center_of_guidance
	}
}

building_center_of_guidance = {
	base_buildtime = @b2_time

	category = government
	can_build = no

	building_sets = {
		government
		urban
	}

	potential = {
		owner = { has_valid_civic = civic_civil_education }
		NOT = { has_modifier = slave_colony }
	}

	destroy_trigger = {
		exists = owner
		owner = { NOT = { has_valid_civic = civic_civil_education } }
	}

	convert_to = {
		building_hall_judgment
	}


	planet_modifier = {
		planet_civilians_physics_research_produces_add = 0.2
		planet_civilians_society_research_produces_add = 0.2
		planet_civilians_engineering_research_produces_add = 0.2
		planet_civilians_consumer_goods_upkeep_add = 0.5
	}

	inline_script = {
		script = jobs/enforcers_add
		AMOUNT = 500
	}

	resources = {
		category = planet_buildings
		inline_script = {
			script = buildings/nomadic_cost_switcher
			REGULAR_RESOURCE = minerals
			NOMADIC_RESOURCE = alloys
			COST = @b2_minerals
			NOMADIC_COST_MULT = @nomadic_minerals_to_strategic_ratio
		}
		cost = {
			volatile_motes = @b2_rare_cost
		}
		upkeep = {
			energy = @b1_upkeep
			volatile_motes = @b2_rare_upkeep
		}
	}

	prerequisites = {
		"tech_colonial_centralization"
	}

	show_tech_unlock_if = {
		is_regular_empire = yes
		has_valid_civic = civic_civil_education
	}
}

building_sentinel_posts = {
	base_buildtime = @b1_time

	category = government

	building_sets = {
		government
		urban
	}

	potential = {
		exists = owner
		owner = { is_gestalt = yes }
		owner = { is_wilderness_empire = no }
	}

	allow = {
		hidden_trigger = {
			OR = {
				owner = { is_ai = no }
				AND = {
					NOT = { has_building = building_sentinel_posts }
					NOT = { has_forbidden_jobs = patrol_drone }
					NOT = { has_available_jobs = patrol_drone }
				}
			}
		}
	}

	destroy_trigger = {
		exists = owner
		NOT = {
			owner = { is_gestalt = yes }
		}
	}

	planet_modifier = {
		job_patrol_drone_add = 200
	}

	resources = {
		category = planet_buildings
		inline_script = {
			script = buildings/nomadic_cost_switcher
			REGULAR_RESOURCE = minerals
			NOMADIC_RESOURCE = alloys
			COST = @b1_minerals
			NOMADIC_COST_MULT = @nomadic_minerals_to_strategic_ratio
		}
		upkeep = {
			energy = 2
		}
	}

	prerequisites = {
		"tech_planetary_government"
	}

	show_tech_unlock_if = {
		is_gestalt = yes
	}
}

building_order_keep = {
	base_buildtime = 180

	can_demolish = no
	can_be_disabled = no

	empire_limit = {
		base = 1
	}

	category = government

	building_sets = {
		knights
	}

	potential = {
		owner = {
			has_origin = origin_toxic_knights
			NOT = {
				has_country_flag = quest_abandoned
			}
		}
		planet = {
			OR = {
				has_planet_flag = toxic_knights_habitat
				has_planet_flag = toxic_knights_settled_world
				has_carrier_flag = toxic_knights_arkship
			}
		}
	}

	destroy_trigger = {
		NOT = {
			owner? = {
				has_origin = origin_toxic_knights
			}
		}
	}

	planet_modifier = {
		job_knight_add = @building_static_jobs
		planet_resettlement_unemployed_destination_mult = 1
	}

	triggered_planet_modifier = {
		potential = {
			owner = {
				has_country_flag = toxoids_7060_A
			}
		}
		job_knight_add = @building_static_jobs
	}

	triggered_planet_modifier = {
		potential = {
			owner = {
				NOT = {
					has_country_flag = quest_over
				}
			}
		}
		modifier = {
			job_knight_add = @building_static_jobs
		}
	}

	triggered_planet_modifier = {
		potential = {
			owner = {
				has_country_flag = toxoids_7090_a
			}
		}
		planet_stability_add = 5
	}

	triggered_planet_modifier = {
		potential = {
			owner = {
				has_country_flag = toxoids_7130_a
			}
		}
		job_knight_add = @building_static_jobs
	}

	triggered_planet_modifier = {
		potential = {
			owner = {
				has_country_flag = toxoids_7060_B
			}
		}
		job_knight_add = @building_static_jobs
	}

	triggered_planet_modifier = {
		potential = {
			owner = {
				has_country_flag = toxoids_7040_c
			}
		}
		job_knight_add = @building_static_jobs
	}

	triggered_planet_modifier = {
		potential = {
			owner = {
				has_country_flag = toxoids_7095_a
			}
		}
		job_knight_add = @building_static_jobs
	}

	triggered_planet_modifier = {
		potential = {
			owner = {
				has_country_flag = toxoids_7160_a
			}
		}
		job_knight_add = @building_static_jobs
	}

	resources = {
		inline_script = {
			script = buildings/nomadic_cost_switcher
			REGULAR_RESOURCE = minerals
			NOMADIC_RESOURCE = alloys
			COST = 1000
			NOMADIC_COST_MULT = @nomadic_minerals_to_strategic_ratio
		}
		category = planet_buildings
	}

	triggered_desc = {
		text = building_order_keep_effect
	}
}

building_order_castle = {
	icon = building_order_holding
	base_buildtime = 180
	can_demolish = no
	can_be_disabled = no
	can_build = no

	category = government

	building_sets = {
		knights
	}

	destroy_trigger = {
		OR = {
			NOT = { exists = owner }
			NOT = { owner = { has_origin = origin_toxic_knights } }
		}
	}

	planet_modifier = {
		job_knight_add = @building_static_jobs
		planet_resettlement_unemployed_destination_mult = 0.2
	}

	triggered_planet_modifier = {
		potential = {
			owner = { NOT = { has_country_flag = quest_over } }
		}
		modifier = {
			job_knight_add = @building_static_jobs
		}
	}

	resources = {
		category = planet_buildings
	}

	triggered_desc = {
		text = building_order_keep_effect
	}
}

#############
# Ascension perks
#############

#Psionic path
building_psi_corps = {
	base_buildtime = @b2_time

	category = government

	building_sets = {
		government
		urban
	}

	planet_limit = 1

	potential = {
		owner = {
			has_psi_corps_tradition = yes
			NOT = { has_origin = origin_endbringers }
		}
		OR = {
			NOR = {
				has_modifier = resort_colony
				has_modifier = slave_colony
			}
			AND = { # Allow PSI Corps on pleasure worlds
				has_modifier = resort_colony
				has_designation = col_pleasure
			}
		}
	}

	allow = {
		orbital_ring_and_arkship_equivalent_absent = {
			RING = ring_psi_corps
			ARKSHIP = arkship_psi_corps
		}
	}

	destroy_trigger = {
		exists = owner
		owner = {
			has_psi_corps_tradition = no
		}
	}

	inline_script = {
		script = jobs/telepaths_add
		AMOUNT = 200
	}
	planet_modifier = {
		planet_stability_add = 2
	}

	triggered_planet_modifier = {
		potential = {
			OR = {
				num_assigned_jobs = {
					job = telepath
					value > 0
				}
				num_assigned_jobs = {
					job = dystopian_telepath
					value > 0
				}
				num_assigned_jobs = {
					job = telepath_drone
					value > 0
				}
			}
		}
		psionic_pop_bonus_workforce_mult = 1
		mult = value:psionic_workforce_from_telepaths
		# This is on the building instead of the jobs to prevent an infinite workforce loop
	}

	resources = {
		category = planet_buildings
		inline_script = {
			script = buildings/nomadic_cost_switcher
			REGULAR_RESOURCE = minerals
			NOMADIC_RESOURCE = alloys
			COST = 500
			NOMADIC_COST_MULT = @nomadic_minerals_to_strategic_ratio
		}
		upkeep = {
			energy = @b2_upkeep
		}
	}

	triggered_desc = {
		text = psionic_bonus_workforce_from_telepaths_tt
	}

	is_essential = yes
}

building_embassy = {
	base_buildtime = @b2_time

	category = government

	building_sets = {
		government
		urban
	}

	planet_limit = 1

	potential = {
		exists = owner
		owner = { is_regular_empire = yes }

		exists = planet
		planet = { is_capital = yes }
		NOT = { has_modifier = resort_colony }
		NOT = { has_modifier = slave_colony }
	}

	upgrades = {
		"building_grand_embassy"
	}

	allow = {
		has_upgraded_capital = yes
		orbital_ring_and_arkship_equivalent_absent = {
			RING = ring_embassy_complex
			ARKSHIP = arkship_embassy_complex
		}
	}

	destroy_trigger = {
		OR = {
			AND = {
				exists = owner
				owner = { is_regular_empire = no }
			}
			planet = { is_capital = no }
		}
	}

	country_modifier = {
		envoys_add = 1
	}

	inline_script = {
		script = "jobs/politician_add"
		AMOUNT = @building_static_jobs_low
	}

	resources = {
		category = planet_buildings
		inline_script = {
			script = buildings/nomadic_cost_switcher
			REGULAR_RESOURCE = minerals
			NOMADIC_RESOURCE = alloys
			COST = @b2_minerals
			NOMADIC_COST_MULT = @nomadic_minerals_to_strategic_ratio
		}
		cost = {
			rare_crystals = @b2_rare_cost
		}
		upkeep = {
			energy = @b2_upkeep
			rare_crystals = @b2_rare_upkeep
		}
	}

	show_tech_unlock_if = {
		is_regular_empire = yes
	}

	prerequisites = {
		"tech_xeno_diplomacy"
	}
}

building_grand_embassy = {
	base_buildtime = @b3_time
	can_build = no

	category = government

	building_sets = {
		government
		urban
	}

	potential = {
		exists = owner
		owner = { is_regular_empire = yes }

		planet = { is_capital = yes }
		NOT = { has_modifier = resort_colony }
		NOT = { has_modifier = slave_colony }
	}

	allow = {
		has_major_upgraded_capital = yes
		orbital_ring_and_arkship_equivalent_absent = {
			RING = ring_embassy_complex
			ARKSHIP = arkship_embassy_complex
		}
	}

	destroy_trigger = {
		OR = {
			AND = {
				exists = owner
				owner = { is_regular_empire = no }
			}
			planet = { is_capital = no }
		}
	}

	country_modifier = {
		envoys_add = 2
	}

	inline_script = {
		script = "jobs/politician_add"
		AMOUNT = @building_static_jobs
	}

	resources = {
		category = planet_buildings
		inline_script = {
			script = buildings/nomadic_cost_switcher
			REGULAR_RESOURCE = minerals
			NOMADIC_RESOURCE = alloys
			COST = @b3_minerals
			NOMADIC_COST_MULT = @nomadic_minerals_to_strategic_ratio
		}
		cost = {
			rare_crystals = @b3_rare_cost
		}
		upkeep = {
			energy = @b3_upkeep
			rare_crystals = @b3_rare_upkeep
		}
	}

	prerequisites = {
		"tech_xeno_relations"
	}

	show_tech_unlock_if = {
		is_regular_empire = yes
	}
}

building_gaiaseeders_1 = {
	base_buildtime = @b2_time
	planet_limit = 1
	can_be_disabled = no
	upgrades = { "building_gaiaseeders_2" }

	category = government

	building_sets = {
		government
		urban
	}

	potential = {
		exists = owner
		owner = {
			is_country_type = default
			is_idyllic_bloom_empire = yes
		}
		NOR = {
			is_planet_class = pc_gaia
			is_planet_class = pc_city
			is_planet_class = pc_hive
			is_planet_class = pc_machine
			is_planet_class = pc_relic
		}
		is_artificial = no
	}

	allow = {
		has_upgraded_capital = yes
	}

	destroy_trigger = {
		OR = {
			is_planet_class = pc_gaia	# No double bonuses if player uses other tools to turn it into a Gaia world.
			is_planet_class = pc_city
			is_planet_class = pc_hive
			is_planet_class = pc_machine
			is_planet_class = pc_relic
			NOT = { exists = owner }
			owner = {
				is_idyllic_bloom_empire = no
			}
		}
	}

	resources = {
		category = planet_buildings
		cost = {
			energy = 1500
			multiplier = value:gaiaseeder_cost_mult
		}

		cost = {
			trigger = {
				exists = owner
				owner = {
					is_wilderness_empire = yes
				}
			}
			biomass = 200
		}

		upkeep = {
			energy = 20
			multiplier = value:gaiaseeder_upkeep
		}
	}

	inline_script = {
		script = buildings/on_all_wilderness_buildings_districts
	}

	planet_modifier = {
		logistic_growth_mult = 0.1
	}
}

building_gaiaseeders_2 = {
	base_buildtime = @b2_time
	can_build = no
	can_be_disabled = no
	upgrades = { "building_gaiaseeders_3" }

	category = government

	building_sets = {
		government
		urban
	}

	resources = {
		category = planet_buildings
		cost = {
			energy = 1500
			exotic_gases = @b2_rare_cost
		}

		cost = {
			trigger = {
				exists = owner
				owner = {
					is_wilderness_empire = yes
				}
			}
			biomass = 400
		}

		upkeep = {
			energy = 20
			exotic_gases = @b2_rare_upkeep
			multiplier = value:gaiaseeder_upkeep
		}
	}

	destroy_trigger = {
		OR = {
			is_planet_class = pc_gaia
			is_planet_class = pc_city
			is_planet_class = pc_hive
			is_planet_class = pc_machine
			NOT = { exists = owner }
			owner = {
				is_idyllic_bloom_empire = no
			}
		}
	}

	allow = {
		exists = planet
		planet = {
			can_build_gaiaseeder = yes
		}
	}

	inline_script = {
		script = buildings/on_all_wilderness_buildings_districts
	}

	planet_modifier = {
		logistic_growth_mult = 0.05
		pop_environment_tolerance = 0.1
	}
}

building_gaiaseeders_3 = {
	base_buildtime = @b2_time
	can_build = no
	can_be_disabled = no
	upgrades = { "building_gaiaseeders_4" }

	category = government

	building_sets = {
		government
		urban
	}

	resources = {
		category = planet_buildings
		cost = {
			energy = 1500
			exotic_gases = @b3_rare_cost
		}

		cost = {
			trigger = {
				exists = owner
				owner = {
					is_wilderness_empire = yes
				}
			}
			biomass = 600
		}

		upkeep = {
			energy = 20
			exotic_gases = @b3_rare_upkeep
			multiplier = value:gaiaseeder_upkeep
		}
	}

	destroy_trigger = {
		OR = {
			is_planet_class = pc_gaia
			is_planet_class = pc_city
			is_planet_class = pc_hive
			is_planet_class = pc_machine
			NOT = { exists = owner }
			owner = {
				is_idyllic_bloom_empire = no
			}
		}
	}

	inline_script = {
		script = buildings/on_all_wilderness_buildings_districts
	}

	allow = {
		exists = planet
		planet = {
			can_build_gaiaseeder = yes
		}
	}

	planet_modifier = {
		pop_environment_tolerance = 0.2
	}
}

building_gaiaseeders_4 = {
	base_buildtime = @b2_time
	can_build = no
	can_demolish = no
	can_be_ruined = no
	can_be_disabled = no
	position_priority = 0

	category = government

	building_sets = {
		government
		urban
	}

	destroy_trigger = {
		OR = {
			NOT = {
				is_planet_class = pc_gaia
			}
			NOT = { exists = owner }
			owner = {
				is_idyllic_bloom_empire = no
			}
		}
	}

	resources = {
		category = planet_buildings
		cost = {
			energy = 1500
			exotic_gases = @b4_rare_cost
		}

		cost = {
			trigger = {
				exists = owner
				owner = {
					is_wilderness_empire = yes
				}
			}
			biomass = 800
		}

		upkeep = {
			energy = @b4_upkeep
			exotic_gases = @b3_rare_upkeep
			multiplier = value:gaiaseeder_cost_mult
		}
	}

	inline_script = {
		script = buildings/on_all_wilderness_buildings_districts
	}

	triggered_desc = {
		text = building_gaiaseeders_4_effect_desc
		trigger = {
			exists = planet
			planet = {
				NOT = {
					is_planet_class = pc_gaia
				}
			}
		}
	}

	triggered_desc = {
		text = gaia_seeder_bloomed_pops_effect
	}

	triggered_desc = {
		text = gaia_seeder_bloom_timer_tooltip
		trigger = {
			has_carrier_flag = gaia_seeder_bloom_timer
		}
	}
}

building_gaiaseeders_pc_gaia = {
	base_buildtime = @b2_time
	planet_limit = 1
	can_demolish = no
	can_be_ruined = no
	can_be_disabled = no
	position_priority = 0
	icon = building_gaiaseeders_4

	category = government

	building_sets = {
		government
		urban
	}

	destroy_trigger = {
		OR = {
			NOT = {
				is_planet_class = pc_gaia
			}
			NOT = { exists = owner }
			owner = {
				is_idyllic_bloom_empire = no
			}
		}
	}

	resources = {
		category = planet_buildings
		cost = {
			energy = 1500
			exotic_gases = @b4_rare_cost
		}

		cost = {
			trigger = {
				exists = owner
				owner = {
					is_wilderness_empire = yes
				}
			}
			biomass = 800
		}

		upkeep = {
			energy = @b4_upkeep
			exotic_gases = @b3_rare_upkeep
			multiplier = value:gaiaseeder_cost_mult
		}
	}

	potential = {
		hidden_trigger = {
			exists = owner
			owner = {
				is_country_type = default
				is_idyllic_bloom_empire = yes
			}
			is_planet_class = pc_gaia
			NOR = {
				has_building = building_gaiaseeders_4
				has_building_construction = building_gaiaseeders_4
				has_building = building_gaiaseeders_pc_gaia
				has_building_construction = building_gaiaseeders_pc_gaia
			}
		}
	}

	allow = {
		has_upgraded_capital = yes
		exists = planet
		planet = {
			can_build_gaiaseeder = yes
		}
	}

	inline_script = {
		script = buildings/on_all_wilderness_buildings_districts
	}

	triggered_desc = {
		text = building_gaiaseeders_4_effect_desc
		trigger = {
			exists = planet
			planet = {
				NOT = {
					is_planet_class = pc_gaia
				}
			}
		}
	}

	triggered_desc = {
		text = gaia_seeder_bloomed_pops_effect
	}

	triggered_desc = {
		text = gaia_seeder_bloom_timer_tooltip
		trigger = {
			has_carrier_flag = gaia_seeder_bloom_timer
		}
	}
}

#############
# Infernals
#############

building_volcanic_forge_1 = {
	base_buildtime = @b1_time
	base_cap_amount = 1
	category = government
	building_sets = {
		government
		urban
	}
	potential = {
		exists = owner
		owner = { is_world_forger_empire = yes }
		NOR = {
			is_planet_class = pc_city
			is_planet_class = pc_machine
			is_planet_class = pc_hive
			is_artificial = yes
			AND = {
				is_terraforming = yes
				is_scripted_terraforming = no
			}
		}
	}
	allow = { num_uncleared_blockers = 0 }
	destroy_trigger = {
		OR = {
			is_planet_class = pc_city
			is_planet_class = pc_machine
			is_planet_class = pc_hive
			AND = {
				exists = owner
				owner = { is_world_forger_empire = no }
			}
		}
	}

	resources = {
		category = planet_buildings
		cost = { minerals = @b1_minerals }
		upkeep = { energy = @b2_upkeep }
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_polytechnic_mentor_add = @building_static_jobs
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_polytechnic_drone_add = @building_static_jobs
	}
	triggered_desc = {
		trigger = {
			exists = owner
			owner = { is_gestalt = no }
		}
		text = job_polytechnic_mentor_effect
	}
	triggered_desc = {
		trigger = {
			exists = owner
			owner = { is_gestalt = yes }
		}
		text = job_polytechnic_drone_effect
	}
	triggered_desc = {
		text = building_volcanic_forge_1_effect
	}
	auto_generate_description = no

	on_destroy = {
		carrier_event = { id = infernals.32 }
	}

	prerequisites = { "tech_volcanic_forge" }
	upgrades = { building_volcanic_forge_2 }
	ai_weight_coefficient = 1.25
}

building_volcanic_forge_2 = {
	base_buildtime = @b2_time
	base_cap_amount = 1
	can_build = no
	category = government
	building_sets = {
		government
		urban
	}

	potential = {
		exists = owner
		owner = { is_world_forger_empire = yes }
		NOR = {
			is_planet_class = pc_city
			AND = {
				is_terraforming = yes
				is_scripted_terraforming = no
			}
		}
	}
	allow = { has_upgraded_capital = yes }
	destroy_trigger = {
		OR = {
			is_planet_class = pc_city
			is_planet_class = pc_machine
			is_planet_class = pc_hive
			AND = {
				exists = owner
				owner = { is_world_forger_empire = no }
			}
		}
	}

	resources = {
		category = planet_buildings
		cost = {
			minerals = @b2_minerals
			exotic_gases = @b2_rare_cost
		}
		upkeep = {
			energy = @b3_upkeep
			exotic_gases = @b2_rare_upkeep
		}
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_polytechnic_mentor_add = @building_static_jobs_high
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_polytechnic_drone_add = @building_static_jobs_high
	}
	triggered_desc = {
		trigger = {
			exists = owner
			owner = { is_gestalt = no }
		}
		text = job_polytechnic_mentor_effect
	}
	triggered_desc = {
		trigger = {
			exists = owner
			owner = { is_gestalt = yes }
		}
		text = job_polytechnic_drone_effect
	}
	triggered_desc = {
		text = building_volcanic_forge_2_effect
	}
	auto_generate_description = no

	on_destroy = {
		carrier_event = { id = infernals.32 }
	}

	prerequisites = { "tech_volcanic_forge" }
	ai_weight_coefficient = 1.25
}
