#	remote_network_resource_collection = yes - enables centralized and remote resource collection from all the waystations with this building in the network.

# Note that Waystation DO NOT use starbase buildings.

# If you add a new waystation module, also add it to common/inline_scripts/waystation/ai_design.txt
# and update the weights for all waystation starbase types in common/starbase_types/01_waystation_types.txt

waystation_energy_module = {
	icon = "GFX_waystation_energy_module"
	section = "SCIENCE_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_economy_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		exists = owner
		is_waystation_starbase = yes
	}

	possible = {
		custom_tooltip = {
			fail_text = requires_energy_deposit
			system_has_station_resource = {
				RESOURCE = energy
			}
		}
	}

	show_in_tech = "tech_solar_panel_network"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	collected_system_resources = {
		energy = {
			always = yes
		}
	}

	station_modifier = {
		custom_tooltip = allows_energy_collection
		show_only_custom_tooltip = no
		starbase_stockpile_energy_capacity_add = @waystation_stockpile_500
	}

	triggered_system_modifier = {
		potential = {
			exists = owner
			space_owner? = {
				NOT = {
					benefits_from_waystation_network = {
						NOMAD = root.owner
						SYSTEM_OWNER = this
					}
				}
			}
		}
		custom_tooltip = waystation_collection_penalty_energy_tt
		show_only_custom_tooltip = yes
		station_gatherers_energy_produces_mult = @waystation_modifier_negative_mult_25_percent
	}


	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_energy_add = @waystation_joyous_path_add_10
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_energy_add = @waystation_middle_path_add_5
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_energy_add = @waystation_sacred_site_add_10
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_mining_module = {
	icon = "GFX_waystation_mining_module"
	section = "REFINERY_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_economy_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		exists = owner
		is_waystation_starbase = yes
	}

	possible = {
		custom_tooltip = {
			fail_text = requires_mining_deposit
			OR = {
				system_has_station_resource = {
					RESOURCE = minerals
				}
				system_has_station_resource = {
					RESOURCE = food
				}
				system_has_station_resource = {
					RESOURCE = consumer_goods
				}
				system_has_station_resource = {
					RESOURCE = alloys
				}
			}
		}
	}

	show_in_tech = "tech_basic_industry"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	collected_system_resources = {
		minerals = {
			always = yes
		}
		food = {
			always = yes
		}
		consumer_goods = {
			always = yes
		}
		alloys = {
			always = yes
		}
	}

	station_modifier = {
		custom_tooltip = allows_mining_collection
		show_only_custom_tooltip = no
		starbase_stockpile_minerals_capacity_add = @waystation_stockpile_500
	}

	triggered_station_modifier = {
		potential = {
			system_has_station_resource = {
				RESOURCE = food
			}
		}
		starbase_stockpile_food_capacity_add = @waystation_stockpile_500
	}
	triggered_station_modifier = {
		potential = {
			system_has_station_resource = {
				RESOURCE = consumer_goods
			}
		}
		starbase_stockpile_consumer_goods_capacity_add = @waystation_stockpile_250
	}

	triggered_station_modifier = {
		potential = {
			system_has_station_resource = {
				RESOURCE = alloys
			}
		}
		starbase_stockpile_alloys_capacity_add = @waystation_stockpile_250
	}

	triggered_system_modifier = {
		potential = {
			exists = owner
			space_owner? = {
				NOT = {
					benefits_from_waystation_network = {
						NOMAD = root.owner
						SYSTEM_OWNER = this
					}
				}
			}
		}
		custom_tooltip = waystation_collection_penalty_mining_tt
		show_only_custom_tooltip = yes
		station_gatherers_minerals_produces_mult = @waystation_modifier_negative_mult_25_percent
		station_gatherers_food_produces_mult = @waystation_modifier_negative_mult_25_percent
		station_gatherers_consumer_goods_produces_mult = @waystation_modifier_negative_mult_25_percent
		station_gatherers_alloys_produces_mult = @waystation_modifier_negative_mult_25_percent
	}


	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_minerals_add = @waystation_joyous_path_add_10
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_minerals_add = @waystation_middle_path_add_5
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_minerals_add = @waystation_sacred_site_add_10
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_hydroponics_module = {
	icon = "GFX_spaceport_module_hydroponic_farms"
	section = "REFINERY_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_economy_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_waystation_starbase = yes
		owner? = {
			has_technology = "tech_hydroponics"
		}
	}

	possible = {
		owner? = {
			OR = {
				is_ai = no
				country_uses_food = yes
			}
		}
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_50
		}

		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	station_modifier = {
		starbase_collected_system_food_add = @waystation_module_resource_add_10
		starbase_stockpile_food_capacity_add = @waystation_stockpile_500
	}

	show_in_tech = "tech_hydroponics"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_food_add = @waystation_joyous_path_add_10
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_food_add = @waystation_middle_path_add_5
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_food_add = @waystation_sacred_site_add_10
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_refinery_module = {
	icon = "GFX_waystation_refinery_module"
	section = "REFINERY_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_economy_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		owner? = {
			has_technology = tech_nomads_mechanized_mining
		}
		is_waystation_starbase = yes
	}

	possible = {
		custom_tooltip = {
			fail_text = requires_sr_deposit
			OR = {
				system_has_station_resource = {
					RESOURCE = exotic_gases
				}
				system_has_station_resource = {
					RESOURCE = rare_crystals
				}
				system_has_station_resource = {
					RESOURCE = volatile_motes
				}
			}
		}
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	collected_system_resources = {
		exotic_gases = {
			owner? = {
				has_technology = tech_nomads_mechanized_mining
			}
		}
		rare_crystals = {
			owner? = {
				has_technology = tech_nomads_mechanized_mining
			}
		}
		volatile_motes = {
			owner? = {
				has_technology = tech_nomads_mechanized_mining
			}
		}
	}

	station_modifier = {
		custom_tooltip = allows_sr_collection
		show_only_custom_tooltip = no
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_technology = tech_nomads_mechanized_mining
			}
			system_has_station_resource = {
				RESOURCE = exotic_gases
			}
		}
		starbase_stockpile_exotic_gases_capacity_add = @waystation_stockpile_125
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_technology = tech_nomads_mechanized_mining
			}
			system_has_station_resource = {
				RESOURCE = rare_crystals
			}
		}
		starbase_stockpile_rare_crystals_capacity_add = @waystation_stockpile_125
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_technology = tech_nomads_mechanized_mining
			}
			system_has_station_resource = {
				RESOURCE = volatile_motes
			}
		}
		starbase_stockpile_volatile_motes_capacity_add = @waystation_stockpile_125
	}

	triggered_system_modifier = {
		potential = {
			exists = owner
			space_owner? = {
				NOT = {
					benefits_from_waystation_network = {
						NOMAD = root.owner
						SYSTEM_OWNER = this
					}
				}
			}
		}
		custom_tooltip = waystation_collection_penalty_refinery_tt
		show_only_custom_tooltip = yes
		station_gatherers_exotic_gases_produces_mult = @waystation_modifier_negative_mult_25_percent
		station_gatherers_rare_crystals_produces_mult = @waystation_modifier_negative_mult_25_percent
		station_gatherers_volatile_motes_produces_mult = @waystation_modifier_negative_mult_25_percent
	}


	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
				has_technology = tech_nomads_mechanized_mining
			}
			has_neighboring_waystation = yes
			system_has_station_resource = {
				RESOURCE = exotic_gases
			}
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_exotic_gases_add = @waystation_joyous_path_add_4
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
				has_technology = tech_nomads_mechanized_mining
			}
			has_neighboring_waystation = yes
			system_has_station_resource = {
				RESOURCE = rare_crystals
			}
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_rare_crystals_add = @waystation_joyous_path_add_4
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
				has_technology = tech_nomads_mechanized_mining
			}
			has_neighboring_waystation = yes
			system_has_station_resource = {
				RESOURCE = volatile_motes
			}
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_volatile_motes_add = @waystation_joyous_path_add_4
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
				has_technology = tech_nomads_mechanized_mining
			}
			is_sacred_site_waystation = no
			system_has_station_resource = {
				RESOURCE = exotic_gases
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_exotic_gases_add = @waystation_middle_path_add_2
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
				has_technology = tech_nomads_mechanized_mining
			}
			is_sacred_site_waystation = no
			system_has_station_resource = {
				RESOURCE = rare_crystals
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_rare_crystals_add = @waystation_middle_path_add_2
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
				has_technology = tech_nomads_mechanized_mining
			}
			is_sacred_site_waystation = no
			system_has_station_resource = {
				RESOURCE = volatile_motes
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_volatile_motes_add = @waystation_middle_path_add_2
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
				has_technology = tech_nomads_mechanized_mining
			}
			is_sacred_site_waystation = yes
			system_has_station_resource = {
				RESOURCE = exotic_gases
			}
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_exotic_gases_add = @waystation_sacred_site_add_4
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
				has_technology = tech_nomads_mechanized_mining
			}
			is_sacred_site_waystation = yes
			system_has_station_resource = {
				RESOURCE = rare_crystals
			}
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_rare_crystals_add = @waystation_sacred_site_add_4
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
				has_technology = tech_nomads_mechanized_mining
			}
			is_sacred_site_waystation = yes
			system_has_station_resource = {
				RESOURCE = volatile_motes
			}
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_volatile_motes_add = @waystation_sacred_site_add_4
	}

	show_in_tech = tech_nomads_mechanized_mining

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_research_module = {
	icon = "GFX_waystation_research_module"
	section = "SCIENCE_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_economy_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		exists = owner
		is_waystation_starbase = yes
	}

	possible = {
		custom_tooltip = {
			fail_text = requires_research_deposit
			OR = {
				system_has_station_resource = {
					RESOURCE = physics_research
				}
				system_has_station_resource = {
					RESOURCE = society_research
				}
				system_has_station_resource = {
					RESOURCE = engineering_research
				}
				system_has_station_resource = {
					RESOURCE = unity
				}
				system_has_station_resource = {
					RESOURCE = minor_artifacts
				}
				system_has_station_resource = {
					RESOURCE = astral_threads
				}
				system_has_station_resource = {
					RESOURCE = sr_dark_matter
				}
				system_has_station_resource = {
					RESOURCE = sr_living_metal
				}
				system_has_station_resource = {
					RESOURCE = sr_zro
				}
				system_has_station_resource = {
					RESOURCE = nanites
				}
				solar_system? = {
					OR = {
						has_astral_rift = yes
						any_system_planet = {
							owner? = {
								is_country_type = primitive
							}
						}
					}
				}
			}
		}
	}

	show_in_tech = "tech_space_exploration"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	collected_system_resources = {
		physics_research = {
			always = yes
		}
		society_research = {
			always = yes
		}
		engineering_research = {
			always = yes
		}
		unity = {
			always = yes
		}
		minor_artifacts = {
			has_ancrel = yes
		}
		astral_threads = {
			owner? = {
				has_technology = tech_astral_harvesting
			}
		}
		sr_dark_matter = {
			owner? = {
				has_technology = tech_mine_dark_matter
			}
		}
		sr_living_metal = {
			owner? = {
				has_technology = tech_mine_living_metal
			}
		}
		sr_zro = {
			owner? = {
				has_technology = tech_mine_zro
			}
		}
		nanites = {
			always = yes
		}
	}

	station_modifier = {
		custom_tooltip = allows_research_collection
		show_only_custom_tooltip = no
	}

	triggered_system_modifier = {
		potential = {
			exists = owner
			space_owner? = {
				NOT = {
					benefits_from_waystation_network = {
						NOMAD = root.owner
						SYSTEM_OWNER = this
					}
				}
			}
		}
		custom_tooltip = waystation_collection_penalty_research_tt
		show_only_custom_tooltip = yes
		station_researchers_produces_mult = @waystation_modifier_negative_mult_25_percent
	}


	station_modifier = {
		starbase_stockpile_physics_research_capacity_add = @waystation_stockpile_375
		starbase_stockpile_society_research_capacity_add = @waystation_stockpile_375
		starbase_stockpile_engineering_research_capacity_add = @waystation_stockpile_375
	}

	triggered_station_modifier = {
		potential = {
			system_has_station_resource = {
				RESOURCE = unity
			}
		}
		starbase_stockpile_unity_capacity_add = @waystation_stockpile_375
	}

	triggered_station_modifier = {
		potential = {
			has_ancrel = yes
			system_has_station_resource = {
				RESOURCE = minor_artifacts
			}
		}
		starbase_stockpile_minor_artifacts_capacity_add = @waystation_stockpile_125
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_technology = tech_astral_harvesting
			}
			OR = {
				solar_system = {
					has_astral_rift = yes
				}
				system_has_station_resource = {
					RESOURCE = astral_threads
				}
			}
		}
		starbase_stockpile_astral_threads_capacity_add = @waystation_stockpile_125
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_technology = tech_mine_dark_matter
			}
			system_has_station_resource = {
				RESOURCE = sr_dark_matter
			}
		}
		starbase_stockpile_sr_dark_matter_capacity_add = @waystation_stockpile_75
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_technology = tech_mine_living_metal
			}
			system_has_station_resource = {
				RESOURCE = sr_living_metal
			}
		}
		starbase_stockpile_sr_living_metal_capacity_add = @waystation_stockpile_75
	}

	triggered_station_modifier = {
		potential = {
			system_has_station_resource = {
				RESOURCE = nanites
			}
		}
		starbase_stockpile_nanites_capacity_add = @waystation_stockpile_75
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_technology = tech_mine_zro
			}
			system_has_station_resource = {
				RESOURCE = sr_zro
			}
		}
		starbase_stockpile_sr_zro_capacity_add = @waystation_stockpile_75
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
			system_has_station_resource = {
				RESOURCE = physics_research
			}
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_physics_research_add = @waystation_joyous_path_add_4
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
			system_has_station_resource = {
				RESOURCE = society_research
			}
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_society_research_add = @waystation_joyous_path_add_4
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
			system_has_station_resource = {
				RESOURCE = engineering_research
			}
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_engineering_research_add = @waystation_joyous_path_add_4
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
			system_has_station_resource = {
				RESOURCE = physics_research
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_physics_research_add = @waystation_middle_path_add_5
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
			system_has_station_resource = {
				RESOURCE = society_research
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_society_research_add = @waystation_middle_path_add_5
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
			system_has_station_resource = {
				RESOURCE = engineering_research
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_engineering_research_add = @waystation_middle_path_add_5
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
			system_has_station_resource = {
				RESOURCE = physics_research
			}

		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_physics_research_add = @waystation_sacred_site_add_10
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
			system_has_station_resource = {
				RESOURCE = society_research
			}
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_society_research_add = @waystation_sacred_site_add_10
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
			system_has_station_resource = {
				RESOURCE = engineering_research
			}
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_engineering_research_add = @waystation_sacred_site_add_10
	}

	# Pre-FTL society research: policy base + approach delta, stacked additively.

	triggered_station_modifier = {
		potential = {
			owner? = {
				is_nomadic = yes
				has_policy_flag = interference_not_allowed
			}
			solar_system = {
				any_system_planet = {
					owner? = {
						is_country_type = primitive
					}
					has_observation_outpost = no
				}
			}
		}
		custom_tooltip = waystation_research_module_preftl_society_tt
		show_only_custom_tooltip = no
		starbase_collected_system_society_research_add = 2
	}
	triggered_station_modifier = {
		potential = {
			owner? = {
				is_nomadic = yes
				has_policy_flag = interference_subtle
			}
			solar_system = {
				any_system_planet = {
					owner? = {
						is_country_type = primitive
					}
					has_observation_outpost = no
				}
			}
		}
		custom_tooltip = waystation_research_module_preftl_society_tt
		show_only_custom_tooltip = no
		starbase_collected_system_society_research_add = @waystation_module_resource_add_3
	}
	triggered_station_modifier = {
		potential = {
			owner? = {
				is_nomadic = yes
				has_policy_flag = interference_active
			}
			solar_system = {
				any_system_planet = {
					owner? = {
						is_country_type = primitive
					}
					has_observation_outpost = no
				}
			}
		}
		custom_tooltip = waystation_research_module_preftl_society_tt
		show_only_custom_tooltip = no
		starbase_collected_system_society_research_add = 4
	}
	triggered_station_modifier = {
		potential = {
			owner? = {
				is_nomadic = yes
				has_policy_flag = interference_aggressive
			}
			solar_system = {
				any_system_planet = {
					owner? = {
						is_country_type = primitive
					}
					has_observation_outpost = no
				}
			}
		}
		custom_tooltip = waystation_research_module_preftl_society_tt
		show_only_custom_tooltip = no
		starbase_collected_system_society_research_add = 5
	}

	# Approach deltas: favor insights trades -2 society for insight progress; favor mission does the reverse.
	triggered_station_modifier = {
		potential = {
			owner? = {
				is_nomadic = yes
				has_country_flag = favored_insights
			}
			solar_system = {
				any_system_planet = {
					owner? = {
						is_country_type = primitive
					}
					has_observation_outpost = no
				}
			}
		}
		custom_tooltip = waystation_research_module_preftl_favor_insights_tt
		show_only_custom_tooltip = no
		starbase_collected_system_society_research_add = -2
	}
	triggered_station_modifier = {
		potential = {
			owner? = {
				is_nomadic = yes
				has_country_flag = favored_mission
			}
			solar_system = {
				any_system_planet = {
					owner? = {
						is_country_type = primitive
					}
					has_observation_outpost = no
				}
			}
		}
		custom_tooltip = waystation_research_module_preftl_favor_mission_tt
		show_only_custom_tooltip = no
		starbase_collected_system_society_research_add = 2
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				is_galactic_community_member = yes
				OR = {
					is_active_resolution = "resolution_galacticstudies_advanced_xenostudies"
					is_active_resolution = "resolution_galacticstudies_ethical_guideline_refactoring"
					is_active_resolution = "resolution_galacticstudies_extradimensional_experimentation"
				}
			}
			solar_system = {
				any_system_planet = {
					owner? = {
						is_country_type = primitive
					}
					has_observation_outpost = no
				}
			}
		}
		custom_tooltip = waystation_research_module_preftl_xenostudies_tt
		show_only_custom_tooltip = no
		starbase_collected_system_society_research_add = 2
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				is_galactic_community_member = yes
				OR = {
					is_active_resolution = "resolution_commerce_underdeveloped_system_utilization"
					is_active_resolution = "resolution_commerce_holistic_asset_coordination"
					is_active_resolution = "resolution_commerce_profit_maximization_engines"
				}
			}
			solar_system = {
				any_system_planet = {
					owner? = {
						is_country_type = primitive
					}
					has_observation_outpost = no
				}
			}
		}
		custom_tooltip = waystation_research_module_preftl_underdeveloped_tt
		show_only_custom_tooltip = no
		starbase_collected_system_consumer_goods_add = @waystation_module_resource_add_1
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				is_galactic_community_member = yes
				is_active_resolution = "resolution_pre_ftl_stances_exploitation"
				NOR = {
					is_active_resolution = "resolution_galacticstudies_advanced_xenostudies"
					is_active_resolution = "resolution_galacticstudies_ethical_guideline_refactoring"
					is_active_resolution = "resolution_galacticstudies_extradimensional_experimentation"
				}
			}
			solar_system = {
				any_system_planet = {
					owner? = {
						is_country_type = primitive
					}
					has_observation_outpost = no
				}
			}
		}
		custom_tooltip = waystation_research_module_preftl_exploitation_tt
		show_only_custom_tooltip = no
		starbase_collected_system_physics_research_add = 2
		starbase_collected_system_engineering_research_add = 2
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				is_galactic_community_member = yes
				is_active_resolution = "resolution_pre_ftl_stances_exploitation"
				OR = {
					is_active_resolution = "resolution_galacticstudies_advanced_xenostudies"
					is_active_resolution = "resolution_galacticstudies_ethical_guideline_refactoring"
					is_active_resolution = "resolution_galacticstudies_extradimensional_experimentation"
				}
			}
			solar_system = {
				any_system_planet = {
					owner? = {
						is_country_type = primitive
					}
					has_observation_outpost = no
				}
			}
		}
		custom_tooltip = waystation_research_module_preftl_exploitation_xenostudies_tt
		show_only_custom_tooltip = no
		starbase_collected_system_physics_research_add = @waystation_module_resource_add_1
		starbase_collected_system_engineering_research_add = @waystation_module_resource_add_1
	}

	triggered_station_modifier = {
		potential = {
			solar_system = {
				any_system_planet = {
					has_modifier = preftl_nomad_trade_pact
					has_observation_outpost = no
				}
			}
		}
		custom_tooltip = waystation_research_module_preftl_trade_pact_tt
		show_only_custom_tooltip = no
		starbase_collected_system_energy_add = 2
	}

	waystation_network_country_modifier = {
		research_sharing_mult = @waystation_modifier_mult_1_percent
	}

	on_finished = {
		solar_system = {
			every_system_planet = {
				limit = {
					owner? = {
						is_country_type = primitive
						NOT = {
							has_communications = root.owner
						}
					}
				}
				owner = {
					establish_communications = root.owner
					save_event_target_as = contacted_preftl
				}
				root.owner = {
					add_intel = {
						amount = 100
						who = event_target:contacted_preftl
					}
				}
			}
		}
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_trade_module = {
	icon = "GFX_waystation_trade_module"
	section = "REFINERY_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_economy_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		owner? = {
			has_technology = tech_space_trading
		}
		is_waystation_starbase = yes
	}

	possible = {
		OR = {
			custom_tooltip = {
				fail_text = requires_trade_deposit
				system_has_station_resource = {
					RESOURCE = trade
				}
			}
			AND = {
				custom_tooltip = {
					fail_text = requires_colony_no
					success_text = requires_colony
					solar_system? = {
						any_system_planet = {
							is_colony = yes
						}
					}
				}
				custom_tooltip = {
					fail_text = requires_commercial_pact_no
					success_text = requires_commercial_pact
					exists = owner
					space_owner? = {
						benefits_from_waystation_network = {
							NOMAD = root.owner
							SYSTEM_OWNER = this
						}
					}
				}
			}
		}
	}

	show_in_tech = "tech_space_trading"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	collected_system_resources = {
		trade = {
			always = yes
		}
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
		}
	}

	station_modifier = {
		starbase_stockpile_trade_capacity_add = @waystation_stockpile_375
	}

	triggered_station_modifier = {
		starbase_collected_system_trade_add = @waystation_module_resource_add_5
		mult = solar_system.value:num_planetary_colonies_in_system
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
			solar_system = {
				any_system_planet = {
					is_colony = yes
				}
			}
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_trade_add = @waystation_joyous_path_add_10
		mult = solar_system.value:num_planetary_colonies_in_system
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
			solar_system = {
				any_system_planet = {
					is_colony = yes
				}
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_trade_add = @waystation_middle_path_add_5
		mult = solar_system.value:num_planetary_colonies_in_system
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
			solar_system = {
				any_system_planet = {
					is_colony = yes
				}
			}
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_trade_add = @waystation_sacred_site_add_10
		mult = solar_system.value:num_planetary_colonies_in_system
	}

	waystation_network_country_modifier = {
		commercial_pact_mult = @waystation_modifier_mult_1_percent
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_treasure_vault = {
	icon = "GFX_waystation_treasure_vault"
	section = "REFINERY_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_economy_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_waystation_starbase = yes
	}

	possible = {
		custom_tooltip = {
			fail_text = requires_subject_colony_no
			success_text = requires_subject_colony
			solar_system? = {
				any_system_planet = {
					is_colony = yes
					owner? = {
						has_overlord = root.owner
						is_primitive = no
					}
				}
			}
		}
	}

	destroy_trigger = {
		NOT = {
			solar_system = {
				any_system_planet = {
					is_colony = yes
					owner? = {
						has_overlord = root.owner
						is_primitive = no
					}
				}
			}
		}
	}

	collected_colony_resources = {
		collection_type = steal
		basic = {
			from.owner = {
				has_overlord = root.owner
				is_primitive = no
			}
		}
		advanced = {
			from.owner = {
				has_overlord = root.owner
				is_primitive = no
			}
		}
		strategic = {
			from.owner = {
				has_overlord = root.owner
				is_primitive = no
			}
		}
	}

	station_modifier = {
		starbase_stockpile_capacity_add = @waystation_stockpile_500
		starbase_collected_colony_resources_add = 0.01
	}

	on_finished = {
		if = {
			limit = {
				NOT = {
					has_starbase_flag = tribute_vault_loyalty_set
				}
			}
			set_starbase_flag = tribute_vault_loyalty_set
			solar_system = {
				random_system_planet = {
					limit = {
						is_colony = yes
						owner? = {
							has_overlord = root.owner
							is_primitive = no
						}
					}
					owner = {
						if = {
							limit = {
								is_variable_set = tribute_vault_count
							}
							change_variable = {
								which = tribute_vault_count
								value = 1
							}
							else = {
								set_variable = {
									which = tribute_vault_count
									value = 1
								}
							}
						}
						refresh_tribute_vault_loyalty = yes
					}
				}
			}
		}
	}

	on_destroyed = {
		remove_starbase_flag = tribute_vault_loyalty_set
		solar_system = {
			random_system_planet = {
				limit = {
					is_colony = yes
					owner? = {
						has_overlord = root.owner
						is_primitive = no
					}
				}
				owner = {
					if = {
						limit = {
							is_variable_set = tribute_vault_count
							check_variable = {
								which = tribute_vault_count
								value > 0
							}
						}
						change_variable = {
							which = tribute_vault_count
							value = -1
						}
					}
					refresh_tribute_vault_loyalty = yes
				}
			}
		}
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_150
		}
		upkeep = {
			trade = @waystation_upkeep_trade_4
		}
	}

	custom_tooltip_with_modifiers = waystation_treasure_vault_tt

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_origin = origin_heirs_of_the_khan
			}
		}
		custom_tooltip = waystation_treasure_vault_heirs_of_the_khan_tt
		show_only_custom_tooltip = no
		starbase_stockpile_capacity_add = @waystation_stockpile_250
		starbase_collected_colony_resources_add = 0.04
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				any_subject = {
					any_agreement = {
						agreement_preset = preset_relic_satrapy
					}
				}
			}
		}
		custom_tooltip = waystation_treasure_vault_satrapy_tt
		show_only_custom_tooltip = no
		starbase_stockpile_capacity_add = @waystation_stockpile_250
		starbase_collected_colony_resources_add = 0.025
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_embrace_chaos
			}
		}
		custom_tooltip = waystation_treasure_vault_embrace_chaos_tt
		show_only_custom_tooltip = no
		starbase_stockpile_capacity_add = @waystation_stockpile_250
		starbase_collected_colony_resources_add = 0.015
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_valid_civic = civic_barbaric_despoilers
			}
		}
		custom_tooltip = waystation_treasure_vault_despoilers_tt
		show_only_custom_tooltip = no
		starbase_stockpile_capacity_add = @waystation_stockpile_250
		starbase_collected_colony_resources_add = 0.015
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_valid_civic = civic_void_reavers
			}
		}
		custom_tooltip = waystation_treasure_vault_void_reavers_tt
		show_only_custom_tooltip = no
		starbase_stockpile_capacity_add = @waystation_stockpile_250
		starbase_collected_colony_resources_add = 0.015
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_valid_civic = civic_crusader_spirit_corporate
			}
		}
		custom_tooltip = waystation_treasure_vault_letters_of_marque_tt
		show_only_custom_tooltip = no
		starbase_stockpile_capacity_add = @waystation_stockpile_250
		starbase_collected_colony_resources_add = 0.015
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_ascension_perk = ap_nihilistic_acquisition
			}
		}
		custom_tooltip = waystation_treasure_vault_nihilistic_acquisition_tt
		show_only_custom_tooltip = no
		starbase_stockpile_capacity_add = @waystation_stockpile_250
		starbase_collected_colony_resources_add = 0.015
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_logistics_hub = {
	icon = "GFX_waystation_logistics_hub"
	section = "SHIPYARD_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_economy_cat

	empire_limit = {
		base = 0.1
		modifier = {
			factor = owner.trigger:max_starbase_capacity
		}
		modifier = {
			add = 1
		}
	}

	starbase_limit = {
		base = 1
	}

	potential = {
		owner? = {
			has_technology = tech_waystation_3
		}
		is_waystation_starbase = yes
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_50
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
			mult = starbase.trigger:starbase_network_size
		}
	}

	country_modifier = {
		nomadic_constructor_limit_add = @waystation_module_constructor_limit_1
	}

	custom_tooltip_with_modifiers = sm_waystation_logistics_hub_tt

	remote_network_resource_collection = yes

	show_in_tech = "tech_waystation_3"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_repair_bay = {
	icon = "GFX_starbase_shipyard"
	section = "SHIPYARD_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_naval_support_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		owner? = {
			has_technology = tech_waystation_2
		}
		is_waystation_starbase = yes
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_50
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	waystation_network_system_modifier = {
		starbase_shipyard_build_speed_mult = @waystation_modifier_mult_5_percent
	}

	custom_tooltip = sm_waystation_repair_bay_tt

	show_in_tech = "tech_waystation_2"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_resource_silo = {
	icon = "GFX_spaceport_module_resource_silo"
	section = "REFINERY_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_economy_cat

	starbase_limit = {
		base = 1
	}

	starbase_limit = {
		base = -1
	}

	potential = {
		is_waystation_starbase = yes
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_50
		}
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				NOT = {
					has_technology = tech_construction_templates
				}
			}
		}
		starbase_stockpile_capacity_add = @waystation_stockpile_5000
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_technology = tech_construction_templates
			}
		}
		starbase_stockpile_capacity_add = @waystation_stockpile_10000
	}

	triggered_country_modifier = {
		potential = {
			owner? = {
				NOT = {
					has_technology = tech_construction_templates
				}
			}
		}
		situation_nomad_economy_max_progress_add = @waystation_stockpile_500
	}

	triggered_country_modifier = {
		potential = {
			owner? = {
				has_technology = tech_construction_templates
			}
		}
		situation_nomad_economy_max_progress_add = @waystation_stockpile_1000
	}

	triggered_waystation_network_country_modifier = {
		potential = {
			owner? = {
				NOT = {
					has_technology = tech_construction_templates
				}
			}
		}
		country_resource_max_add = @waystation_stockpile_500
	}

	triggered_waystation_network_country_modifier = {
		potential = {
			owner? = {
				has_technology = tech_construction_templates
			}
		}
		country_resource_max_add = @waystation_stockpile_1000
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_nebula_refinery = {
	icon = "GFX_spaceport_nebula_refinery"
	section = "REFINERY_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_economy_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		owner? = {
			has_technology = tech_space_mining_1
		}
		is_waystation_starbase = yes
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_nebula"
			solar_system = {
				is_inside_nebula = yes
			}
		}
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	station_modifier = {
		starbase_collected_system_minerals_add = @waystation_module_resource_add_10
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_technology = tech_nomads_mechanized_mining
			}
		}
		starbase_collected_system_exotic_gases_add = @waystation_module_resource_add_1
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
				has_technology = tech_nomads_mechanized_mining
			}
			has_neighboring_waystation = yes
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_exotic_gases_add = @waystation_joyous_path_add_10
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
				has_technology = tech_nomads_mechanized_mining
			}
			is_sacred_site_waystation = no
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_exotic_gases_add = @waystation_middle_path_add_5
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
				has_technology = tech_nomads_mechanized_mining
			}
			is_sacred_site_waystation = yes
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_exotic_gases_add = @waystation_sacred_site_add_10
	}

	waystation_network_system_modifier = {
		station_gatherers_minerals_produces_mult = @waystation_modifier_mult_5_percent
	}

	show_in_tech = "tech_space_mining_1"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_observatory = {
	icon = "GFX_spaceport_module_observatory"
	section = "SCIENCE_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_economy_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		owner? = {
			has_technology = tech_sensors_3
		}
		is_waystation_starbase = yes
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	station_modifier = {
		custom_tooltip = starbase_observatory_tt
		show_only_custom_tooltip = no
	}

	# Base Outputs
	triggered_station_modifier = {
		starbase_collected_system_physics_research_add = @waystation_module_resource_add_1
		mult = value:starbase_observatory_physics_output_mult
	}

	triggered_station_modifier = {
		starbase_collected_system_engineering_research_add = @waystation_module_resource_add_1
		mult = value:starbase_observatory_engineering_output_mult
	}

	triggered_station_modifier = {
		starbase_collected_system_exotic_gases_add = @waystation_module_resource_add_1
		starbase_collected_system_volatile_motes_add = @waystation_module_resource_add_1
		mult = value:starbase_observatory_toxic_star_output_mult
	}

	triggered_station_modifier = {
		starbase_collected_system_astral_threads_add = @waystation_module_resource_add_1
		mult = value:starbase_observatory_astral_star_output_mult
	}

	triggered_station_modifier = {
		starbase_collected_system_sr_dark_matter_add = @waystation_module_resource_add_1
		mult = value:starbase_observatory_dark_matter_output_mult
	}

	# Joyous Enlightenment
	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
			star? = {
				OR = {
					is_star_class = sc_b
					is_star_class = sc_a
					is_star_class = sc_f
					is_star_class = sc_g
					is_star_class = sc_k
					is_star_class = sc_m
					is_star_class = sc_m_giant
					is_star_class = sc_t
					is_binary_star = yes
					is_trinary_star = yes
					is_star_class = sc_black_hole
				}
			}
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_physics_research_add = @waystation_joyous_path_add_2
		mult = value:starbase_observatory_physics_output_mult
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
			star? = {
				OR = {
					is_star_class = sc_pulsar
					is_star_class = sc_binary_1
					is_star_class = sc_crisis_binary_1
					is_star_class = sc_neutron_star
					is_star_class = sc_binary_2
					is_star_class = sc_crisis_binary_2
					is_star_class = sc_black_hole
				}
			}
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_engineering_research_add = @waystation_joyous_path_add_2
		mult = value:starbase_observatory_engineering_output_mult
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
			star? = {
				is_star_class = sc_toxoid_star
			}
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_exotic_gases_add = @waystation_joyous_path_add_2
		starbase_collected_system_volatile_motes_add = @waystation_joyous_path_add_2
		mult = value:starbase_observatory_toxic_star_output_mult
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
			star? = {
				is_star_class = sc_rift_star
			}
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_astral_threads_add = @waystation_joyous_path_add_2
		mult = value:starbase_observatory_astral_star_output_mult
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
			owner? = {
				has_technology = tech_mine_dark_matter
			}
			star? = {
				is_star_class = sc_black_hole
			}
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_sr_dark_matter_add = @waystation_joyous_path_add_2
		mult = value:starbase_observatory_dark_matter_output_mult
	}

	# Middle Path - Not Sacred Site
	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
			star? = {
				OR = {
					is_star_class = sc_b
					is_star_class = sc_a
					is_star_class = sc_f
					is_star_class = sc_g
					is_star_class = sc_k
					is_star_class = sc_m
					is_star_class = sc_m_giant
					is_star_class = sc_t
					is_binary_star = yes
					is_trinary_star = yes
					is_star_class = sc_black_hole
				}
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_physics_research_add = @waystation_middle_path_add_1
		mult = value:starbase_observatory_physics_output_mult
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
			star? = {
				OR = {
					is_star_class = sc_pulsar
					is_star_class = sc_binary_1
					is_star_class = sc_crisis_binary_1
					is_star_class = sc_neutron_star
					is_star_class = sc_binary_2
					is_star_class = sc_crisis_binary_2
					is_star_class = sc_black_hole
				}
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_engineering_research_add = @waystation_middle_path_add_1
		mult = value:starbase_observatory_engineering_output_mult
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
			star? = {
				is_star_class = sc_toxoid_star
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_exotic_gases_add = @waystation_middle_path_add_1
		starbase_collected_system_volatile_motes_add = @waystation_middle_path_add_1
		mult = value:starbase_observatory_toxic_star_output_mult
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
			star? = {
				is_star_class = sc_rift_star
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_astral_threads_add = @waystation_middle_path_add_1
		mult = value:starbase_observatory_astral_star_output_mult
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
			owner? = {
				has_technology = tech_mine_dark_matter
			}
			star? = {
				is_star_class = sc_black_hole
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_sr_dark_matter_add = @waystation_middle_path_add_1
		mult = value:starbase_observatory_dark_matter_output_mult
	}

	# Middle Path - Sacred Site
	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
			star? = {
				OR = {
					is_star_class = sc_b
					is_star_class = sc_a
					is_star_class = sc_f
					is_star_class = sc_g
					is_star_class = sc_k
					is_star_class = sc_m
					is_star_class = sc_m_giant
					is_star_class = sc_t
					is_binary_star = yes
					is_trinary_star = yes
					is_star_class = sc_black_hole
				}
			}
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_physics_research_add = @waystation_sacred_site_add_2
		mult = value:starbase_observatory_physics_output_mult
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
			star? = {
				OR = {
					is_star_class = sc_pulsar
					is_star_class = sc_binary_1
					is_star_class = sc_crisis_binary_1
					is_star_class = sc_neutron_star
					is_star_class = sc_binary_2
					is_star_class = sc_crisis_binary_2
					is_star_class = sc_black_hole
				}
			}
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_engineering_research_add = @waystation_sacred_site_add_2
		mult = value:starbase_observatory_engineering_output_mult
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
			star? = {
				is_star_class = sc_toxoid_star
			}
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_exotic_gases_add = @waystation_sacred_site_add_2
		starbase_collected_system_volatile_motes_add = @waystation_sacred_site_add_2
		mult = value:starbase_observatory_toxic_star_output_mult
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
			star? = {
				is_star_class = sc_rift_star
			}
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_astral_threads_add = @waystation_sacred_site_add_2
		mult = value:starbase_observatory_astral_star_output_mult
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
			owner? = {
				has_technology = tech_mine_dark_matter
			}
			star? = {
				is_star_class = sc_black_hole
			}
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_sr_dark_matter_add = @waystation_sacred_site_add_2
		mult = value:starbase_observatory_dark_matter_output_mult
	}

	# Network Modifiers
	triggered_waystation_network_system_modifier = {
		potential = {
			star? = {
				OR = {
					is_star_class = sc_b
					is_star_class = sc_a
					is_star_class = sc_f
					is_star_class = sc_g
					is_star_class = sc_k
					is_star_class = sc_m
					is_star_class = sc_m_giant
					is_star_class = sc_t
					is_binary_star = yes
					is_trinary_star = yes
					is_star_class = sc_black_hole
				}
			}
		}
		station_researchers_physics_research_produces_mult = @waystation_modifier_mult_5_percent
	}

	triggered_waystation_network_system_modifier = {
		potential = {
			star? = {
					OR = {
					is_star_class = sc_pulsar
					is_star_class = sc_binary_1
					is_star_class = sc_crisis_binary_1
					is_star_class = sc_neutron_star
					is_star_class = sc_binary_2
					is_star_class = sc_crisis_binary_2
					is_star_class = sc_black_hole
				}
			}
		}
		station_researchers_engineering_research_produces_mult = @waystation_modifier_mult_5_percent
	}

	show_in_tech = "tech_sensors_3"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_dimensional_shrine = {
	icon = "GFX_spaceport_module_dimensional_shrine"
	section = "SCIENCE_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_economy_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		owner? = {
			is_dimensional_worship_empire = yes
		}
		is_waystation_starbase = yes
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_dimensional_space_object"
			solar_system? = {
				OR = {
					has_natural_wormhole = yes
					has_astral_rift = yes
					has_star_flag = lgate
					has_star_flag = lcluster_lgate
					has_star_flag = spawned_shroud_tunnel
					has_star_flag = shroudwalker_enclave_system
					any_system_planet = {
						is_astral_scar = yes
					}
				}
			}
		}
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	station_modifier = {
		starbase_collected_system_unity_add = @dimensional_shrine_unity_production
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_unity_add = @waystation_joyous_path_add_10
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_unity_add = @waystation_middle_path_add_5
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_unity_add = @waystation_sacred_site_add_10
	}

	show_in_tech = "tech_sensors_3"

	show_tech_unlock_if = {
		is_nomadic = yes
		is_dimensional_worship_empire = yes
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_recruitment_office = {
	icon = "GFX_starbase_recruitment_office"
	section = "ANCHORAGE_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	category = sm_utility_cat

	empire_limit = 1

	potential = {
		is_waystation_starbase = yes
		owner? = {
			has_technology = "tech_xeno_linguistics"
			is_homicidal = no
		}
	}

	country_modifier = {
		custom_tooltip = sm_recruitment_office_tooltip
		external_leader_pool_add = @waystation_module_leader_pool_1
		species_leader_exp_gain = @waystation_modifier_mult_10_percent
	}

	waystation_network_country_modifier = {
		leaders_cost_mult = @waystation_modifier_negative_mult_5_percent
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_50
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	show_in_tech = "tech_xeno_linguistics"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_aura_emitter = {
	icon = "GFX_starbase_aura_emitter"
	section = "SCIENCE_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	category = sm_utility_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		has_shroud_dlc = yes
		owner? = {
			has_technology = tech_aura_resonation
		}
		is_waystation_starbase = yes
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_500
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
			sr_zro = @waystation_upkeep_zro_1
		}
	}

	on_finished = {
		solar_system = {
			set_star_flag = waystation_aura_emitting@root.owner
			if = {
				limit = {
					is_psionic_aura_suppressed = no
				}
				natural_spawn_psionic_aura = {
					OWNER = root.owner
				}
			}
		}
	}

	on_destroyed = {
		solar_system = {
			remove_star_flag = waystation_aura_emitting@root.owner
		}
	}

	waystation_network_country_modifier = {
		envoy_attunement_mult = @waystation_modifier_mult_5_percent
	}

	custom_tooltip = sm_waystation_aura_emitter_tt
	# Also see \game\common\patrons\psionic_auras\00_auras.txt and
	# common\inline_scripts\shroud\psionic_aura_definition.txt for calculations.
	# This deliberately uses @psionic_offices_intensity instead of
	# @aura_emitter_intensity as the Waystation Auras should be weaker.

	show_in_tech = "tech_aura_resonation"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

# Enclave Modules

waystation_art_college = {
	icon = "GFX_starbase_artist_college"
	section = "SCIENCE_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_enclave_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		owner? = {
			is_homicidal = no
			has_country_flag = enclave_artist_encountered
		}
		is_waystation_starbase = yes
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_artisans"
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						is_same_value = event_target:artist_enclave_country
					}
				}
			}
		}
		custom_tooltip = {
			fail_text = "requires_artist_agreement"
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						is_same_value = event_target:artist_enclave_country
						has_country_flag = art_college@root.owner
					}
				}
			}
		}
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	station_modifier = {
		starbase_collected_system_unity_add = @waystation_module_resource_add_10
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				is_galactic_community_member = yes
			}
			OR = {
				is_active_resolution = "resolution_galacticstudies_advanced_xenostudies"
				is_active_resolution = "resolution_galacticstudies_ethical_guideline_refactoring"
				is_active_resolution = "resolution_galacticstudies_extradimensional_experimentation"
			}
		}
		starbase_collected_system_unity_add = @waystation_module_resource_add_10
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_unity_add = @waystation_joyous_path_add_10
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_unity_add = @waystation_middle_path_add_5
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_unity_add = @waystation_sacred_site_add_10
	}

	waystation_network_country_modifier = {
		custom_tooltip = wayline_enclave_effects_tt
		show_only_custom_tooltip = no
		tradition_cost_mult = @waystation_modifier_negative_mult_5_percent
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_curator_think_tank = {
	icon = "GFX_starbase_curator_think_tank"
	section = "SCIENCE_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_enclave_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		owner? = {
			is_homicidal = no
			has_country_flag = curator_intro
		}
		is_waystation_starbase = yes
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_curator"
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = curator_enclave_country
					}
				}
			}
		}
		custom_tooltip = {
			fail_text = "requires_curator_agreement"
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = curator_enclave_country
						has_country_flag = think_tank@root.owner
					}
				}
			}
		}
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	station_modifier = {
		starbase_collected_system_physics_research_add = @waystation_module_resource_add_5
		starbase_collected_system_society_research_add = @waystation_module_resource_add_5
		starbase_collected_system_engineering_research_add = @waystation_module_resource_add_5
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				is_galactic_community_member = yes
			}
			OR = {
				is_active_resolution = "resolution_galacticstudies_advanced_xenostudies"
				is_active_resolution = "resolution_galacticstudies_ethical_guideline_refactoring"
				is_active_resolution = "resolution_galacticstudies_extradimensional_experimentation"
			}
		}
		starbase_collected_system_physics_research_add = @waystation_module_resource_add_5
		starbase_collected_system_society_research_add = @waystation_module_resource_add_5
		starbase_collected_system_engineering_research_add = @waystation_module_resource_add_5
	}

	waystation_network_country_modifier = {
		custom_tooltip = wayline_enclave_effects_tt
		show_only_custom_tooltip = no
		rare_tech_research_speed_mult = @waystation_modifier_mult_5_percent
		rare_tech_draw_chance_mult = @waystation_modifier_mult_5_percent
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_physics_research_add = @waystation_joyous_path_add_10
		starbase_collected_system_society_research_add = @waystation_joyous_path_add_10
		starbase_collected_system_engineering_research_add = @waystation_joyous_path_add_10
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_physics_research_add = @waystation_middle_path_add_5
		starbase_collected_system_society_research_add = @waystation_middle_path_add_5
		starbase_collected_system_engineering_research_add = @waystation_middle_path_add_5
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_physics_research_add = @waystation_sacred_site_add_10
		starbase_collected_system_society_research_add = @waystation_sacred_site_add_10
		starbase_collected_system_engineering_research_add = @waystation_sacred_site_add_10
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_trader_proxy_office = {
	icon = "GFX_starbase_offworld_trading_company"
	section = "ANCHORAGE_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_enclave_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		owner? = {
			is_homicidal = no
			is_gestalt = no
			has_country_flag = has_market_access
		}
		is_waystation_starbase = yes
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_trader_enclave"
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = trader_enclave_country
					}
				}
			}
		}
	}

	collected_system_resources = {
		trade = {
			owner? = {
				is_galactic_community_member = yes
			}
			OR = {
				is_active_resolution = "resolution_galacticstudies_advanced_xenostudies"
				is_active_resolution = "resolution_galacticstudies_ethical_guideline_refactoring"
				is_active_resolution = "resolution_galacticstudies_extradimensional_experimentation"
			}
		}
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	country_modifier = {
		country_trade_fee = @waystation_modifier_negative_mult_5_percent
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				is_galactic_community_member = yes
			}
			OR = {
				is_active_resolution = "resolution_galacticstudies_advanced_xenostudies"
				is_active_resolution = "resolution_galacticstudies_ethical_guideline_refactoring"
				is_active_resolution = "resolution_galacticstudies_extradimensional_experimentation"
			}
		}
		starbase_collected_system_trade_add = @waystation_module_resource_add_5
	}

	triggered_waystation_network_system_modifier = {
		potential = {
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = trader_enclave_country_1	# XuraCorp
					}
				}
			}
		}
		custom_tooltip = wayline_enclave_effects_tt
		show_only_custom_tooltip = no
		starbase_collected_system_exotic_gases_mult = @waystation_modifier_mult_5_percent
		planet_jobs_exotic_gases_produces_mult = @waystation_modifier_mult_10_percent
	}

	triggered_waystation_network_system_modifier = {
		potential = {
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = trader_enclave_country_2	# Riggan Commerce Exchange
					}
				}
			}
		}
		custom_tooltip = wayline_enclave_effects_tt
		show_only_custom_tooltip = no
		starbase_collected_system_volatile_motes_mult = @waystation_modifier_mult_5_percent
		planet_jobs_volatile_motes_produces_mult = @waystation_modifier_mult_10_percent
	}

	triggered_waystation_network_system_modifier = {
		potential = {
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = trader_enclave_country_3	# Muutagan Merchant Guild
					}
				}
			}
		}
		custom_tooltip = wayline_enclave_effects_tt
		show_only_custom_tooltip = no
		starbase_collected_system_rare_crystals_mult = @waystation_modifier_mult_5_percent
		planet_jobs_rare_crystals_produces_mult = @waystation_modifier_mult_10_percent
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = trader_enclave_country_1	# XuraCorp
					}
				}
			}
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_exotic_gases_add = @waystation_joyous_path_add_3
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = trader_enclave_country_2	# Riggan Commerce Exchange
					}
				}
			}
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_volatile_motes_add = @waystation_joyous_path_add_3
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = trader_enclave_country_3	# Muutagan Merchant Guild
					}
				}
			}
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_rare_crystals_add = @waystation_joyous_path_add_3
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			has_neighboring_waystation = yes
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = trader_enclave_country_3	# Muutagan Merchant Guild
					}
				}
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_rare_crystals_add = @waystation_middle_path_add_1
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
			has_neighboring_waystation = yes
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = trader_enclave_country_3	# Muutagan Merchant Guild
					}
				}
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_rare_crystals_add = @waystation_sacred_site_add_2
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			has_neighboring_waystation = yes
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = trader_enclave_country_1	# XuraCorp
					}
				}
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_exotic_gases_add = @waystation_middle_path_add_1
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
			has_neighboring_waystation = yes
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = trader_enclave_country_1	# XuraCorp
					}
				}
			}
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_exotic_gases_add = @waystation_sacred_site_add_2
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			has_neighboring_waystation = yes
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = trader_enclave_country_2	# Riggan Commerce Exchange
					}
				}
			}
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_volatile_motes_add = @waystation_middle_path_add_1
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
			has_neighboring_waystation = yes
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = trader_enclave_country_2	# Riggan Commerce Exchange
					}
				}
			}
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_volatile_motes_add = @waystation_sacred_site_add_2
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
		modifier = {
			factor = 0
			OR = {
				solar_system = {
					NOT = {
						has_star_flag = guardians_traders_system
					}
				}
				has_starbase_building = trader_proxy_office
				solar_system = {
					any_fleet_in_system = {
						has_fleet_flag = trader_enclave_station
					}
				}
			}
		}
	}
}

waystation_salvager_workshop = {
	icon = "GFX_starbase_salvager_workshop"
	section = "SHIPYARD_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_enclave_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		owner? = {
			is_homicidal = no
			has_country_flag = salvager_enclave_diplomacy_engaged
		}
		is_waystation_starbase = yes
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_salvager_enclave"
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = salvager_enclave_country
					}
				}
			}
		}
		custom_tooltip = {
			fail_text = "requires_salvager_agreement"
			solar_system = {
				has_star_flag = enclave
				any_fleet_in_system = {
					owner? = {
						has_country_flag = salvager_enclave_country
						has_country_flag = salvage_works@root.owner
					}
				}
			}
		}
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				is_galactic_community_member = yes
			}
			OR = {
				is_active_resolution = "resolution_galacticstudies_advanced_xenostudies"
				is_active_resolution = "resolution_galacticstudies_ethical_guideline_refactoring"
				is_active_resolution = "resolution_galacticstudies_extradimensional_experimentation"
			}
		}
		starbase_collected_system_alloys_add = @waystation_module_resource_add_5
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_joyous_enlightenment
			}
			has_neighboring_waystation = yes
		}
		custom_tooltip = blessings_joyous_enlightenment_tt
		show_only_custom_tooltip = no
		starbase_collected_system_alloys_add = @waystation_joyous_path_add_10
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = no
		}
		custom_tooltip = bonus_middle_path_tt
		show_only_custom_tooltip = no
		starbase_collected_system_alloys_add = @waystation_middle_path_add_5
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_middle_path
			}
			is_sacred_site_waystation = yes
		}
		custom_tooltip = bonus_sacred_site_tt
		show_only_custom_tooltip = no
		starbase_collected_system_alloys_add = @waystation_sacred_site_add_10
	}

	waystation_network_system_modifier = {
		custom_tooltip = wayline_enclave_effects_tt
		show_only_custom_tooltip = no
		starbase_shipyard_build_speed_mult = @waystation_modifier_mult_5_percent
		ship_repair_hull_mult = @waystation_modifier_mult_5_percent
		ship_repair_armor_mult = @waystation_modifier_mult_5_percent
	}

	orbit_modifier = {
		ship_orbit_upkeep_mult = @waystation_modifier_negative_mult_20_percent
		ship_repair_hull_mult = @waystation_modifier_mult_20_percent
		ship_repair_armor_mult = @waystation_modifier_mult_20_percent
	}

	ai_weight = {
		weight = 150
	}
}

# Precursor Modules

waystation_cybrex_mining_hub = {
	icon = "GFX_starbase_cybrex_mining_hub"
	section = "ASSEMBLYYARD_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_economy_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		owner? = {
			has_technology = tech_secrets_cybrex
		}
		is_waystation_starbase = yes
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
			minor_artifacts = @minor_artifacts_cost_l
		}

		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	station_modifier = {
		starbase_collected_system_resources_mult = @waystation_modifier_mult_100_percent
	}


	triggered_waystation_network_system_modifier = {
		potential = {
			owner? = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		station_gatherers_produces_mult = @waystation_modifier_mult_25_percent
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}

	show_in_tech = "tech_secrets_cybrex"

	show_tech_unlock_if = {
		is_nomadic = yes
	}
}

waystation_yuht_detection_array = {
	icon = "GFX_starbase_yuht_detection_array"
	section = "SCIENCE_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_utility_cat

	starbase_limit = {
		base = 1
	}

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

	resources = {
		category = starbase_buildings
		cost = {
			alloys = @waystation_cost_alloys_100
			minor_artifacts = @minor_artifacts_cost_xl
		}

		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				NOT = {
					has_ascension_perk = ap_archaeoengineers
				}
			}
		}
		ship_sensor_range_add = @waystation_module_sensor_range_7
		ship_hyperlane_range_add = @waystation_module_hyperlane_range_14
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_ascension_perk = ap_archaeoengineers
			}
		}
		ship_sensor_range_add = @waystation_module_sensor_range_10
		ship_hyperlane_range_add = @waystation_module_hyperlane_range_20
	}

	custom_tooltip = sm_yuht_detection_array_desc_modifier

	show_in_tech = "tech_secrets_yuht"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_hyperlane_detailer = {
	icon = GFX_starbase_hyperlane_detailer
	section = "SCIENCE_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_utility_cat

	starbase_limit = {
		base = 1
	}

	triggered_system_modifier = {
		potential = {
			always = yes
		}
		ship_speed_mult = @waystation_modifier_mult_10_percent
		mult = value:hyperlane_detailer_modifier_mult
	}

	potential = {
		owner? = {
			has_country_flag = unlocked_hyperlane_detailer
		}
		is_waystation_starbase = yes
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_150
			minor_artifacts = @waystation_cost_minor_artifacts_45
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

# Pirate Modules

waystation_pirate_hideout = {
	icon = "GFX_waystation_pirate_hideout"
	section = "HANGAR_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_piracy_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_waystation_starbase = yes
		exists = owner
		can_build_pirate_waystation_module = yes
	}

	possible = {
		custom_tooltip = {
			fail_text = requires_colony_no
			success_text = requires_colony
			solar_system? = {
				any_system_planet = {
					is_colony = yes
				}
			}
		}
	}

	collected_colony_resources = {
		collection_type = steal
		all = {
			NOT = {
				from.owner = {
					is_same_value = root.owner
				}
			}
		}
	}

	station_modifier = {
		starbase_stockpile_capacity_add = @waystation_stockpile_1000
		starbase_collected_colony_resources_add = 0.015
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				any_owned_fleet = {
					is_waystation_ship = yes
					starbase? = {
						has_starbase_module = waystation_reaver_stronghold
					}
				}
			}
		}
		custom_tooltip = waystation_pirate_hideout_reaver_stronghold_tt
		show_only_custom_tooltip = no
		starbase_collected_colony_resources_add = 0.015
	}

	on_finished = {
		#fire recurring monthly opinion event on system
		if = {
			limit = {
				NOT = {
					has_starbase_flag = piracy_collected
				}
			}
			starbase_event = {
				id = nomads.5010
				days = 30
			}
		}
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_150
		}
		upkeep = {
			trade = @waystation_upkeep_trade_8
		}
	}

	custom_tooltip = waystation_pirate_hideout_tt

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_concealment_field = {
	icon = "GFX_waystation_concealment_field"
	section = "CLOAKING_WAYSTATION_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_piracy_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_waystation_starbase = yes
		owner? = {
			has_cloaking_tech = yes
		}
		can_build_pirate_waystation_module = yes
	}

	show_in_tech = "tech_cloaking_1"

	show_tech_unlock_if = {
		is_nomadic = yes
		can_build_defensive_waystation_module = yes
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_150
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	station_modifier = {
		ship_hull_mult = @waystation_modifier_mult_20_percent
	}

	triggered_station_modifier = {
		potential = {
			has_first_contact_dlc = yes
		}
		ship_cloaking_strength_add = @waystation_module_cloaking_strength_1
	}

	component_set = waystation_cloaking_components
	custom_tooltip = sm_waystation_cloaking_tt

	on_finished = {
		fleet = {
			fleet_event = {
				id = fircon.28
				days = 1
			}
		}
	}

	on_destroyed = {
		fleet = {
			set_cloaking_active = no
		}
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_reaver_stronghold = {
	icon = "GFX_waystation_reaver_stronghold"
	section = "HANGAR_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_piracy_cat

	empire_limit = {
		base = 1
	}

	potential = {
		is_waystation_starbase = yes
		exists = owner
		can_build_pirate_waystation_module = yes
	}

	station_modifier = {
		ship_hull_mult = @waystation_modifier_mult_25_percent
		ship_fire_rate_mult = @waystation_modifier_mult_25_percent
		ship_damage_reduction_mult = @waystation_module_damage_reduction_30_percent
	}

	triggered_station_modifier = {
		potential = {
			has_first_contact_dlc = yes
		}
		ship_cloaking_strength_add = @waystation_module_cloaking_strength_negative_6
	}

	triggered_station_modifier = {
		potential = {
			owner? = {
				has_country_flag = sacred_path_embrace_chaos
			}
		}
		custom_tooltip = embrace_chaos_waystations_tt
		ship_hull_mult = @waystation_modifier_mult_50_percent
		ship_fire_rate_mult = @waystation_modifier_mult_50_percent
		ship_damage_reduction_mult = @waystation_module_damage_reduction_90_percent
	}

	triggered_station_modifier = {
		potential = {
			has_first_contact_dlc = yes
			owner? = {
				has_country_flag = sacred_path_embrace_chaos
			}
		}
		ship_cloaking_strength_add = @waystation_module_cloaking_strength_negative_6
	}

	custom_tooltip_with_modifiers = waystation_reaver_stronghold_tt

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_1500
		}
		upkeep = {
			trade = @waystation_upkeep_trade_50
		}
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

# Cloaking Module

waystation_cloaking = {
	icon = "GFX_waystation_concealment_field"
	section = "CLOAKING_WAYSTATION_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_utility_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		is_waystation_starbase = yes
		owner? = {
			has_technology = tech_cloaking_1
		}
		can_build_defensive_waystation_module = no
	}

	show_in_tech = "tech_cloaking_1"

	show_tech_unlock_if = {
		is_nomadic = yes
		can_build_defensive_waystation_module = no
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_50
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	component_set = waystation_cloaking_components
	custom_tooltip = sm_waystation_cloaking_tt

	on_finished = {
		fleet = {
			fleet_event = {
				id = fircon.28
				days = 1
			}
		}
	}

	on_destroyed = {
		fleet = {
			set_cloaking_active = no
		}
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

##Nanite Ascension

waystation_nanotech_module = {
	icon = "GFX_waystation_nanotech_module"
	section = "SCIENCE_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_economy_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		owner? = {
			has_tradition = tr_nanotech_adopt
		}
		is_waystation_starbase = yes
	}

	possible = {
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_500
		}
		upkeep = {
			trade = @waystation_upkeep_trade_4
			mult = value:nanotech_harvester_deposit_num
		}
	}

	collected_system_resources = {
		nanites = {
			always = yes
		}
	}

	station_modifier = {
		custom_tooltip = allows_nanites_collection
		show_only_custom_tooltip = no
		starbase_stockpile_nanites_capacity_add = @waystation_stockpile_500
	}

	triggered_system_modifier = {
		potential = {
			exists = owner
			space_owner? = {
				NOT = {
					benefits_from_waystation_network = {
						NOMAD = root.owner
						SYSTEM_OWNER = this
					}
				}
			}
		}
		custom_tooltip = waystation_collection_penalty_nanites_tt
		show_only_custom_tooltip = yes
		station_gatherers_nanites_produces_mult = @waystation_modifier_negative_mult_25_percent
	}


	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}

	on_finished = {
		solar_system = {
			system_event = {
				id = cybernetics.5050
			}
		}
	}
	on_destroyed = {
		solar_system = {
			system_event = {
				id = cybernetics.5051
			}
		}
	}
	custom_tooltip_with_modifiers = nanite_harvester_tooltip
}

waystation_pyroclastic_resonator = {
	icon = GFX_starbase_pyroclastic_resonator
	section = "REFINERY_STARBASE_SECTION"
	starbase_type = waystation
	category = sm_economy_cat
	construction_days = @waystation_build_time_180

	potential = {
		has_shroud_dlc = yes
		owner? = {
			has_technology = tech_pyroclastic_resonation
		}
		is_waystation_starbase = yes
	}

	resources = {
		category = starbase_buildings
		cost = {
			alloys = @waystation_cost_alloys_100
		}
		upkeep = {
			exotic_gases = @waystation_upkeep_exotic_gases_1
		}
	}

	station_modifier = {
		starbase_collected_system_energy_add = @waystation_module_resource_add_10
	}

	triggered_station_modifier = {
		starbase_collected_system_energy_add = @waystation_module_resource_add_5
		mult = value:num_planet_of_class_in_system|CLASS|pc_molten|
	}

	show_in_tech = "tech_pyroclastic_resonation"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_zroni_storm_caster = {
	icon = GFX_starbase_zroni_storm_caster
	section = "SCIENCE_STARBASE_SECTION"
	starbase_type = waystation
	category = sm_defense_cat
	construction_days = @waystation_build_time_180

	potential = {
		owner? = {
			has_technology = tech_secrets_zroni
		}
		is_waystation_starbase = yes
	}

	resources = {
		category = starbase_buildings
		cost = {
			alloys = @waystation_cost_alloys_100
			minor_artifacts = @minor_artifacts_cost_xl
			sr_zro = @waystation_cost_zro_100
		}
		upkeep = {
			energy = @waystation_upkeep_energy_20
			sr_zro = @waystation_upkeep_zro_1
		}
	}

	ai_weight = {
		weight = 50
	}

	on_finished = {
		if = {
			limit = {
				solar_system = {
					NOT = {
						has_modifier = zroni_storm
					}
				}
			}
			solar_system = {
				system_event = {
					id = ancrel.9900
				}
			}
		}
	}

	on_destroyed = {
		solar_system = {
			system_event = {
				id = ancrel.9905
			}
		}
	}

	custom_tooltip = sm_zroni_storm_caster_desc_modifier

	show_in_tech = "tech_secrets_zroni"

	show_tech_unlock_if = {
		is_nomadic = yes
	}
}

waystation_cordyceptic_reanimation_facility = {
	icon = "GFX_waystation_cordyceptic_reanimation_facility"
	section = "SHIPYARD_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_naval_support_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		owner? = {
			has_valid_civic = civic_hive_cordyceptic_drones
		}
		is_waystation_starbase = yes
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_tiyanki_spawning_system"
			star.solar_system = {
				OR = {
					has_star_flag = tiyanki_graveyard_system
					has_star_flag = tiyanki_spawn_system
					has_star_flag = amoeba_home_system
				}
			}
		}
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	custom_tooltip = sm_waystation_cordyceptic_reanimation_facility_desc_modifier

	on_finished = {
		starbase_event = {
			id = necroids.305
			days = 1800
		}
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_growth_chamber = {
	icon = "GFX_spaceport_module_growth_chamber"
	section = "SHIPYARD_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_naval_support_cat

	starbase_limit = {
		base = 1
	}

	potential = {
		owner? = {
			country_uses_bio_ships = yes
			has_technology = tech_growth_chamber_1
		}
		is_waystation_starbase = yes
	}

	orbit_modifier = {
		bioship_growth_progress_add = 2
		ship_orbit_upkeep_mult = 1.00
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			food = @waystation_cost_food_200
			exotic_gases = @waystation_cost_exotic_gases_50
		}
		upkeep = {
			food = @waystation_upkeep_food_10
			exotic_gases = @waystation_upkeep_exotic_gases_2
		}
	}

	show_in_tech = "tech_growth_chamber_1"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

waystation_aetherophasic_anchor = {
	icon = "GFX_spaceport_module_dark_matter_factory"
	section = "SCIENCE_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_utility_cat

	empire_limit = 1

	starbase_limit = {
		base = 1
	}

	potential = {
		is_waystation_starbase = yes
		owner = {
			is_nomadic = yes
			has_ascension_perk = ap_become_the_crisis
			NOT = {
				any_owned_nonprimary_starbase = {
					count_starbase_modules = {
						type = waystation_aetherophasic_anchor
						include_being_constructed = yes
						count > 1
					}
				}
			}
		}
	}

	possible = {
		custom_tooltip = {
			fail_text = requires_no_existing_megastructure
			solar_system = {
				OR = {
					has_no_non_gate_megastructure = yes
					any_system_megastructure = {
						has_megastructure_flag = crisis_sphere_of@root.owner
					}
				}
			}
		}
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
			sr_dark_matter = 500
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	ai_weight = {
		weight = 100
	}
}

# Hyperthermia crisis nomad equivalent of the gravitational_centrifuge starbase building
waystation_gravitational_centrifuge = {
	icon = "GFX_spaceport_gravitational_centrifuge"
	section = "SCIENCE_STARBASE_SECTION"
	construction_days = @waystation_build_time_180
	starbase_type = waystation
	category = sm_utility_cat

	potential = {
		is_waystation_starbase = yes
		owner? = {
			is_nomadic = yes
			has_crisis_level = crisis_hyperthermia_level_1
		}
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_multiple_stars_or_or_bh"
			star = {
				OR = {
					is_star_class = sc_black_hole
					is_binary_star = yes
					is_trinary_star = yes
				}
			}
		}
	}

	resources = {
		category = starbase_waystations_modules
		cost = {
			alloys = @waystation_cost_alloys_100
		}
		upkeep = {
			trade = @waystation_upkeep_trade_2
		}
	}

	custom_tooltip = "gravitational_centrifuge_tt"

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
	}
}

# Waystation Voidlures - reuse the grand_archive.7000-7004 spawn events (trigger covers both building and module).
#Tiyanki Voidlure
inline_script = {
	script = grand_archive/waystation_voidlure
	CATEGORY = tiyanki
	SPAWN_EVENT_ID = grand_archive.7000
}
#Amoeba Voidlure
inline_script = {
	script = grand_archive/waystation_voidlure
	CATEGORY = space_amoeba
	SPAWN_EVENT_ID = grand_archive.7001
}
#Crystal Voidlure
inline_script = {
	script = grand_archive/waystation_voidlure
	CATEGORY = crystalline_entity
	SPAWN_EVENT_ID = grand_archive.7002
}
#Voidworm Voidlure
inline_script = {
	script = grand_archive/waystation_voidlure
	CATEGORY = voidworm
	SPAWN_EVENT_ID = grand_archive.7003
}
#Cutholoid Voidlure
inline_script = {
	script = grand_archive/waystation_voidlure
	CATEGORY = cutholoid
	SPAWN_EVENT_ID = grand_archive.7004
}
