##### STARBASE EXTENDED 3.0 STARBASE BUILDINGS #####

# VANILLA
crew_quarters = {
	icon = "GFX_spaceport_module_crew_quarters"
	construction_days = 180
	category = sm_naval_support_cat

	initial = yes

	potential = {
		OR = {
			is_normal_starbase = yes
			is_orbital_ring = yes
			is_space_citadel = yes
		}
	}

	resources = {
		category = starbase_buildings
		cost = {
			alloys = 50
		}

		upkeep = {
			energy = 1
		}
	}

	orbit_modifier = {
		ship_orbit_upkeep_mult = -0.25
	}

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

resource_silo = {
	icon = "GFX_spaceport_module_resource_silo"
	construction_days = 180
	category = sm_economy_cat

	potential = {
		OR = {
			is_normal_starbase = yes
			is_orbital_ring = yes
		}
	}

	resources = {
		category = starbase_buildings
		cost = {
			alloys = 50
		}
	}

	triggered_country_modifier = {
		potential = {
			exists = owner
			owner = {
				NOT = { has_technology = tech_construction_templates }
			}
		}
		country_resource_max_add = 5000
	}

	triggered_country_modifier = {
		potential = {
			exists = owner
			owner = {
				has_technology = tech_construction_templates
			}
		}
		country_resource_max_add = 10000
	}

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

offworld_trading_company = {
	icon = "GFX_starbase_offworld_trading_company"
	construction_days = 360
	category = sm_economy_cat

	potential = {
		exists = owner
		owner = {
			has_technology = tech_space_trading
			is_gestalt = no
		}
		is_normal_starbase = yes
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_starport"
			has_starbase_size >= starbase_starport
		}
		OR = {
			has_starbase_module = trading_hub
			starbase_buildable_is_in_queue_before = {
				first = trading_hub
				second = offworld_trading_company
			}
		}
	}

	resources = {
		category = starbase_buildings
		cost = {
			alloys = 100
		}
		upkeep = {
			energy = 1
		}
	}

	custom_tooltip = sm_offworld_trading_company_desc_modifier

	show_in_tech = "tech_space_trading"

	show_tech_unlock_if = {
		is_nomadic = no
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
		modifier = {
			factor = 0
			count_starbase_modules = {
				type = trading_hub
				count < 3
			}
		}
	}
}

target_uplink_computer = {
	icon = "GFX_spaceport_synchronized_defenses"
	construction_days = 360
	category = sm_defense_cat

	potential = {
		exists = owner
		OR = {
			is_normal_starbase = yes
			is_orbital_ring = yes
			is_space_citadel = yes
		}
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_starport_or_ring"
			OR = {
				has_starbase_size >= starbase_starport
				is_orbital_ring = yes
				is_space_citadel = yes
			}
		}
	}

	resources = {
		category = starbase_buildings
		cost = {
			alloys = 100
		}

		upkeep = {
			energy = 2
		}
	}

	station_modifier = {
		ship_weapon_range_mult = 0.50
	}

	defense_platform_modifier = {
		ship_weapon_range_mult = 0.50
	}

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

defense_grid = {
	icon = "GFX_starbase_defense_grid_supercomputer"
	construction_days = 360
	category = sm_defense_cat

	potential = {
		exists = owner
		owner = { has_technology = tech_synchronized_defences }
		OR = {
			is_normal_starbase = yes
			is_orbital_ring = yes
			is_space_citadel = yes
		}
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_starport_or_ring"
			OR = {
				has_starbase_size >= starbase_starport
				is_orbital_ring = yes
				is_space_citadel = yes
			}
		}
	}

	resources = {
		category = starbase_buildings
		cost = {
			alloys = 150
		}

		upkeep = {
			energy = 2
		}
	}

	station_modifier = {
		starbase_defense_platform_capacity_add = 8
	}

	# Shields defense platforms and ion cannons against the Stellar Cannon (see dyson_gun_damage_ship), at the cost of higher upkeep on each protected platform
	defense_platform_modifier = {
		ships_upkeep_mult = 0.33
	}

	show_in_tech = "tech_synchronized_defences"

	show_tech_unlock_if = {
		is_nomadic = no
	}

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

communications_jammer = {
	icon = "GFX_starbase_communication_jammer"
	construction_days = 180
	category = sm_aura_cat

	potential = {
		OR = {
			is_normal_starbase = yes
			is_orbital_ring = yes
		}
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_starport_or_ring"
			OR = {
				has_starbase_size >= starbase_starport
				is_orbital_ring = yes
			}
		}
		solar_system = {
			count_starbase_buildings = {
				type = communications_jammer
				count < 1
				include_being_constructed = yes
			}
		}
	}

	abort_construction_trigger = {
		solar_system = {
			count_starbase_buildings = {
				type = communications_jammer
				count > 1
				include_being_constructed = yes
			}
		}
	}

	resources = {
		category = starbase_buildings
		cost = {
			alloys = 50
		}

		upkeep = {
			energy = 1
		}
	}

	equipped_component = "STARBASE_AURA_COMMUNICATIONS_JAMMER"

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

disruption_field = {
	icon = "GFX_spaceport_module_orbital_mind_control_lazer"
	construction_days = 180
	category = sm_aura_cat

	potential = {
		OR = {
			is_normal_starbase = yes
			is_orbital_ring = yes
		}
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_starport_or_ring"
			OR = {
				has_starbase_size >= starbase_starport
				is_orbital_ring = yes
			}
		}
		solar_system = {
			count_starbase_buildings = {
				type = disruption_field
				count < 1
				include_being_constructed = yes
			}
		}
	}

	abort_construction_trigger = {
		solar_system = {
			count_starbase_buildings = {
				type = disruption_field
				count > 1
				include_being_constructed = yes
			}
		}
	}

	resources = {
		category = starbase_buildings
		cost = {
			alloys = 100
		}

		upkeep = {
			energy = 2
		}
	}

	equipped_component = "STARBASE_AURA_DISRUPTION_FIELD"

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

disruption_field = {
	icon = "GFX_spaceport_module_orbital_mind_control_lazer"
	construction_days = 180
	category = sm_aura_cat

	potential = {
		OR = {
			is_normal_starbase = yes
			is_orbital_ring = yes
		}
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_starport_or_ring"
			OR = {
				has_starbase_size >= starbase_starport
				is_orbital_ring = yes
			}
		}
		solar_system = {
			count_starbase_buildings = {
				type = disruption_field
				count < 1
				include_being_constructed = yes
			}
		}
	}

	abort_construction_trigger = {
		solar_system = {
			count_starbase_buildings = {
				type = disruption_field
				count > 1
				include_being_constructed = yes
			}
		}
	}

	resources = {
		category = starbase_buildings
		cost = {
			alloys = 100
		}

		upkeep = {
			energy = 2
		}
	}

	equipped_component = "STARBASE_AURA_DISRUPTION_FIELD"

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


orbital_reactor = {
	icon = "GFX_orbital_reactor"
	construction_days = 360
	category = sm_economy_cat

	potential = {
		exists = owner
		owner = { has_technology = tech_starbase_6 }
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_starfortress"
			has_starbase_size >= starbase_starfortress
		}
	}

	resources = {
		category = starbase_buildings
		cost = {
			alloys = 400
		}
		produces = {
			energy = 125
		}
	}

	show_in_tech = "tech_starbase_6"

	ai_build_at_chokepoint = yes
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 15
	}
}


##### SBX
adv_space_engineers = {
	icon = "GFX_starbase_adv_space_engineers"
	construction_days = 180	
	category = sm_utility_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 100 }
		upkeep = { energy = 2 }
	}
	station_modifier = { 
		starbase_module_build_speed_mult = 1.50 
		starbase_building_build_speed_mult = 1.50
		starbase_upgrade_speed_mult = 1.50
	}
	ai_build_at_chokepoint = yes
	ai_build_outside_chokepoint = yes
	ai_weight = { weight = 100 }

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

mining_experts = {
	icon = "GFX_starbase_mining_experts"
	construction_days = 220
	category = sm_economy_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 100 }
		produces = { minerals = 4 }
		upkeep = { energy = 2 }
	}
	possible = { has_starbase_module = asteroid_mining }
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = { weight = 1 }

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

reinforced_defenses = {
	icon = "GFX_starbase_reinforced_defenses"
	construction_days = 400
	category = sm_defense_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 150 }
		upkeep = { energy = 1 }
	}
	station_modifier = { 
		ship_shield_add = 6000
		ship_shield_mult = 0.1
		ship_shield_regen_add_perc = 1.0
		ship_armor_add = 10000
		ship_armor_mult = 0.1
		ship_armor_regen_add_perc = 1.0
	}
	potential = { has_starbase_size >= starbase_starport }#not for outposts
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = { weight = 50 modifier = { factor = 0.01 has_starbase_size < starbase_starport } }

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

strategic_defenses = {
	icon = "GFX_starbase_strategic_defenses"
	construction_days = 650
	category = sm_defense_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 150 }
		upkeep = { energy = 1 }
	}
	station_modifier = { 
		ship_shield_add = 6000
		ship_shield_mult = 0.1
		ship_shield_regen_add_perc = 1.0
		ship_fire_rate_mult = 0.25
	}
	potential = { has_starbase_size >= starbase_starfortress }
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = { weight = 50 modifier = { factor = 0.01 has_starbase_size < starbase_starfortress } }
	show_in_tech = "tech_starbase_4"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

adv_starbase = {
	icon = "GFX_starbase_adv_starbase"
	construction_days = 1000
	category = sm_defense_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 200 }
		upkeep = { energy = 2 }
	}
	station_modifier = { 
		ship_armor_add = 16000
		ship_fire_rate_mult = 0.25
		ship_weapon_range_mult = 0.33
	}
	potential = { has_starbase_size >= starbase_citadel }
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = { weight = 50 modifier = { factor = 0.01 has_starbase_size < starbase_citadel } }
	show_in_tech = "tech_starbase_5"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

orbital_physics_support_lab = {
	icon = "GFX_starbase_phy_support"
	construction_days = 300
	category = sm_colony_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 100 }
		produces = { physics_research = 4 }
		upkeep = { energy = 2 }
	}
	possible = { 
		has_starbase_module = orbital_lab 
		NOR = {
			has_starbase_building = orbital_society_support_lab 
			has_starbase_building = orbital_engineering_support_lab 
		}
	}
	
	system_modifier = { 
		planet_jobs_physics_research_produces_mult = 0.10 
		station_researchers_physics_research_produces_mult = 0.50
	}
	
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 50 
		modifier = { factor = 0 NOT = { has_starbase_module = orbital_lab } }
		modifier = { factor = 0 OR = { has_starbase_building = orbital_society_support_lab has_starbase_building = orbital_engineering_support_lab } }
	}

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

orbital_society_support_lab = {
	icon = "GFX_starbase_soc_support"
	construction_days = 300
	category = sm_colony_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 100 }
		produces = { society_research = 4 }
		upkeep = { energy = 2 }
	}
	possible = { 
		has_starbase_module = orbital_lab 
		NOR = {
			has_starbase_building = orbital_physics_support_lab 
			has_starbase_building = orbital_engineering_support_lab 
		}
	}
	system_modifier = { 
		planet_jobs_society_research_produces_mult = 0.10 
		station_researchers_society_research_produces_mult = 0.50
	}
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 50 
		modifier = { factor = 0 NOT = { has_starbase_module = orbital_lab } }
		modifier = { factor = 0 OR = { has_starbase_building = orbital_physics_support_lab has_starbase_building = orbital_engineering_support_lab } }
	}
	
	show_tech_unlock_if = {
		is_nomadic = no
	}

}

orbital_engineering_support_lab = {
	icon = "GFX_starbase_eng_support"
	construction_days = 300
	category = sm_colony_cat
	
	resources ={
		category = starbase_buildings
		cost = { alloys = 100 }
		produces = { engineering_research = 4 }
		upkeep = { energy = 2 }
	}
	possible = { 
		has_starbase_module = orbital_lab 
		NOR = {
			has_starbase_building = orbital_society_support_lab 
			has_starbase_building = orbital_physics_support_lab 
		}
	}
	system_modifier = { 
		planet_jobs_engineering_research_produces_mult = 0.10
		station_researchers_engineering_research_produces_mult = 0.50		
	}
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 50 
		modifier = { factor = 0 NOT = { has_starbase_module = orbital_lab } }
		modifier = { factor = 0 OR = { has_starbase_building = orbital_physics_support_lab has_starbase_building = orbital_society_support_lab } }
	}

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

navy_expert_sector = {
	icon = "GFX_starbase_orbital_engineering"
	construction_days = 500
	category = sm_naval_support_cat
	
	resources ={
		category = starbase_buildings
		cost = { alloys = 250 }
		produces = { engineering_research = 3 }
		upkeep = { energy = 3 }
	}
	station_modifier = {
		starbase_modules_cost_mult = -0.20
		starbase_buildings_cost_mult = -0.20
		starbase_shipyard_build_cost_mult = -0.20
	}
	potential = { 
		has_starbase_size >= starbase_starfortress 
	}
	possible = { has_starbase_building = orbital_engineering_support_lab  }
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { factor = 0.01 has_starbase_size < starbase_starfortress }
	}

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

repair_module = {
	icon = "GFX_starbase_repair_module"
	construction_days = 300
	category = sm_utility_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 50 }
		upkeep = { energy = 1 }
	}
	orbit_modifier = {
		ship_shield_regen_add_perc = 3.0
		ship_hull_regen_add_perc = 2.0
		ship_armor_regen_add_perc = 1.0
	}
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes	
	ai_weight = { weight = 100 }

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

advanced_military_program = {
	icon = "GFX_starbase_security_force"
	construction_days = 550
	category = sm_colony_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 200 }
		produces = { society_research = 6 }
		upkeep = { energy = 1 }
	}
	system_modifier = { 
		planet_army_build_speed_mult = 1.0
		planet_stability_add = 15 
		pop_government_ethic_attraction = 0.25 
	}
	potential = { solar_system = { any_system_planet = { is_owned_by = from } } }
	possible = { has_starbase_building = orbital_society_support_lab }
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 50
		modifier = { factor = 0.01 NAND = { exists = owner owner = { has_technology = tech_interstellar_fleet_traditions } } }
		modifier = { factor = 0.01 NOT = { has_starbase_building = orbital_society_support_lab } }
		modifier = { factor = 0.01 solar_system = { NOT = { any_system_planet = { is_owned_by = from } } } }
	}
	show_in_tech = "tech_interstellar_fleet_traditions"

	show_tech_unlock_if = {
		is_nomadic = no
	}


}

adv_assembly_yard = {
	icon = "GFX_starbase_adv_assembly_yard"
	construction_days = 480
	category = sm_naval_support_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 200 }
		upkeep = { energy = 2 }
	}
	station_modifier = { 
		starbase_shipyard_capacity_add = 2
		starbase_shipyard_build_speed_mult = 0.85
	}
	potential = { 
		has_starbase_module = shipyard 
		has_starbase_size >= starbase_starhold
	}
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = { weight = 50 modifier = { factor = 0.01 NAND = { has_starbase_module = shipyard has_starbase_size >= starbase_starhold } } }

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

ship_disruptor = {
	icon = "GFX_starbase_ship_disruptor"
	construction_days = 240
	category = sm_aura_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 75 }
		upkeep = { energy = 1 }
	}
	equipped_component = "STARBASE_AURA_SHIP_DISRUPTOR"
	ai_build_at_chokepoint = yes
	ai_build_outside_chokepoint = no
	ai_weight = { weight = 15 }

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

ship_amplifier = {
	icon = "GFX_starbase_ship_amplifier"
	construction_days = 240
	category = sm_aura_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 75 }
		upkeep = { energy = 1 }
	}
	equipped_component = "STARBASE_AURA_SHIP_AMPLIFIER"
	ai_build_at_chokepoint = yes
	ai_build_outside_chokepoint = no
	ai_weight = { weight = 15 }

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

experienced_crews = {
	icon = "GFX_starbase_experienced_crew"
	construction_days = 420
	category = sm_naval_support_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 175 }
		upkeep = { energy = 1 }
	}
	ship_modifier = { 
		ship_experience_gain_mult = 1.0
	}
	potential = { exists = owner owner = { has_technology = tech_interstellar_fleet_traditions } }
	possible = { has_starbase_building = fleet_academy }
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = { weight = 50 modifier = { factor = 0.01 NAND = { has_starbase_module = shipyard exists = owner owner = { has_technology = tech_interstellar_fleet_traditions } } } }
	show_in_tech = "tech_interstellar_fleet_traditions"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

navy_veteran = {
	icon = "GFX_starbase_navy_veteran"
	construction_days = 420
	category = sm_naval_support_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 175 }
		upkeep = { energy = 1 }
	}
	ship_modifier = { 
		ship_fire_rate_mult = 0.07
		ship_evasion_mult = 0.20
	}
	potential = { exists = owner owner = { has_technology = tech_interstellar_fleet_traditions } }
	possible = { has_starbase_building = fleet_academy }
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = { weight = 50 modifier = { factor = 0.01 NAND = { has_starbase_module = shipyard exists = owner owner = { has_technology = tech_interstellar_fleet_traditions } } } }
	show_in_tech = "tech_interstellar_fleet_traditions"

show_tech_unlock_if = {
		is_nomadic = no
	}
}

administration_office = {
	icon = "GFX_starbase_administration_office"
	construction_days = 480
	category = sm_colony_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 200 influence = 25 }
		upkeep = { energy = 1 }
	}
	potential = {
		has_starbase_size >= starbase_starfortress
		exists = owner owner = { has_technology = tech_galactic_administration } 
	}
	
	country_modifier = {
		empire_size_systems_mult = -0.01
		empire_size_colonies_mult = -0.01
		country_unity_produces_mult = 0.01
	}
	
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes	
	ai_weight = { weight = 2 }
	show_in_tech = "tech_galactic_administration"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

synthetic_crystal_fabricator = {
	icon = "GFX_starbase_synthetic_crystal_fabricator"
	construction_days = 500
	category = sm_economy_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 200 }
		produces = { rare_crystals = 2 }
		upkeep = { minerals = 10 energy = 2 }
	}
	potential = { 
		has_starbase_size >= starbase_starhold
		exists = owner owner = { has_technology = tech_rare_crystals } 
	}
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { factor = 0.01 has_starbase_size < starbase_starhold }
		modifier = { factor = 0.01 NAND = { exists = owner owner = { has_technology = tech_rare_crystals } } }
	}
	show_in_tech = "tech_rare_crystals"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

synthetic_volatile_motes_fabricator = {
	icon = "GFX_starbase_synthetic_volatile_motes_fabricator"
	construction_days = 500
	category = sm_economy_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 200 }
		produces = { volatile_motes = 2 }
		upkeep = { minerals = 10 energy = 2 }
	}
	potential = { 
		has_starbase_size >= starbase_starhold
		exists = owner owner = { has_technology = tech_volatile_motes } 
	}
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { factor = 0.01 has_starbase_size < starbase_starhold }
		modifier = { factor = 0.01 NAND = { exists = owner owner = { has_technology = tech_volatile_motes } } }
	}
	show_in_tech = "tech_volatile_motes"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

synthetic_gase_fabricator = {
	icon = "GFX_starbase_synthetic_gase_fabricator"
	construction_days = 500
	category = sm_economy_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 200 }
		produces = { exotic_gases = 2 }
		upkeep = { minerals = 10 energy = 2 }
	}
	potential = { 
		has_starbase_size >= starbase_starhold
		exists = owner owner = { has_technology = tech_exotic_gases } 
	}
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { factor = 0.01 has_starbase_size < starbase_starhold }
		modifier = { factor = 0.01 NAND = { exists = owner owner = { has_technology = tech_exotic_gases } } }
	}
	show_in_tech = "tech_exotic_gases"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

orbital_assembly = {
	icon = "GFX_starbase_orbital_assembly"
	construction_days = 720
	category = sm_economy_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 200 }
		upkeep = { minerals = 10 energy = 2 }
	}
	potential = { 
		has_starbase_size >= starbase_starhold
		exists = owner owner = { has_technology = tech_robotic_workers } 
		solar_system = { any_system_planet = { is_owned_by = from } }
		exists = owner owner = { NOT = { has_authority = auth_hive_mind } }
	}
	
	system_modifier = { planet_pop_assembly_mult = 0.2 }

	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { factor = 0.01 has_starbase_size < starbase_starhold }
		modifier = { factor = 0.01 NAND = { exists = owner owner = { has_technology = tech_robotic_workers } } }
		modifier = { factor = 0.01 solar_system = { NOT = { any_system_planet = { is_owned_by = from } } } }
		modifier = { factor = 0.0 exists = owner owner = { has_authority = auth_hive_mind } }
	}
	show_in_tech = "tech_robotic_workers"

	show_tech_unlock_if = {
		is_nomadic = no
	}


}

chain_manufacturing = {
	icon = "GFX_starbase_chain_manufacturing"
	construction_days = 720
	category = sm_colony_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 250 }
		upkeep = { energy = 2 }
	}
	potential = { 
		has_starbase_size >= starbase_starhold
		exists = owner owner = { OR = { has_technology = tech_alloys_2 has_technology = tech_luxuries_2 } }
	}
	system_modifier = { 
		planet_jobs_alloys_produces_mult = 0.15
		planet_jobs_consumer_goods_produces_mult = 0.15
	}
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { factor = 0.01 has_starbase_size < starbase_starhold }
		modifier = { factor = 0.01 NAND = { exists = owner owner = { OR = { has_technology = tech_alloys_2 has_technology = tech_luxuries_2 } } } }
	}

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

construction_planificator = {
	icon = "GFX_starbase_construction_planificator"
	construction_days = 360
	category = sm_colony_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 200 }
		upkeep = { energy = 2 }
	}
	potential = { 
		has_starbase_size >= starbase_starhold
		exists = owner owner = { has_technology = tech_construction_templates }
		solar_system = { any_system_planet = { is_owned_by = from } }
	}
	system_modifier = { 
		planet_building_build_speed_mult = 0.75
		planet_decision_enact_speed_mult = 0.75
	}
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { factor = 0.01 has_starbase_size < starbase_starhold }
		modifier = { factor = 0.01 NAND = { exists = owner owner = { has_technology = tech_construction_templates } } }
		modifier = { factor = 0.01 solar_system = { NOT = { any_system_planet = { is_owned_by = from } } } }
	}
	show_in_tech = "tech_construction_templates"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

financial_space_center = {
	icon = "GFX_starbase_financial_space_center"
	construction_days = 360
	category = sm_economy_cat

	potential = {
		category = starbase_buildings
		has_starbase_size >= starbase_starhold
		exists = owner owner = { is_gestalt = no }
	}

	resources = {
		upkeep = { energy = 1 }
		cost = {
			alloys = 150
		}
		produces = {
			trade = 15
		}
	}

	country_modifier = {
		country_trade_fee = -0.03
	}

	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { factor = 0.01 has_starbase_size < starbase_starhold }
		modifier = { factor = 0.0 exists = owner owner = { is_gestalt = yes } }
	}

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

terraforming_module = {
	icon = "GFX_starbase_terraforming_module"
	construction_days = 360
	category = sm_colony_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 150 }
		upkeep = { energy = 2 }
	}
	potential = { 
		has_starbase_size >= starbase_starhold
		exists = owner owner = { has_technology = tech_colonization_5 }
		solar_system = { any_system_planet = { is_owned_by = from } }
		exists = owner owner = { NOT = { has_authority = auth_machine_intelligence } }
	}
	planet_modifier = { pop_environment_tolerance = 0.10 }
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { factor = 0.01 has_starbase_size < starbase_starhold }
		modifier = { factor = 0.01 NAND = { exists = owner owner = { has_technology = tech_colonization_5 } } }
		modifier = { factor = 0.01 solar_system = { NOT = { any_system_planet = { is_owned_by = from } } } }
		modifier = { factor = 0.0 exists = owner owner = { has_authority = auth_machine_intelligence } }
	}
	show_in_tech = "tech_colonization_5"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

stasis_chambers = {
	icon = "GFX_starbase_stasis_chambers"
	construction_days = 360
	category = sm_colony_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 150 }
		upkeep = { energy = 2 }
	}
	potential = { 
		has_starbase_size >= starbase_starhold
		solar_system = { any_system_planet = { is_owned_by = from } }
		exists = owner 
		owner = { 
			has_technology = tech_genome_mapping 
			OR = {
				is_regular_empire = yes
				is_hive_empire = yes
				AND = {
					is_machine_empire = yes
					OR = {
						has_civic = civic_machine_assimilator
						has_civic = civic_machine_servitor
					}
				}
			}
		}
	}
	
	system_modifier = { logistic_growth_mult = 0.20 }
	
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { factor = 0.01 has_starbase_size < starbase_starhold }
		modifier = { factor = 0.01 NAND = { exists = owner owner = { has_technology = tech_genome_mapping } } }
		modifier = { factor = 0.01 solar_system = { NOT = { any_system_planet = { is_owned_by = from } } } }
	}
	show_in_tech = "tech_genome_mapping"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

emergency_portal = {
	icon = "GFX_starbase_emergency_portal"
	construction_days = 720
	category = sm_naval_support_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 250 }
		upkeep = { energy = 3 }
	}
	potential = { 
		has_starbase_size >= starbase_starhold
	}
	country_modifier = { ship_disengage_chance_mult = 0.05 }
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { factor = 0.01 has_starbase_size < starbase_starhold }
	}

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

starbase_optimal_systems = {
	icon = "GFX_starbase_starbase_optimal_systems"
	construction_days = 720
	category = sm_defense_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 350 }
		upkeep = { energy = 3 }
	}


	station_modifier = {
		ship_tracking_add = 10
		ship_accuracy_add = 15
		ship_sensor_range_add = 2
		starbase_defense_platform_capacity_add = 8

	}

	resources = {
		cost = {
			alloys = 100
		}
		produces = {
			trade = 2
		}
	}

	country_modifier = {
		country_trade_fee = -0.01
	}
	
	potential = { has_starbase_size >= starbase_citadel }
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = { weight = 50 modifier = { factor = 0.01 has_starbase_size < starbase_citadel } }
	show_in_tech = "tech_starbase_5"

	show_tech_unlock_if = {
		is_nomadic = no
	}
}

stellar_housing = {
	icon = "GFX_starbase_stellar_housing"
	construction_days = 360
	category = sm_colony_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 150 }
		upkeep = { energy = 1 }
	}
	potential = { 
		has_starbase_size >= starbase_starhold
		exists = owner owner = { has_technology = tech_housing_2 }
		solar_system = { any_system_planet = { is_owned_by = from } }
	}

	system_modifier = { planet_housing_add = 1000 }

	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { factor = 0.01 has_starbase_size < starbase_starhold }
		modifier = { factor = 0.01 NAND = { exists = owner owner = { has_technology = tech_housing_2 } } }
		modifier = { factor = 0.01 solar_system = { NOT = { any_system_planet = { is_owned_by = from } } } }
	}
	show_in_tech = "tech_housing_2"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

administration_computers = {
	icon = "GFX_starbase_administration_computers"
	construction_days = 500
	category = sm_colony_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 250 }
		upkeep = { energy = 2 }
	}
	potential = { 
		has_starbase_size >= starbase_starhold
		exists = owner owner = { has_technology = tech_colonial_centralization }
		solar_system = { any_system_planet = { is_owned_by = from } }
	}
	system_modifier = { planet_stability_add = 7 }
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { factor = 0.01 has_starbase_size < starbase_starhold }
		modifier = { factor = 0.01 NAND = { exists = owner owner = { has_technology = tech_colonial_centralization } } }
		modifier = { factor = 0.01 solar_system = { NOT = { any_system_planet = { is_owned_by = from } } } }
	}
	show_in_tech = "tech_colonial_centralization"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

market_computers = {
	icon = "GFX_starbase_market_computers"
	construction_days = 360
	category = sm_colony_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 250 }
		upkeep = { energy = 2 }
	}
	potential = { 
		has_starbase_size >= starbase_starhold
		solar_system = { any_system_planet = { is_owned_by = from } }
	}
	system_modifier = { planet_amenities_mult = 0.15 }
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { factor = 0.01 has_starbase_size < starbase_starhold }
		modifier = { factor = 0.01 solar_system = { NOT = { any_system_planet = { is_owned_by = from } } } }
	}

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

research_computers = {
	icon = "GFX_starbase_research_computers"
	construction_days = 500
	category = sm_colony_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 250 }
		upkeep = { energy = 2 }
	}
	potential = { 
		has_starbase_size >= starbase_starhold
		exists = owner owner = { has_technology = tech_basic_science_lab_3 }
		solar_system = { any_system_planet = { is_owned_by = from } }
	}
	system_modifier = { 
		planet_jobs_physics_research_produces_mult = 0.15
		planet_jobs_society_research_produces_mult = 0.15
		planet_jobs_engineering_research_produces_mult = 0.15
	}
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { factor = 0.01 has_starbase_size < starbase_starhold }
		modifier = { factor = 0.01 NAND = { exists = owner owner = { has_technology = tech_basic_science_lab_3 } } }
		modifier = { factor = 0.01 solar_system = { NOT = { any_system_planet = { is_owned_by = from } } } }
	}
	show_in_tech = "tech_basic_science_lab_3"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

corvette_assembly_yard = {
	icon = "GFX_starbase_corvette_assembly_yard"
	construction_days = 1080
	category = sm_naval_support_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 1000 }
		upkeep = { energy = 8 }
	}
	station_modifier = {
		ship_corvette_cost_mult = -0.20
		shipsize_corvette_build_speed_mult = 0.75
	}
	potential = { 
		has_starbase_module = shipyard
		NOR = {
			has_starbase_building = destroyer_assembly_yard
			has_starbase_building = cruiser_assembly_yard
			has_starbase_building = battleship_assembly_yard
		}
	}
	possible = { 
		has_starbase_module = shipyard
		NOR = {
			has_starbase_building = destroyer_assembly_yard
			has_starbase_building = cruiser_assembly_yard
			has_starbase_building = battleship_assembly_yard
		}	
	}	
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100
		modifier = { 
			factor = 0.01 
			OR = {
				has_starbase_building = destroyer_assembly_yard
				has_starbase_building = cruiser_assembly_yard
				has_starbase_building = battleship_assembly_yard
			}
		}
	}

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

destroyer_assembly_yard = {
	icon = "GFX_starbase_destroyer_assembly_yard"
	construction_days = 1080
	category = sm_naval_support_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 1250 }
		upkeep = { energy = 8 }
	}
	station_modifier = {
		ship_destroyer_cost_mult = -0.20
		shipsize_destroyer_build_speed_mult = 0.75
	}
	potential = { 
		has_starbase_module = shipyard
		NOR = {
			has_starbase_building = corvette_assembly_yard
			has_starbase_building = cruiser_assembly_yard
			has_starbase_building = battleship_assembly_yard
		}
		exists = owner owner = { has_technology = tech_destroyer_build_speed }
	}
	possible = { 
		has_starbase_module = shipyard
		NOR = {
			has_starbase_building = corvette_assembly_yard
			has_starbase_building = cruiser_assembly_yard
			has_starbase_building = battleship_assembly_yard
		}	
	}	
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100	
		modifier = { factor = 0.01 NAND = { exists = owner owner = { has_technology = tech_destroyer_build_speed } } }
		modifier = { 
			factor = 0.01 
			OR = {
				has_starbase_building = corvette_assembly_yard
				has_starbase_building = cruiser_assembly_yard
				has_starbase_building = battleship_assembly_yard
			}
		}
	}
	show_in_tech = "tech_destroyer_build_speed"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

cruiser_assembly_yard = {
	icon = "GFX_starbase_cruiser_assembly_yard"
	construction_days = 1080
	category = sm_naval_support_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 1600 }
		upkeep = { energy = 8 }
	}
	station_modifier = {
		ship_cruiser_cost_mult = -0.20
		shipsize_cruiser_build_speed_mult = 0.75
	}
	potential = { 
		has_starbase_module = shipyard
		NOR = {
			has_starbase_building = corvette_assembly_yard
			has_starbase_building = destroyer_assembly_yard
			has_starbase_building = battleship_assembly_yard
		}
		exists = owner owner = { has_technology = tech_cruiser_build_speed }
	}
	possible = { 
		has_starbase_module = shipyard
		NOR = {
			has_starbase_building = corvette_assembly_yard
			has_starbase_building = destroyer_assembly_yard
			has_starbase_building = battleship_assembly_yard
		}	
	}	
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100	
		modifier = { factor = 0.01 NAND = { exists = owner owner = { has_technology = tech_cruiser_build_speed } } }
		modifier = { 
			factor = 0.01 
			OR = {
				has_starbase_building = corvette_assembly_yard
				has_starbase_building = destroyer_assembly_yard
				has_starbase_building = battleship_assembly_yard
			}
		}
	}
	show_in_tech = "tech_cruiser_build_speed"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

battleship_assembly_yard = {
	icon = "GFX_starbase_battleship_assembly_yard"
	construction_days = 1080
	category = sm_naval_support_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 2000 }
		upkeep = { energy = 8 }
	}
	station_modifier = {
		ship_battleship_cost_mult = -0.20
		shipsize_battleship_build_speed_mult = 0.75
	}
	potential = { 
		has_starbase_module = shipyard
		NOR = {
			has_starbase_building = corvette_assembly_yard
			has_starbase_building = destroyer_assembly_yard
			has_starbase_building = cruiser_assembly_yard
		}
		exists = owner owner = { has_technology = tech_battleship_build_speed }
	}
	possible = { 
		has_starbase_module = shipyard
		NOR = {
			has_starbase_building = corvette_assembly_yard
			has_starbase_building = destroyer_assembly_yard
			has_starbase_building = cruiser_assembly_yard
		}	
	}	
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	ai_weight = {
		weight = 100	
		modifier = { factor = 0.01 NAND = { exists = owner owner = { has_technology = tech_battleship_build_speed } } }
		modifier = { 
			factor = 0.01 
			OR = {
				has_starbase_building = corvette_assembly_yard
				has_starbase_building = destroyer_assembly_yard
				has_starbase_building = cruiser_assembly_yard
			}
		}
	}
	show_in_tech = "tech_battleship_build_speed"

	show_tech_unlock_if = {
		is_nomadic = no
	}

}

crew_formation_modules = {
	icon = "GFX_starbase_crew_formation_modules"
	construction_days = 420
	category = sm_naval_support_cat
	
	resources = {
		category = starbase_buildings
		cost = { alloys = 500 influence = 20 }
		upkeep = { energy = 1 }
	}
	country_modifier = { country_starbase_capacity_add = 1 }
	ai_build_at_chokepoint = no
	ai_build_outside_chokepoint = yes
	potential = { has_starbase_size >= starbase_stronghold }
	ai_weight = { weight = 30 modifier = { factor = 0 has_starbase_size < starbase_stronghold } }

	show_tech_unlock_if = {
		is_nomadic = no
	}

}




##### EOF


