# If you add a new colony building, also add it to common/inline_scripts/arkship/ai_design.txt
# and update the weights for all arkship starbase types in common/starbase_types/06_arkship_starbase_types.txt

arkship_energy_hub = {
	icon = "GFX_orbitalring_energy_hub"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_power_hub_2
		}
	}

	show_in_tech = "tech_power_hub_2"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_100
			exotic_gases = @arkship_cost_strategic_100
		}
		upkeep = {
			energy = @arkship_upkeep_energy_2
			exotic_gases = @arkship_upkeep_strategic_1
		}
	}

	planet_modifier = {
		planet_technician_energy_produces_add = 0.5
	}

	ai_weight = {
		weight = 100
	}
}

arkship_food_hub = {
	icon = "GFX_orbitalring_food_hub"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_food_processing_2
		}
	}

	show_in_tech = "tech_food_processing_2"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_100
			volatile_motes = @arkship_cost_strategic_100
		}
		upkeep = {
			energy = @arkship_upkeep_energy_2
			volatile_motes = @arkship_upkeep_strategic_1
		}
	}

	planet_modifier = {
		planet_farmers_food_produces_add = 0.5
	}

	ai_weight = {
		weight = 100
	}
}

arkship_trade_hub = {
	icon = "GFX_orbitalring_trade_hub"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_interstellar_economics
		}
	}

	show_in_tech = "tech_interstellar_economics"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_100
			rare_crystals = @arkship_cost_strategic_100
		}
		upkeep = {
			energy = @arkship_upkeep_energy_2
			rare_crystals = @arkship_upkeep_strategic_1
		}
	}

	planet_modifier = {
		planet_jobs_trade_produces_mult = 0.05
	}

	triggered_planet_modifier = {
		custom_tooltip = "sm_ring_trade_hub_effect"
	}

	ai_weight = {
		weight = 100
	}
}

arkship_bureaucracy_hub = {
	icon = "GFX_orbitalring_bureaucracy_hub"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_effective_bureaucracy
			is_gestalt = no
		}
	}

	show_in_tech = "tech_effective_bureaucracy"

	show_tech_unlock_if = {
		is_nomadic = yes
		is_gestalt = no
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_200
			rare_crystals = @arkship_cost_strategic_300
		}
		upkeep = {
			energy = @arkship_upkeep_energy_2
			rare_crystals = @arkship_upkeep_strategic_1
		}
	}

	planet_modifier = {
		planet_bureaucrats_unity_produces_add = 0.5
	}

	ai_weight = {
		weight = 100
	}
}

arkship_synapse_hub = {
	icon = "GFX_orbitalring_synapse_hub"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_hive_cluster
			is_hive_empire = yes
			is_wilderness_empire = no # failsafe: implied by denial of 'Hive Cluster' tech
		}
	}

	show_in_tech = "tech_hive_cluster"

	show_tech_unlock_if = {
		is_nomadic = yes
		is_hive_empire = yes
		is_wilderness_empire = no # failsafe: implied by denial of 'Hive Cluster' tech
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_200
			exotic_gases = @arkship_cost_strategic_300
		}
		upkeep = {
			energy = @arkship_upkeep_energy_2
			exotic_gases = @arkship_upkeep_strategic_1
		}
	}

	planet_modifier = {
		planet_bureaucrats_unity_produces_add = 0.5
	}

	ai_weight = {
		weight = 100
	}
}

arkship_maintenance_hub = {
	icon = "GFX_orbitalring_maintenance_hub"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_resource_processing_algorithms
			is_machine_empire = yes
		}
	}

	show_in_tech = "tech_resource_processing_algorithms"

	show_tech_unlock_if = {
		is_nomadic = yes
		is_machine_empire = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_200
			exotic_gases = @arkship_cost_strategic_300
		}
		upkeep = {
			energy = @arkship_upkeep_energy_2
			exotic_gases = @arkship_upkeep_strategic_1
		}
	}

	planet_modifier = {
		custom_tooltip = "sm_ring_maintenance_hub_effect"
	}

	ai_weight = {
		weight = 100
	}
}

arkship_consumer_goods_hub = {
	icon = "GFX_orbitalring_consumer_hub"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_luxuries_2
			country_uses_consumer_goods = yes
		}
	}

	show_in_tech = "tech_luxuries_2"

	show_tech_unlock_if = {
		is_nomadic = yes
		country_uses_consumer_goods = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_200
			rare_crystals = @arkship_cost_strategic_300
		}
		upkeep = {
			energy = @arkship_upkeep_energy_5
			rare_crystals = @arkship_upkeep_strategic_2
		}
	}

	triggered_planet_modifier = {
		potential = {
			industrial_jobs_are_catalytic_trigger = no
		}
		planet_artisans_consumer_goods_produces_add = 0.5
		planet_artisans_minerals_upkeep_add = 1
	}

	triggered_planet_modifier = {
		potential = {
			industrial_jobs_are_catalytic_trigger = yes
		}
		planet_artisans_consumer_goods_produces_add = 0.5
		planet_artisans_food_upkeep_add = 1
	}

	ai_weight = {
		weight = 100
	}
}

arkship_alloys_hub = {
	icon = "GFX_orbitalring_alloy_hub"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_alloys_2
		}
	}

	show_in_tech = "tech_alloys_2"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_200
			volatile_motes = @arkship_cost_strategic_300
		}
		upkeep = {
			energy = @arkship_upkeep_energy_5
			volatile_motes = @arkship_upkeep_strategic_2
		}
	}

	triggered_planet_modifier = {
		potential = {
			industrial_jobs_are_catalytic_trigger = no
		}
		planet_metallurgists_alloys_produces_add = 0.5
		planet_metallurgists_minerals_upkeep_add = 2
	}

	triggered_planet_modifier = {
		potential = {
			industrial_jobs_are_catalytic_trigger = yes
		}
		planet_metallurgists_alloys_produces_add = 0.5
		planet_metallurgists_food_upkeep_add = 2
	}

	ai_weight = {
		weight = 100
	}
}

arkship_psi_corps = {
	icon = "GFX_orbitalring_psi_corps"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			NOT = {
				has_origin = origin_endbringers
			}
			has_psi_corps_tradition = yes
		}
		colony? = {
			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
				}
			}
		}
	}

	possible = {
		colony? = {
			NOR = {
				has_building_construction = building_psi_corps
				has_building = building_psi_corps
			}
		}
	}

	abort_trigger = {
		owner? = {
			has_psi_corps_tradition = no
		}
	}

	destroy_trigger = {
		owner? = {
			has_psi_corps_tradition = no
		}
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_200
			rare_crystals = @arkship_cost_strategic_300
		}
		upkeep = {
			energy = @arkship_upkeep_energy_5
			rare_crystals = @arkship_upkeep_strategic_2
		}
	}

	planet_modifier = {
		planet_stability_add = 2
	}

	inline_script = {
		script = jobs/telepaths_add
		AMOUNT = @building_static_jobs
	}

	triggered_planet_modifier = {
		potential = {
			colony? = {
				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 = colony.value:psionic_workforce_from_telepaths
	}

	ai_weight = {
		weight = 125 #psionic components are weighted higher as the AI needs to be psionic to unlock them
	}
}

arkship_shield_generator = {
	icon = "GFX_orbitalring_shield_generator"
	starbase_type = arkship
	construction_days = 360
	category = sm_defense_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_planetary_shield_generator
		}
	}

	possible = {
		colony? = {
			NOR = {
				has_building_construction = building_planetary_shield_generator
				has_building = building_planetary_shield_generator
			}
		}
	}

	show_in_tech = "tech_planetary_shield_generator"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_200
			rare_crystals = @arkship_cost_strategic_300
		}
		upkeep = {
			energy = @arkship_upkeep_energy_5
			rare_crystals = @arkship_upkeep_strategic_2
		}
	}

	station_modifier = {
		ship_shield_mult = 0.25
		ship_shield_hardening_add = 0.25
	}

	ai_weight = {
		weight = 100
	}
}

arkship_galactic_stock_exchange = {
	icon = "GFX_orbitalring_galactic_stock_exchange"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_galactic_markets
		}
		colony? = {
			NOR = {
				has_modifier = resort_colony
				has_modifier = slave_colony
			}
		}
	}

	possible = {
		colony? = {
			NOR = {
				has_building_construction = building_galactic_stock_exchange
				has_building = building_galactic_stock_exchange
			}
		}
	}

	abort_trigger = {
		OR = {
			owner? = {
				is_regular_empire = no
			}
			colony? = {
				OR = {
					has_modifier = slave_colony
					has_modifier = resort_colony
				}
			}
		}
	}

	destroy_trigger = {
		OR = {
			owner? = {
				is_regular_empire = no
			}
			colony? = {
				OR = {
					has_modifier = slave_colony
					has_modifier = resort_colony
				}
			}
		}
	}

	show_in_tech = "tech_galactic_markets"

	show_tech_unlock_if = {
		is_nomadic = yes
		is_regular_empire = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_200
			rare_crystals = @arkship_cost_strategic_300
		}
		upkeep = {
			energy = @arkship_upkeep_energy_5
			rare_crystals = @arkship_upkeep_strategic_2
		}
	}

	planet_modifier = {
		job_trader_add = @building_static_jobs_high
		planet_jobs_trade_produces_mult = 0.10
	}

	ai_weight = {
		weight = 100
	}
}

arkship_embassy_complex = {
	icon = "GFX_orbitalring_embassy_complex"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_xeno_relations
			is_regular_empire = yes
		}
		colony? = {
			is_capital = yes
			NOR = {
				has_modifier = resort_colony
				has_modifier = slave_colony
			}
		}
	}

	possible = {
		colony? = {
			NOR = {
				has_building_construction = building_embassy
				has_building = building_embassy
				has_building_construction = building_grand_embassy
				has_building = building_grand_embassy
			}
		}
	}

	abort_trigger = {
		OR = {
			owner? = {
				is_regular_empire = no
			}
			colony? = { is_capital = no }
		}
	}

	destroy_trigger = {
		OR = {
			owner? = {
				is_regular_empire = no
			}
			colony? = { is_capital = no }
		}
	}

	show_in_tech = "tech_xeno_relations"

	show_tech_unlock_if = {
		is_nomadic = yes
		is_regular_empire = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_200
			rare_crystals = @arkship_cost_strategic_300
		}
		upkeep = {
			energy = @arkship_upkeep_energy_5
			rare_crystals = @arkship_upkeep_strategic_2
		}
	}

	country_modifier = {
		envoys_add = 2
	}

	triggered_planet_modifier = {
		potential = {
			owner? = {
				is_worker_coop_empire = no
				is_gestalt = no
			}
		}
		job_politician_add = @building_static_jobs_low
	}

	triggered_planet_modifier = {
		potential = {
			owner? = {
				is_worker_coop_empire = yes
			}
		}
		job_bureaucrat_add = @building_static_jobs_low
		mult = 1.5
	}

	ai_weight = {
		weight = 100
	}
}

arkship_noble_estates = {
	icon = "GFX_orbitalring_noble_estates"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_valid_civic = civic_aristocratic_elite
		}
		colony? = {
			NOT = {
				has_modifier = slave_colony
			}
		}
	}

	possible = {
		colony? = {
			NOR = {
				has_building_construction = building_noble_estates
				has_building = building_noble_estates
			}
		}
	}

	abort_trigger = {
		owner? = {
			NOT = {
				has_civic = civic_aristocratic_elite
			}
		}
	}

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


	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_200
			exotic_gases = @arkship_cost_strategic_300
		}
		upkeep = {
			energy = @arkship_upkeep_energy_5
			exotic_gases = @arkship_upkeep_strategic_2
		}
	}

	planet_modifier = {
		planet_housing_add = 200
	}

	triggered_planet_modifier = {
		potential = {
			owner? = {
				is_worker_coop_empire = no
				is_gestalt = no
			}
		}
		job_politician_add = @building_static_jobs
	}

	triggered_planet_modifier = {
		potential = {
			owner? = {
				is_worker_coop_empire = yes
			}
		}
		job_bureaucrat_add = @building_static_jobs
		mult = 1.5
	}

	ai_weight = {
		weight = 100
	}
}

arkship_slave_processing_facility = {
	icon = "GFX_orbitalring_slave_processing_facility"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_neural_implants
			is_regular_empire = yes
			OR = {
				has_policy_flag = slavery_allowed
				has_exploited_disconnected_drones = yes
			}
		}
		colony? = {
			NOT = {
				has_modifier = resort_colony
			}
		}
	}

	possible = {
		colony? = {
			NOR = {
				has_building_construction = building_slave_processing
				has_building = building_slave_processing
			}
		}
	}

	abort_trigger = {
		OR = {
			owner? = {
				NOR = {
					is_regular_empire = yes
					has_policy_flag = slavery_allowed
					has_exploited_disconnected_drones = yes
				}
			}
			colony? = { has_modifier = resort_colony }
		}
	}

	destroy_trigger = {
		OR = {
			owner? = {
				NOR = {
					is_regular_empire = yes
					has_policy_flag = slavery_allowed
					has_exploited_disconnected_drones = yes
				}
			}
			colony? = { has_modifier = resort_colony }
		}
	}

	show_in_tech = "tech_neural_implants"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_200
			volatile_motes = @arkship_cost_strategic_300
		}
		upkeep = {
			energy = @arkship_upkeep_energy_5
			volatile_motes = @arkship_upkeep_strategic_2
		}
	}

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

	ai_weight = {
		weight = 100
	}
}

arkship_resource_silo = {
	icon = "GFX_spaceport_module_resource_silo"
	starbase_type = arkship
	construction_days = 180
	category = sm_economy_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_100
		}
	}

	triggered_country_modifier = {
		potential = {
			owner? = {
				NOT = { has_technology = tech_construction_templates }
			}
		}
		country_resource_max_add = 5000
		situation_nomad_economy_max_progress_add = 500
	}

	triggered_country_modifier = {
		potential = {
			owner? = {
				has_technology = tech_construction_templates
			}
		}
		country_resource_max_add = 10000
		situation_nomad_economy_max_progress_add = 1000
	}

	ai_weight = {
		weight = 100
	}
}

arkship_listening_post = {
	icon = "GFX_spaceport_module_navigators_guild"
	starbase_type = arkship
	construction_days = 180
	category = sm_utility_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_sensors_2
		}
	}

	show_in_tech = "tech_sensors_2"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_100
		}
		upkeep = {
			energy = @arkship_upkeep_energy_2
		}
	}

	station_modifier = {
		ship_sensor_range_add = 2
		ship_hyperlane_range_add = 4
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_technology = tech_unusual_senses
			}
		}
		custom_tooltip = sm_listening_post_unusual_senses_desc
		ship_cloaking_detection_add = 1
		ship_sensor_range_add = 1
		mult = value:unusual_senses_mult
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				is_galactic_community_member = yes
			}
			galcom_has_astral_studies_network_or_greater_trigger = yes
		}
		ship_sensor_range_add = 1
		ship_hyperlane_range_add = 1
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_civic = civic_hive_subspace_ephapse
				has_first_contact_dlc = yes
			}
		}
		ship_cloaking_detection_add = 1
	}

	ai_weight = {
		weight = 100
	}
}

arkship_fleet_academy = {
	icon = "GFX_spaceport_module_fleet_academy"
	starbase_type = arkship
	construction_days = 360
	category = sm_naval_support_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_interstellar_fleet_traditions
		}
	}

	show_in_tech = "tech_interstellar_fleet_traditions"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_100
		}
		upkeep = {
			energy = @arkship_upkeep_energy_2
		}
	}

	ship_modifier = {
		ship_starting_experience_add = 100
	}

	ai_weight = {
		weight = 100
		modifier = {
			factor = 0
			NOT = {
				has_starbase_module = arkship_engineering_bay
			}
		}
	}
}

arkship_deep_space_black_site = {
	icon = "GFX_starbase_deep_space_black_site"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_living_state
			is_gestalt = no
		}
	}

	show_in_tech = "tech_living_state"

	show_tech_unlock_if = {
		is_nomadic = yes
		is_gestalt = no
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_100
		}
		produces = {
			unity = 1
		}
		upkeep = {
			energy = @arkship_upkeep_energy_2
		}
	}

	planet_modifier = {
		pop_government_ethic_attraction = 0.25
		planet_stability_add = 2
	}

	ai_weight = {
		weight = 100
	}
}

arkship_irassian_naval_yards = {
	icon = "GFX_starbase_irassian_naval_yards"
	starbase_type = arkship
	construction_days = 360
	category = sm_naval_support_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_secrets_irassian
		}
	}

	show_in_tech = "tech_secrets_irassian"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_100
			minor_artifacts = @minor_artifacts_cost_xl
		}
		upkeep = {
			energy = @arkship_upkeep_energy_2
		}
	}

	triggered_station_modifier = {
		potential = {
			owner = {
				NOT = { has_ascension_perk = ap_archaeoengineers }
			}
		}
		starbase_shipyard_build_speed_mult = 0.2
	}

	triggered_planet_modifier = {
		potential = {
			owner = {
				NOT = { has_ascension_perk = ap_archaeoengineers }
			}
		}
		planet_building_capacity_add = 2
	}

	triggered_station_modifier = {
		potential = {
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		starbase_shipyard_build_speed_mult = 0.3
	}

	triggered_planet_modifier = {
		potential = {
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		planet_building_capacity_add = 3
	}

	ai_weight = {
		weight = 100
		modifier = {
			factor = 0
			NOT = {
				has_starbase_module = arkship_engineering_bay
			}
		}
	}
}

arkship_yuht_detection_array = {
	icon = "GFX_starbase_yuht_detection_array"
	starbase_type = arkship
	construction_days = 360
	category = sm_utility_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_secrets_yuht
		}
	}

	show_in_tech = "tech_secrets_yuht"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_100
			minor_artifacts = @minor_artifacts_cost_xl
		}
		upkeep = {
			energy = @arkship_upkeep_energy_2
		}
	}

	triggered_station_modifier = {
		potential = {
			owner = {
				NOT = { has_ascension_perk = ap_archaeoengineers }
			}
		}
		ship_sensor_range_add = 7
		ship_hyperlane_range_add = 14
	}

	triggered_station_modifier = {
		potential = {
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		ship_sensor_range_add = 10
		ship_hyperlane_range_add = 20
	}

	ai_weight = {
		weight = 100
	}
}

arkship_archaeo_overcharger = {
	icon = "GFX_starbase_archaeo_overcharger"
	starbase_type = arkship
	construction_days = 360
	category = sm_defense_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_archaeo_overcharger
		}
	}

	show_in_tech = "tech_archaeo_overcharger"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_100
			minor_artifacts = @minor_artifacts_cost_xl
		}
		upkeep = {
			energy = @arkship_upkeep_energy_15
			exotic_gases = @arkship_upkeep_strategic_2
		}
	}

	triggered_station_modifier = {
		potential = {
			NOT = {
				owner = { has_ascension_perk = ap_archaeoengineers }
			}
		}
		ship_shield_mult = 0.33
		ship_shield_hardening_add = 0.33
	}

	triggered_station_modifier = {
		potential = {
			owner = { has_ascension_perk = ap_archaeoengineers }
		}
		ship_shield_mult = 0.5
		ship_shield_hardening_add = 0.5
	}

	ai_weight = {
		weight = 100
		modifier = {
			factor = 1.25
			ai_owner_has_archaeoengineers = yes
		}
	}
}

arkship_warp_fluctuator = {
	icon = "GFX_spaceport_module_atmospheric_manipulator"
	starbase_type = arkship
	construction_days = 360
	category = sm_aura_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_interstellar_economics
		}
	}

	show_in_tech = "tech_interstellar_economics"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_100
		}
		upkeep = {
			energy = @arkship_upkeep_energy_2
		}
	}

	equipped_component = "STARBASE_AURA_WARP_FLUCTUATOR"

	triggered_system_modifier = {
		# Gives some Stability per "Hyperspace Specialty" Councilor level.
		potential = {
			OR = {
				has_councilor = { COUNCILOR = "councilor_hyperspace_specialty" }
				has_councilor = { COUNCILOR = "councilor_hyperspace_specialty_corporate" }
			}
		}
		planet_stability_add = @councilor_hyperspace_specialty_warp_fluctuator_stability
		mult = value:councilor_level_combo|COUNCILOR_1|councilor_hyperspace_specialty|COUNCILOR_2|councilor_hyperspace_specialty_corporate|
	}

	ai_weight = {
		weight = 100
	}
}

arkship_detection_array = {
	icon = "GFX_spaceport_module_detecton_array"
	starbase_type = arkship
	construction_days = 180
	category = sm_utility_cat

	starbase_limit = {
		base = -1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_detection_array
		}
	}

	show_in_tech = "tech_detection_array"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_100
		}

		upkeep = {
			energy = @arkship_upkeep_energy_1
		}
	}

	station_modifier = {
		ship_cloaking_detection_add = 1
	}

	ai_weight = {
		weight = 100
	}
}

arkship_hydroponics_bay = {
	icon = "GFX_spaceport_module_hydroponic_farms"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = -1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = "tech_hydroponics"
			country_uses_food = yes
		}
	}

	show_in_tech = "tech_hydroponics"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_100
			exotic_gases = @arkship_cost_strategic_100
		}
		upkeep = {
			energy = @arkship_upkeep_energy_2
			exotic_gases = @arkship_upkeep_strategic_1
		}
	}

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

	ai_weight = {
		weight = 100
	}
}

arkship_harvest_processing_arrays = {
	icon = "GFX_orbitalring_mineral_hub"
	starbase_type = arkship
	construction_days = 360
	category = sm_colony_cat

	starbase_limit = {
		base = -1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_space_mining_3
		}
	}

	show_in_tech = "tech_space_mining_3"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_100
			volatile_motes = @arkship_cost_strategic_100
		}
		upkeep = {
			energy = @arkship_upkeep_energy_2
			volatile_motes = @arkship_upkeep_strategic_1
		}
	}

	inline_script = {
		script = jobs/ark_harvester_add
		AMOUNT = @building_static_jobs
	}

	ai_weight = {
		weight = 100
	}
}

arkship_dark_matter_detector = {
	icon = "GFX_starbase_dark_matter_detector"
	starbase_type = arkship
	construction_days = 360
	category = sm_utility_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_arkship_starbase = yes
		owner? = {
			has_technology = tech_dark_matter_detection
		}
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_detection_array"
			OR = {
				has_starbase_building = arkship_detection_array
				starbase_buildable_is_in_queue_before = {
					first = arkship_detection_array
					second = arkship_dark_matter_detector
				}
			}
		}
	}

	show_in_tech = "tech_dark_matter_detection"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_arkship_upgrades
		cost = {
			alloys = @arkship_cost_alloys_500
			sr_dark_matter = @arkship_cost_rare_25
		}
		upkeep = {
			energy = @arkship_upkeep_energy_5
			sr_dark_matter = 0.25
		}
	}

	custom_tooltip = sm_dark_matter_detector_desc_modifier
	triggered_station_modifier = {
		potential = {
			hidden_trigger = { exists = this }
			has_starbase_building = arkship_detection_array
		}
		ship_cloaking_detection_add = 1
		mult = value:dark_matter_detection_value
	}

	ai_weight = {
		weight = 100
		modifier = {
			factor = 0
			NOT = {
				has_starbase_building = arkship_detection_array
			}
		}
	}
}
