#root = planet

@stickiness = 10
@stickiness_low = 5
@zone_urban = 25
@zone_rural = 10
@rural_max_size = 15
@rural_over_max_size = -20

# Manufactorum
col_manufactorum_mix = {
	icon = GFX_colony_type_industrial

	potential = {
		uses_district_set = manufactorum
		is_capital = no
	}

	planet_modifier = {
		planet_structures_upkeep_mult = -0.10
		planet_artisans_upkeep_mult = -0.10
		planet_metallurgists_upkeep_mult = -0.10
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_manufactorum_mix
		}
		
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_na_arcology_industrial
			}
			mode = add
			mult = 6
		}
		modifier = {
			OR = {
				num_zones = {
					type = zone_industrial
					value > 0
				}
				AND = {
					num_zones = {
						type = zone_foundry
						value > 0
					}
					num_zones = {
						type = zone_factory
						value > 0
					}
				}
			}
			add = @zone_urban
		}
	}
}

# Manufactorum Foundry
col_manufactorum_foundry = {
	icon = GFX_colony_type_foundry

	# used by AI to estimate what will happen when we change the designation
	ai_resource_conversion = {
		consumer_goods = 0
		alloys = 2

		trigger = {
			always = yes
		}
	}

	ai_resource_current_conversion = {
		alloys = 0.5
		consumer_goods = -2

		trigger = {
			always = yes
		}
	}

	potential = {
		uses_district_set = manufactorum
		is_capital = no
	}

	planet_modifier = {
		planet_building_foundry_1_build_speed_mult = 0.25
		planet_district_na_arcology_arms_industry_build_speed_mult = 0.25
		planet_metallurgists_upkeep_mult = -0.2
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				is_galactic_community_member = yes
			}
			OR = {
				is_active_resolution = "resolution_industry_environmental_ordinance_waivers"
				is_active_resolution = "resolution_industry_project_cornucopia"
			}
		}
		modifier = {
			planet_metallurgists_produces_mult = 0.05
		}
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_manufactorum_foundry
		}
		
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_na_arcology_arms_industry
			}
			mode = add
			mult = 6
		}
		modifier = {
			num_zones = {
				type = zone_foundry
				value > 0
			}
			num_zones = {
				type = zone_factory
				value = 0
			}
			add = @zone_urban
		}
	}
}

# Manufactorum Factory
col_manufactorum_factory = {
	icon = GFX_colony_type_factory

	# used by AI to estimate what will happen when we change the designation
	ai_resource_conversion = {
		consumer_goods = 2
		alloys = 0

		trigger = {
			owner = {
				is_gestalt = no
			}
		}
	}

	# Used by AI to estimate the current effects of this designation
	ai_resource_current_conversion = {
		consumer_goods = 0.5
		alloys = -0.5

		trigger = {
			owner = {
				is_gestalt = no
			}
		}
	}

	potential = {
		uses_district_set = manufactorum
		is_capital = no
	}

	planet_modifier = {
		planet_building_factory_1_build_speed_mult = 0.25
		planet_district_na_arcology_civilian_industry_build_speed_mult = 0.25
		planet_artisans_upkeep_mult = -0.2
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				is_galactic_community_member = yes
			}
			OR = {
				is_active_resolution = "resolution_industry_environmental_ordinance_waivers"
				is_active_resolution = "resolution_industry_project_cornucopia"
			}
		}
		modifier = {
			planet_artisans_produces_mult = 0.05
		}
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_manufactorum_factory
		}
		
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_na_arcology_industrial
			}
			mode = add
			mult = 6
		}
		modifier = {
			num_zones = {
				type = zone_foundry
				value = 0
			}
			num_zones = {
				type = zone_factory
				value > 0
			}
			add = @zone_urban
		}
	}
}

# Manufactorum Assembly
col_manufactorum_assembly = {
	icon = GFX_colony_type_assembly

	potential = {
		uses_district_set = manufactorum
		is_capital = no
	}

	planet_modifier = {
		planet_structures_upkeep_mult = -0.15
		planet_pop_assembly_mult = 0.15
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_manufactorum_assembly
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_arcology_assembly
			}
			mode = add
			mult = 6
		}
	}
}

# Manufactorum Refinery
col_manufactorum_refinery = {
	icon = GFX_colony_type_refinery

	potential = {
		uses_district_set = manufactorum
		is_capital = no
	}

	planet_modifier = {
		planet_refiners_produces_mult = 0.15
		planet_translucers_produces_mult = 0.15
		planet_chemists_produces_mult = 0.15
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				is_galactic_community_member = yes
			}
			OR = {
				is_active_resolution = "resolution_industry_environmental_ordinance_waivers"
				is_active_resolution = "resolution_industry_project_cornucopia"
			}
		}
		modifier = {
			planet_refiners_produces_mult = 0.1
			planet_translucers_produces_mult = 0.1
			planet_chemists_produces_mult = 0.1
		}
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_manufactorum_refinery
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_arcology_refinery
			}
			mode = add
			mult = 8
		}
	}
}

# Agropolis Production
col_agropolis_production = {
	icon = GFX_colony_type_rural

	potential = {
		uses_district_set = agropolis
		is_capital = no
	}

	planet_modifier = {
		planet_structures_upkeep_mult = -0.15
		planet_farmers_food_produces_mult = 0.15
		planet_artisans_upkeep_mult = -0.2
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				is_galactic_community_member = yes
				is_gestalt = no
			}
			OR = {
				is_active_resolution = "resolution_greatergood_five_year_plans"
				is_active_resolution = "resolution_greatergood_greater_than_ourselves"
				is_active_resolution = "resolution_greatergood_balance_in_the_middle"
				is_active_resolution = "resolution_greatergood_universal_prosperity_mandate"
			}
		}
		modifier = {
			planet_jobs_worker_produces_mult = 0.1
		}
	}
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				is_galactic_community_member = yes
				is_gestalt = yes
			}
			OR = {
				is_active_resolution = "resolution_greatergood_five_year_plans"
				is_active_resolution = "resolution_greatergood_greater_than_ourselves"
				is_active_resolution = "resolution_greatergood_balance_in_the_middle"
				is_active_resolution = "resolution_greatergood_universal_prosperity_mandate"
			}
		}
		modifier = {
			planet_jobs_simple_drone_produces_mult = 0.1
		}
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_agropolis_production
		}
		
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_na_arcology_civilian_industry
			}
			mode = add
			mult = 6
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_arcology_farming
			}
			mode = add
			mult = 6
		}
	}
}

# Agropolis Farming
col_agropolis_farming = {
	icon = GFX_colony_type_farming

	potential = {
		uses_district_set = agropolis
		is_capital = no
	}

	planet_modifier = {
		planet_district_arcology_farming_build_speed_mult = 0.25
		planet_farmers_produces_mult = 0.25
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				is_galactic_community_member = yes
				is_gestalt = no
			}
			OR = {
				is_active_resolution = "resolution_greatergood_five_year_plans"
				is_active_resolution = "resolution_greatergood_greater_than_ourselves"
				is_active_resolution = "resolution_greatergood_balance_in_the_middle"
				is_active_resolution = "resolution_greatergood_universal_prosperity_mandate"
			}
		}
		modifier = {
			planet_jobs_worker_produces_mult = 0.1
		}
	}
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				is_galactic_community_member = yes
				is_gestalt = yes
			}
			OR = {
				is_active_resolution = "resolution_greatergood_five_year_plans"
				is_active_resolution = "resolution_greatergood_greater_than_ourselves"
				is_active_resolution = "resolution_greatergood_balance_in_the_middle"
				is_active_resolution = "resolution_greatergood_universal_prosperity_mandate"
			}
		}
		modifier = {
			planet_jobs_simple_drone_produces_mult = 0.1
		}
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_agropolis_farming
		}
		
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_arcology_farming
			}
			mode = add
			mult = 8
		}
	}
}

# Fortoria
col_fortoria_mix = {
	icon = GFX_colony_type_urban

	potential = {
		uses_district_set = fortoria
		is_capital = no
	}

	planet_modifier = {
		planet_structures_upkeep_mult = -0.10
		planet_army_build_speed_mult = 0.25
		armies_cost_mult = -0.25
		army_defense_damage_mult = 0.15
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_fortoria_mix
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_na_arcology_housing
			}
			mode = add
			mult = 6
		}
		complex_trigger_modifier = {
			trigger = num_assigned_jobs
			parameters = {
				job = merchant
			}
			mode = add
			mult = 2
		}
		complex_trigger_modifier = {
			trigger = num_assigned_jobs
			parameters = {
				job = trader
			}
			mode = add
		}
		complex_trigger_modifier = {
			trigger = num_assigned_jobs
			parameters = {
				job = numistic_priest
			}
			mode = add
		}
	}
}

# Fortoria Industrial
col_fortoria_industrial = {
	icon = GFX_colony_type_industrial

	potential = {
		uses_district_set = fortoria
		is_capital = no
	}

	planet_modifier = {
		planet_structures_upkeep_mult = -0.10
		planet_artisans_upkeep_mult = -0.10
		planet_metallurgists_upkeep_mult = -0.10
		planet_army_build_speed_mult = 0.15
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_fortoria_industrial
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_na_arcology_civilian_industry
			}
			mode = add
			mult = 6
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_na_arcology_arms_industry
			}
			mode = add
			mult = 6
		}
		modifier = {
			OR = {
				num_zones = {
					type = zone_industrial
					value > 0
				}
				AND = {
					num_zones = {
						type = zone_foundry
						value > 0
					}
					num_zones = {
						type = zone_factory
						value > 0
					}
				}
			}
			add = @zone_urban
		}
	}
}

# Fortoria Foundry
col_fortoria_foundry = {
	icon = GFX_colony_type_foundry

	# used by AI to estimate what will happen when we change the designation
	ai_resource_conversion = {
		consumer_goods = 0
		alloys = 2

		trigger = {
			always = yes
		}
	}

	ai_resource_current_conversion = {
		alloys = 0.5
		consumer_goods = -2

		trigger = {
			always = yes
		}
	}

	potential = {
		uses_district_set = fortoria
		is_capital = no
	}

	planet_modifier = {
		planet_building_foundry_1_build_speed_mult = 0.25
		planet_district_na_arcology_arms_industry_build_speed_mult = 0.25
		planet_metallurgists_upkeep_mult = -0.2
		planet_army_build_speed_mult = 0.15
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				is_galactic_community_member = yes
			}
			OR = {
				is_active_resolution = "resolution_industry_environmental_ordinance_waivers"
				is_active_resolution = "resolution_industry_project_cornucopia"
			}
		}
		modifier = {
			planet_metallurgists_produces_mult = 0.05
		}
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_fortoria_foundry
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_na_arcology_arms_industry
			}
			mode = add
			mult = 8
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_na_arcology_civilian_industry
			}
			mode = add
			mult = -3
		}
		modifier = {
			num_zones = {
				type = zone_foundry
				value > 0
			}
			num_zones = {
				type = zone_factory
				value = 0
			}
			add = @zone_urban
		}
	}
}

# Fortoria Factory
col_fortoria_factory = {
	icon = GFX_colony_type_factory

	# used by AI to estimate what will happen when we change the designation
	ai_resource_conversion = {
		consumer_goods = 2
		alloys = 0

		trigger = {
			owner = {
				is_gestalt = no
			}
		}
	}

	# Used by AI to estimate the current effects of this designation
	ai_resource_current_conversion = {
		consumer_goods = 0.5
		alloys = -0.5

		trigger = {
			owner = {
				is_gestalt = no
			}
		}
	}

	potential = {
		uses_district_set = fortoria
		is_capital = no
	}

	planet_modifier = {
		planet_building_factory_1_build_speed_mult = 0.25
		planet_district_na_arcology_civilian_industry_build_speed_mult = 0.25
		planet_artisans_upkeep_mult = -0.2
		planet_army_build_speed_mult = 0.15
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				is_galactic_community_member = yes
			}
			OR = {
				is_active_resolution = "resolution_industry_environmental_ordinance_waivers"
				is_active_resolution = "resolution_industry_project_cornucopia"
			}
		}
		modifier = {
			planet_artisans_produces_mult = 0.05
		}
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_fortoria_factory
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_na_arcology_civilian_industry
			}
			mode = add
			mult = 8
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_na_arcology_arms_industry
			}
			mode = add
			mult = -3
		}
		modifier = {
			num_zones = {
				type = zone_foundry
				value = 0
			}
			num_zones = {
				type = zone_factory
				value > 0
			}
			add = @zone_urban
		}
	}
}

# Fortoria Research
col_fortoria_research = {
	icon = GFX_colony_type_research

	potential = {
		uses_district_set = fortoria
		is_capital = no
	}

	planet_modifier = {
		planet_building_research_lab_1_build_speed_mult = 0.25
		planet_researchers_upkeep_mult = -0.2
		planet_army_build_speed_mult = 0.15
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_ecu_research
		}
		modifier = {
			OR = {
				num_zones = {
					type = zone_research
					value > 0
				}
				num_zones = {
					type = zone_research_engineering
					value > 0
				}
				num_zones = {
					type = zone_research_physics
					value > 0
				}
				num_zones = {
					type = zone_research_society
					value > 0
				}
				num_zones = {
					type = zone_research_unity
					value > 0
				}
			}

			add = @zone_urban
		}
		inline_script = {
			script = colony_types/shared_weights_research
		}
	}
}

# Fortoria Citadel
col_fortoria_fortress = {
	icon = GFX_colony_type_fortress

	potential = {
		uses_district_set = fortoria
		is_capital = no
	}

	planet_modifier = {
		planet_army_build_speed_mult = 0.25
		armies_cost_mult = -0.15
		army_defense_damage_mult = 0.25
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_fortoria_fortress
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_na_arcology_fortress
			}
			mode = add
			mult = 6
		}
		complex_trigger_modifier = {
			trigger = num_buildings
			parameters = {
				type = building_stronghold
			}
			mode = add
			mult = 2
		}
		complex_trigger_modifier = {
			trigger = num_buildings
			parameters = {
				type = building_fortress
			}
			mode = add
			mult = 4
		}
	}
}

# Fortoria Observant
col_fortoria_intelligence = {
	icon = GFX_colony_type_intelligence

	potential = {
		uses_district_set = fortoria
		is_capital = no
	}

	planet_modifier = {
		planet_district_arcology_intelligence_build_speed_mult = 0.25
		planet_army_build_speed_mult = 0.15
		planet_stability_add = 5
		pop_government_ethic_attraction = 1
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_fortoria_intelligence
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_arcology_intelligence
			}
			mode = add
			mult = 6
		}
	}
}

# Machinarium Foundry
col_machinarium_foundry = {
	icon = GFX_colony_type_foundry

	# used by AI to estimate what will happen when we change the designation
	ai_resource_conversion = {
		consumer_goods = 0
		alloys = 2

		trigger = {
			always = yes
		}
	}

	ai_resource_current_conversion = {
		alloys = 0.5
		consumer_goods = -2

		trigger = {
			always = yes
		}
	}

	potential = {
		uses_district_set = machinarium
		is_capital = no
	}

	planet_modifier = {
		planet_building_foundry_1_build_speed_mult = 0.25
		planet_metallurgists_upkeep_mult = -0.2
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				is_galactic_community_member = yes
			}
			OR = {
				is_active_resolution = "resolution_industry_environmental_ordinance_waivers"
				is_active_resolution = "resolution_industry_project_cornucopia"
			}
		}
		modifier = {
			planet_metallurgists_produces_mult = 0.05
		}
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_machinarium_foundry
		}
		
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_machine_arms_industry
			}
			mode = add
			mult = 6
		}
		modifier = {
			num_zones = {
				type = zone_foundry
				value > 0
			}
			num_zones = {
				type = zone_factory
				value = 0
			}
			add = @zone_urban
		}
	}
}

# Machinarium Assembly
col_machinarium_assembly = {
	icon = GFX_colony_type_assembly

	potential = {
		uses_district_set = machinarium
		is_capital = no
	}

	planet_modifier = {
		planet_structures_upkeep_mult = -0.15
		planet_pop_assembly_mult = 0.15
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_machinarium_assembly
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_machine_assembly
			}
			mode = add
			mult = 6
		}
	}
}

# Machinarium Citadel
col_machinarium_fortress = {
	icon = GFX_colony_type_fortress

	potential = {
		uses_district_set = machinarium
		is_capital = no
	}

	planet_modifier = {
		planet_army_build_speed_mult = 0.25
		armies_cost_mult = -0.15
		army_defense_damage_mult = 0.25
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_machinarium_fortress
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_machine_fortress
			}
			mode = add
			mult = 6
		}
		complex_trigger_modifier = {
			trigger = num_buildings
			parameters = {
				type = building_stronghold
			}
			mode = add
			mult = 2
		}
		complex_trigger_modifier = {
			trigger = num_buildings
			parameters = {
				type = building_fortress
			}
			mode = add
			mult = 4
		}
	}
}

# Genoworld Trade
col_genoworld_trade = {
	icon = GFX_colony_type_trade

	potential = {
		uses_district_set = genoworld
		is_capital = no
		exists = space_owner
		space_owner = { is_wilderness_empire = no }
	}

	planet_modifier = {
		planet_jobs_trade_produces_mult = 0.2
		logistic_growth_mult = 0.1
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_genoworld_trade
		}
		modifier = {
			num_zones = {
				type = zone_trade
				value > 0
			}
			add = @zone_urban
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_genotrade
			}
			mode = add
			mult = 10
		}
	}
}

# Manufactorum Refinery
col_genoworld_refinery = {
	icon = GFX_colony_type_refinery

	potential = {
		uses_district_set = genoworld
		is_capital = no
		exists = space_owner
		space_owner = { is_wilderness_empire = no }
	}

	planet_modifier = {
		planet_refiners_produces_mult = 0.15
		planet_translucers_produces_mult = 0.15
		planet_chemists_produces_mult = 0.15
	}

	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = {
				is_galactic_community_member = yes
			}
			OR = {
				is_active_resolution = "resolution_industry_environmental_ordinance_waivers"
				is_active_resolution = "resolution_industry_project_cornucopia"
			}
		}
		modifier = {
			planet_refiners_produces_mult = 0.1
			planet_translucers_produces_mult = 0.1
			planet_chemists_produces_mult = 0.1
		}
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_genoworld_refinery
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_genorefinery
			}
			mode = add
			mult = 8
		}
	}
}

# Genofarm
col_genoworld_genofarm = {
	icon = GFX_colony_type_genoworld

	potential = {
		uses_district_set = genoworld
		is_capital = no
		exists = space_owner
		space_owner = { is_wilderness_empire = no }
	}

	planet_modifier = {
		planet_jobs_simple_drone_produces_mult = 0.05
		planet_farmers_food_produces_mult = 0.25
	}

	weight_modifier = {
		modifier = {
			add = @stickiness
			has_designation = col_genoworld_genofarm
		}
		complex_trigger_modifier = {
			trigger = num_districts
			parameters = {
				type = district_genofarms
			}
			mode = add
			mult = 6
		}
	}
}