gun_battery_1 = {
	section = "BATTERY_STARBASE_SECTION_1"
	icon = GFX_spaceport_modules_1
	construction_days = 360
	category = sm_defense_cat

	potential = {
		OR = {
			has_starbase_size = starbase_starfortress
			has_starbase_size = starbase_citadel
		}
		is_orbital_ring = no
	}

	resources = {
		category = starbase_modules
		cost = {
			alloys = 200
		}

		upkeep = {
			energy = 5
		}
	}

	station_modifier = {
		ship_hull_mult = 0.10
		ship_armor_mult = 0.10
		starbase_defense_platform_capacity_add = 1
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
		modifier = {
			factor = 2
			exists = owner
			owner = {
				OR = {
					is_preferred_weapons = weapon_type_energy
					is_preferred_weapons = weapon_type_kinetic
				}
			}
		}
	}

	show_in_tech = "tech_mass_drivers_1"

    show_tech_unlock_if = {
        is_nomadic = no
    }
}

gun_battery_2 = {
	section = "BATTERY_STARBASE_SECTION_2"
	icon = GFX_spaceport_modules_2
	construction_days = 540
	category = sm_defense_cat

	potential = {
		OR = {
			has_starbase_size = starbase_1
			has_starbase_size = starbase_2
		}
		is_orbital_ring = no
	}

	resources = {
		category = starbase_modules
		cost = {
			alloys = 300
		}

		upkeep = {
			energy = 7
		}
	}

	station_modifier = {
		ship_hull_mult = 0.10
		ship_armor_mult = 0.10
        starbase_defense_platform_capacity_add = 2
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
		modifier = {
			factor = 2
			exists = owner
			owner = {
				OR = {
					is_preferred_weapons = weapon_type_energy
					is_preferred_weapons = weapon_type_kinetic
				}
			}
		}
	}

	show_in_tech = "tech_mass_drivers_1"

    show_tech_unlock_if = {
        is_nomadic = no
    }
}

gun_battery_3 = {
	section = "BATTERY_STARBASE_SECTION_3"
	icon = GFX_spaceport_modules_3
	construction_days = 720
    category = sm_defense_cat

	potential = {
		has_starbase_size = starbase_3
		is_orbital_ring = no
	}
	resources = {
		category = starbase_modules
		cost = {
			alloys = 500
		}

		upkeep = {
			energy = 10
		}
	}

	station_modifier = {
		ship_hull_mult = 0.20
		ship_armor_mult = 0.20
        starbase_defense_platform_capacity_add = 3
	}

	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
		modifier = {
			factor = 2
			exists = owner
			owner = {
				OR = {
					is_preferred_weapons = weapon_type_energy
					is_preferred_weapons = weapon_type_kinetic
				}
			}
		}
	}

	show_in_tech = "tech_mass_drivers_1"

    show_tech_unlock_if = {
        is_nomadic = no
    }
}

#XL槽
xl_battery_1 = {
	section = "XL_BATTERY_STARBASE_SECTION_1"
	icon = GFX_xl_battery_1
	construction_days = 360
    category = sm_defense_cat

	potential = {
		exists = owner
		owner = {
			OR = {
				has_technology = tech_energy_lance_1
				has_technology = tech_arc_emitter_1
				has_technology = tech_mass_accelerator_1
			}
		}
		OR = {
			has_starbase_size = starbase_1
			has_starbase_size = starbase_2
		}
		count_starbase_modules = {
			count < 6
			type = xl_battery_1
		}
		is_orbital_ring = no
	}
	resources = {
		category = starbase_modules
		cost = {
			alloys = 500
		}

		upkeep = {
			energy = 20
		}
	}

	station_modifier = {
		ship_hull_mult = 0.10
		ship_armor_mult = 0.10
	}
	#	毁灭触发
	destroy_trigger = {
		has_starbase_size = starbase_3
		owner = {
			OR = {
				has_technology = tech_energy_lance_2
				has_technology = tech_arc_emitter_2
				has_technology = tech_mass_accelerator_2
			}
		}
	}

	ai_build_at_chokepoint = yes
	ai_build_outside_chokepoint = no
	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
		modifier = {
			factor = 2
			exists = owner
			owner = {
				OR = {
					is_preferred_weapons = weapon_type_energy
					is_preferred_weapons = weapon_type_kinetic
				}
			}
		}
	}

    show_in_tech = "tech_energy_lance_1"
    show_in_tech = "tech_arc_emitter_1"
    show_in_tech = "tech_mass_accelerator_1"

    show_tech_unlock_if = {
        is_nomadic = no
    }
}

xl_battery_2 = {
	section = "XL_BATTERY_STARBASE_SECTION_2"
	icon = GFX_xl_battery_2
	construction_days = 720
    category = sm_defense_cat

	potential = {
		exists = owner
		owner = {
			OR = {
				has_technology = tech_energy_lance_2
				has_technology = tech_arc_emitter_2
				has_technology = tech_mass_accelerator_2
			}
		}
		has_starbase_size = starbase_3
		count_starbase_modules = {
			count < 6
			type = xl_battery_2
		}
		is_orbital_ring = no
	}
	resources = {
		category = starbase_modules
		cost = {
			alloys = 1000
		}

		upkeep = {
			energy = 40
		}
	}

	station_modifier = {
		ship_hull_mult = 0.20
		ship_armor_mult = 0.20
	}

	ai_build_at_chokepoint = yes
	ai_build_outside_chokepoint = no
	ai_weight = {
		weight = 100 #use same weight here - ai weighting is done in starbase_types.txt
		modifier = {
			factor = 2
			exists = owner
			owner = {
				OR = {
					is_preferred_weapons = weapon_type_energy
					is_preferred_weapons = weapon_type_kinetic
				}
			}
		}
	}

    show_in_tech = "tech_energy_lance_2"
    show_in_tech = "tech_arc_emitter_2"
    show_in_tech = "tech_mass_accelerator_2"

    show_tech_unlock_if = {
        is_nomadic = no
    }
}

hangar_bay_1 = {
	icon = GFX_hangar_bay_1
	#对于section template 中组件效果
	section = "HANGAR_STARBASE_SECTION_1"
	construction_days = 360
	category = sm_defense_cat

	potential = {
		exists = owner
		owner = {
			has_technology = tech_strike_craft_1
		}
		OR = {
			has_starbase_size = starbase_citadel
			has_starbase_size = starbase_starfortress
		}
		is_orbital_ring = no
	}

	resources = {
		category = starbase_modules
		cost = {
			alloys = 200
		}

        produces = {
            trade = 0.25
            mult = value:councilor_level|TYPE|councilor_flight_director|
        }

		upkeep = {
			energy = 5
		}
	}

	station_modifier = {
		ship_hull_mult = 0.10
		ship_armor_mult = 0.10
	}
	ai_build_at_chokepoint = yes
	ai_weight = {
		weight = 10
		modifier = {
			factor = 2
			exists = owner
			owner = { is_preferred_weapons = weapon_type_strike_craft }
		}	
	}

    show_in_tech = "tech_strike_craft_1"

    show_tech_unlock_if = {
        is_nomadic = no
    }
}

hangar_bay_2 = {
	icon = GFX_hangar_bay_2
	#对于section template 中集合效果
	section = "HANGAR_STARBASE_SECTION_2"
	construction_days = 540
    category = sm_defense_cat

	potential = {
		exists = owner
		owner = {
			has_technology = tech_strike_craft_1
		}
		OR = {
			has_starbase_size = starbase_1
			has_starbase_size = starbase_2
		}
		is_orbital_ring = no
	}

	resources = {
		category = starbase_modules
		cost = {
			alloys = 300
		}

        produces = {
            trade = 0.25
            mult = value:councilor_level|TYPE|councilor_flight_director|
        }

		upkeep = {
			energy = 5
		}
	}

	station_modifier = {
		ship_hull_mult = 0.10
		ship_armor_mult = 0.10
	}
	ai_build_at_chokepoint = yes
	ai_weight = {
		weight = 10
		modifier = {
			factor = 2
			exists = owner
			owner = { is_preferred_weapons = weapon_type_strike_craft }
		}	
	}

    show_in_tech = "tech_strike_craft_1"

    show_tech_unlock_if = {
        is_nomadic = no
    }
}

hangar_bay_3 = {
	icon = GFX_hangar_bay_3
	#对于section template 中集合效果
	section = "HANGAR_STARBASE_SECTION_3"
	construction_days = 720
    category = sm_defense_cat

	potential = {
		exists = owner
		owner = {
			has_technology =  tech_strike_craft_1
		}
		has_starbase_size = starbase_3
		is_orbital_ring = no
	}

	resources = {
		category = starbase_modules
		cost = {
			alloys = 500
		}

        produces = {
            trade = 0.25
            mult = value:councilor_level|TYPE|councilor_flight_director|
        }

		upkeep = {
			energy = 8
		}
	}

	station_modifier = {
		ship_hull_mult = 0.20
		ship_armor_mult = 0.20
	}
	ai_build_at_chokepoint = yes
	ai_weight = {
		weight = 10
		modifier = {
			factor = 2
			exists = owner
			owner = { is_preferred_weapons = weapon_type_strike_craft }
		}	
	}

    show_in_tech = "tech_strike_craft_1"

    show_tech_unlock_if = {
        is_nomadic = no
    }
}


#护盾
starbase_shield = {
	icon = GFX_starbase_shield
	section = "ANCHORAGE_STARBASE_SECTION"
	construction_days = 540
    category = sm_defense_cat

	potential = {
		exists = owner 
		owner = {
			has_technology = tech_shields_5
		}
		has_starbase_size >= starbase_1
		is_orbital_ring = no
	}
	resources = {
		category = starbase_modules
		cost = {
			alloys = 1000
		}
		upkeep = {
			energy = 15
		}
	}

	station_modifier = {
		ship_shield_add = 30000
		ship_shield_hardening_add = 0.25
		# 再生为显示数值的1/100
		# 护盾被打破后不再回复，装甲和舰体会一直回复
		# 10%回复的再生舰体 实际在战斗中每日回复0.1%，脱战5倍0.5%
		ship_shield_regen_add_perc = 0.2
	}
	#ai 是否在阻击点建造
	ai_build_at_chokepoint = yes
	#ai 是否在阻击点外建造
	ai_build_outside_chokepoint = yes

	show_in_tech = "tech_shields_5"
}

#装甲
starbase_armor = {
	icon = GFX_starbase_armor
	section = "ANCHORAGE_STARBASE_SECTION"
	construction_days = 540
    category = sm_defense_cat

	potential = {
		exists = owner 
		owner = {
			has_technology = tech_ship_armor_5
		}
		has_starbase_size >= starbase_1
		is_orbital_ring = no
	}
	resources = {
		category = starbase_modules
		cost = {
			alloys = 1000
		}
	}
	station_modifier = {
		ship_armor_add = 30000
		ship_armor_hardening_add = 0.25
		ship_armor_regen_add_perc = 0.2
	}

	show_in_tech = "tech_ship_armor_5"
}
