#常规参数
@base_cost = 300
@city_cost = 500
@rural_district_ai_coefficient = 0.75

#生体荒野参数
#@base_cost = 30
#@city_cost = 50
@biomass_cost = 50

@wilderness_district_build_long = 480
@wilderness_district_build_short = 240

#普通星球/破碎之环：发电区划
district_generator = {
	expansion_planner = yes
	base_buildtime = 240
	overlay_icon = GFX_district_energy
	is_capped_by_modifier = no

	zone_slots = {
		slot_energy
	}

	show_on_uncolonized = {
		OR = {
			uses_district_set = standard
			uses_district_set = shattered_ring_world
		}
		exists = from
		from = { is_wilderness_empire = no }
		NOT = { has_modifier = resort_colony }
	}

	potential = {
		OR = {
			uses_district_set = standard
			uses_district_set = shattered_ring_world
		}
		OR = {
			NOT = { exists = owner }
			AND = {
				exists = owner
				owner = { is_wilderness_empire = no }
			}
		}
		NOT = { has_modifier = resort_colony }
	}

	conversion_ratio = 1
	convert_to = {
		district_photosynthesis_fields
		district_geothermal
		district_nexus_1
		district_hive_1
	}

	resources = {
		category = planet_districts_generator
		cost = {
			minerals = @base_cost
		}
		upkeep = {
			energy = 1
		}
	}

	inline_script = {
		script = jobs/technicians_add
		AMOUNT = @base_rural_district_jobs
	}

	planet_modifier = {
		planet_housing_add = 200
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				has_valid_civic = civic_agrarian_idyll
			}
		}
		modifier = {
			planet_housing_add = 300
		}
	}
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
		}
		modifier = {
			planet_housing_add = 100
		}
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_tankbound_empire = yes }
		}
		modifier = {
			job_technician_automated_workforce_mult = 1.0
			job_production_overseer_add = 100
		}
	}

	inline_script = {
		script = districts/district_triggered_name_generator
	}

	inline_script = {
		script = districts/district_triggered_flavor_desc_generator
	}

	prerequisites = {
		tech_power_plant_1
	}

	ai_weight_coefficient = @rural_district_ai_coefficient
}

#普通星球/破碎之环：采矿区划
district_mining = {
	expansion_planner = yes
	base_buildtime = 240
	overlay_icon = GFX_district_minerals
	is_capped_by_modifier = no

	zone_slots = {
		slot_minerals
	}

	desc = {
		trigger = {
			NOT = { uses_district_set = shattered_ring_world }
		}
		text = district_mining_desc
	}

	desc = {
		trigger = {
			uses_district_set = shattered_ring_world
		}
		text = district_srw_mining_desc
	}

	show_on_uncolonized = {
		OR = {
			uses_district_set = standard
			uses_district_set = shattered_ring_world
		}
		exists = from
		from = { is_wilderness_empire = no }
		NOT = { has_modifier = resort_colony }
	}

	potential = {
		OR = {
			uses_district_set = standard
			uses_district_set = shattered_ring_world
		}
		OR = {
			NOT = { exists = owner }
			AND = {
				exists = owner
				owner = { is_wilderness_empire = no }
			}
		}
		NOT = { has_modifier = resort_colony }
	}

	conversion_ratio = 1
	convert_to = {
		district_hollow_mountains
		district_nexus_2
		district_hive_2
		district_melting
	}

	resources = {
		category = planet_districts_mining
		cost = {
			minerals = @base_cost
		}
		upkeep = {
			energy = 1
		}
	}

	inline_script = {
		script = jobs/miners_add
		AMOUNT = @base_rural_district_jobs
	}

	planet_modifier = {
		planet_housing_add = 200
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				has_valid_civic = civic_agrarian_idyll
			}
		}
		modifier = {
			planet_housing_add = 300
		}
	}
	triggered_planet_modifier = {
		potential = {
			has_modifier = metal_planet
		}
		modifier = {
			planet_housing_add = 500
		}
	}
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
		}
		modifier = {
			planet_housing_add = 100
		}
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_tankbound_empire = yes }
		}
		modifier = {
			job_miner_automated_workforce_mult = 1.0
			job_production_overseer_add = 100
		}
	}

	inline_script = {
		script = districts/district_triggered_name_mining
	}

	inline_script = {
		script = districts/district_triggered_flavor_desc_mining
	}

	prerequisites = {
		tech_mechanized_mining
	}

	ai_weight_coefficient = @rural_district_ai_coefficient
}

#普通星球/破碎之环：农业区划
district_farming = {
	expansion_planner = yes
	base_buildtime = 240
	overlay_icon = GFX_district_food
	is_capped_by_modifier = no

	zone_slots = {
		slot_food
	}

	show_on_uncolonized = {
		OR = {
			uses_district_set = standard
			uses_district_set = shattered_ring_world
		}
		exists = from
		from = { is_wilderness_empire = no }
		NOT = { has_modifier = resort_colony }
	}

	potential = {
		OR = {
			uses_district_set = standard
			uses_district_set = shattered_ring_world
		}
		NOT = {
			AND = {
				exists = owner
				owner = {
					is_ai = yes
					country_uses_food = no
				}
			}
		}
		OR = {
			NOT = { exists = owner }
			AND = {
				exists = owner
				owner = { is_wilderness_empire = no }
			}
		}
		NOT = { has_modifier = resort_colony }
	}

	conversion_ratio = 1
	convert_to = {
		district_orchard_forests
		district_nexus_3
		district_hive_3
	}

	resources = {
		category = planet_districts_farming
		cost = {
			minerals = @base_cost
			trigger = {
				NOT = { has_modifier = wooden_planet }
			}
		}
		cost = {
			food = @base_cost
			trigger = {
				has_modifier = wooden_planet
			}
		}
		# Anglers Civic cost effect
		cost = {
			trigger = {
				AND = {
					exists = owner
					owner = { is_anglers_empire = yes }
					planet = { has_climate = wet }
				}
			}
			minerals = -50
		}
		upkeep = {
			energy = 1
		}
	}

	inline_script = {
		script = jobs/farmers_add
		AMOUNT = @base_rural_district_jobs
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_wilderness_empire = no }
		}
		modifier = {
			planet_housing_add = 200
		}
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				has_valid_civic = civic_agrarian_idyll
			}
		}
		modifier = {
			planet_housing_add = 400
		}
	}
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				has_technology = tech_housing_agrarian_idyll
				has_valid_civic = civic_agrarian_idyll
			}
		}
		modifier = {
			planet_housing_add = 200
		}
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
		}
		modifier = {
			planet_housing_add = 100
		}
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_tankbound_empire = yes }
		}
		modifier = {
			job_farmer_automated_workforce_mult = 1.0
			job_production_overseer_add = 100
		}
	}

	inline_script = {
		script = districts/district_triggered_name_farming
	}

	inline_script = {
		script = districts/district_triggered_flavor_desc_farming
	}

	prerequisites = {
		tech_industrial_farming
	}

	destroy_trigger = {
		exists = owner
		AND = {
			owner = { is_ai = yes }
			owner = { country_uses_food = no }
		}
	}

	ai_weight_coefficient = @rural_district_ai_coefficient
}

#火山星球：热工论坛（农业区划）
district_polytechnic = {
	expansion_planner = no
	base_buildtime = 250
	overlay_icon = GFX_district_research
	is_capped_by_modifier = no

	prerequisites = {
		tech_basic_science_lab_1
	}

	allow = {
		hidden_trigger = {
			OR = {
				NOT = { exists = owner }
				owner = {
					has_technology = tech_basic_science_lab_1
				}
			}
		}
	}

	zone_slots = {
		slot_polytechnic
	}

	show_on_uncolonized = { uses_district_set = volcanic_world }
	potential = { uses_district_set = volcanic_world }

	resources = {
		category = planet_districts
		cost = { minerals = 450 }
		upkeep = { energy = 3 }
	}

	planet_modifier = { planet_housing_add = 200 }

	inline_script = {
		script = jobs/thermotechnic_add
	}

	triggered_name = {
		trigger = {
			exists = owner
			owner = { is_regular_empire = yes }
		}
		text = thermotechnic_default
	}
	triggered_name = {
		trigger = {
			exists = owner
			owner = { is_hive_empire = yes }
		}
		text = thermotechnic_hive
	}
	triggered_name = {
		trigger = {
			exists = owner
			owner = { is_machine_empire = yes }
		}
		text = thermotechnic_machine
	}
}

#生体荒野：光合原野（电区划）
district_photosynthesis_fields = {
	expansion_planner = yes
	base_buildtime = @wilderness_district_build_short
	overlay_icon = GFX_district_energy
	inherits_capped_modifiers_from = district_generator
	is_capped_by_modifier = no

	zone_slots = {
		slot_energy
	}

	show_on_uncolonized = {
		uses_district_set = standard
		exists = from
		from = {
			is_wilderness_empire = yes
		}
	}

	potential = {
		uses_district_set = standard
		exists = owner
		owner = {
			is_wilderness_empire = yes
		}
	}

	conversion_ratio = 1
	convert_to = {
		district_generator
		district_photosynthesis_fields_uncapped
		district_nexus_1
		district_hive_1
	}
	expansion_planner_type = district_generator

	resources = {
		category = planet_districts_generator
		cost = {
			minerals = 300
		}
		cost = {
			biomass = @biomass_cost
		}
		upkeep = {
			energy = 1
		}
	}
	planet_modifier = {
		job_technician_drone_add = @base_rural_district_jobs
		planet_housing_add = 100
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				has_tradition = tr_prosperity_public_works
			}
		}
		planet_housing_add = 50
	}

	inline_script = {
		script = buildings/on_all_wilderness_buildings_districts
	}

	prerequisites = {
		tech_power_plant_1
	}

	ai_resource_production = {
		energy = 5
		trigger = {
			OR = {
				has_building = building_bioelectric_stimulator_1
				has_building = building_bioelectric_stimulator_2
				has_building = building_bioelectric_stimulator_3
				has_building = building_bioelectric_stimulator_4
			}
		}
	}

	ai_estimate_without_unemployment = yes
	additional_ai_weight = 10
}

#生体荒野：中空山岭（矿区划）
district_hollow_mountains = {
	expansion_planner = yes
	base_buildtime = @wilderness_district_build_short
	overlay_icon = GFX_district_minerals
	inherits_capped_modifiers_from = district_mining
	is_capped_by_modifier = no

	zone_slots = {
		slot_minerals
	}

	show_on_uncolonized = {
		uses_district_set = standard
		exists = from
		from = {
			is_wilderness_empire = yes
		}
	}

	potential = {
		uses_district_set = standard
		exists = owner
		owner = {
			is_wilderness_empire = yes
		}
	}

	conversion_ratio = 1
	convert_to = {
		district_mining
		district_hollow_mountains_uncapped
		district_nexus_2
		district_hive_2
	}
	expansion_planner_type = district_mining

	resources = {
		category = planet_districts_mining
		cost = {
			minerals = 300
		}
		cost = {
			biomass = @biomass_cost
		}
		upkeep = {
			food = 1
		}
	}

	planet_modifier = {
		job_mining_drone_add = @base_rural_district_jobs
		planet_housing_add = 100
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				has_tradition = tr_prosperity_public_works
			}
		}
		planet_housing_add = 50
	}

	prerequisites = {
		tech_mechanized_mining
	}

	ai_resource_production = {
		minerals = 5
		trigger = {
			OR = {
				has_building = building_churning_tunnels_1
				has_building = building_churning_tunnels_2
				has_building = building_churning_tunnels_3
				has_building = building_churning_tunnels_4
			}
		}
	}

	ai_estimate_without_unemployment = yes
	additional_ai_weight = 10
}

#生体荒野：硕果森林（农业区划）
district_orchard_forests = {
	expansion_planner = yes
	base_buildtime = @wilderness_district_build_short
	overlay_icon = GFX_district_food
	inherits_capped_modifiers_from = district_farming
	is_capped_by_modifier = no

	zone_slots = {
		slot_food
	}

	show_on_uncolonized = {
		uses_district_set = standard
		exists = from
		from = {
			is_wilderness_empire = yes
		}
	}

	potential = {
		uses_district_set = standard
		exists = owner
		owner = {
			is_wilderness_empire = yes
		}
	}

	allow = {
		NOT = { has_modifier = resort_colony }
	}

	conversion_ratio = 1
	convert_to = {
		district_farming
		district_nexus_3
		district_hive_3
	}
	expansion_planner_type = district_farming

	resources = {
		category = planet_districts_farming
		cost = {
			minerals = 300
		}
		cost = {
			biomass = @biomass_cost
		}
		upkeep = {
			energy = 1
		}
	}

	planet_modifier = {
		job_agri_drone_add = @base_rural_district_jobs
		planet_housing_add = 100
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				has_tradition = tr_prosperity_public_works
			}
		}
		planet_housing_add = 50
	}

	inline_script = {
		script = buildings/on_all_wilderness_buildings_districts
	}

	prerequisites = {
		tech_industrial_farming
	}

	ai_resource_production = {
		food = 5
		trigger = {
			OR = {
				has_building = building_massive_growth_1
				has_building = building_massive_growth_2
				has_building = building_massive_growth_3
				has_building = building_massive_growth_4
			}
		}
	}

	ai_estimate_without_unemployment = yes
	additional_ai_weight = 10
}