@missile_speed = 5

weapon_component_template = {
	key = "MISSILE_5"
	size = small

	icon = "GFX_ship_part_missile_5"
	icon_frame = 1
	type = missile

	prerequisites = { "tech_missiles_5" }
	component_set = "MISSILE_5"
	projectile_gfx = "small_missile"
	tags = { weapon_type_explosive g_slot }
	ai_tags = { weapon_role_artillery artillery artillery_stealth energy_torpedoes energy_torpedoes_stealth }
	ai_tag_weight = 0
	upgrades_to = "AVW_MISSILE_6"
	resources = {
		category = ship_components
		cost = {
			alloys = @s_t5_cost
			volatile_motes = @s_t5_rare
		}
		upkeep = {
			energy = @s_t5_upkeep_energy
			alloys = @s_t5_upkeep_alloys
		}
	}

	potential = {
		ship_uses_mauler_components = no
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
	}
}

weapon_component_template = {
	key = "SWARMER_MISSILE_2"
	size = medium

	icon = "GFX_ship_part_swarmer_missile_2"
	icon_frame = 1
	type = missile

	potential = {
		OR = {
			from = {
				country_uses_bio_ships = no
			}
			is_arkship_ship = yes
		}
	}

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_swarmer_missiles_2" }
	component_set = "SWARMER_MISSILE_2"
	projectile_gfx = "swarmer_missiles_02"
	tags = { weapon_type_explosive m_slot }
	ai_tags = { weapon_role_artillery artillery artillery_stealth energy_torpedoes energy_torpedoes_stealth }
	ai_tag_weight = 0
	upgrades_to = "AVW_SWARMER_MISSILE_3"
	resources = {
		category = ship_components
		cost = {
			alloys = @m_t5_cost
			volatile_motes = @m_t5_rare
		}
		upkeep = {
			alloys = @m_t5_upkeep_alloys
		}
		upkeep = {
			trigger = {
				from = {
					country_uses_bio_ships = no
				}
			}
			energy = @m_t5_upkeep_energy
		}
		upkeep = {
			trigger = {
				from = {
					country_uses_bio_ships = yes
				}
			}
			food = @m_t5_upkeep_energy
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
	}
}

weapon_component_template = {
	key = "TORPEDO_3"
	size = torpedo
	entity = "turret_torpedo_entity"

	icon = "GFX_ship_part_torpedo_3"
	icon_frame = 1
	type = missile

	firing_arc = 25.0

	prerequisites = { "tech_torpedoes_3" }
	component_set = "TORPEDO_3"
	projectile_gfx = "large_torpedo_03"
	tags = { weapon_type_explosive g_slot }
	ai_tags = { weapon_role_anti_shield explosive explosive_stealth }
	potential = {
		ship_uses_mauler_components = no
		ship_uses_harbinger_components = no
	}
	upgrades_to = "AVW_TORPEDO_4"
	resources = {
		category = ship_components
		cost = {
			alloys = @m_t5_cost
			volatile_motes = @m_t5_rare
		}
		upkeep = {
			energy = @m_t5_upkeep_energy
			alloys = @m_t5_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
	}
}

weapon_component_template = {
	key = "ENERGY_TORPEDO_2"
	size = torpedo
	type = instant

	firing_arc = 25.0
	min_range = 45.0

	icon = "GFX_ship_part_energy_torpedo_2"
	icon_frame = 1
	prerequisites = { "tech_energy_torpedoes_2" }
	potential = {
		OR = {
			from = {
				country_uses_bio_ships = no
			}
			is_arkship_ship = yes
		}
	}

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}
	component_set = "ENERGY_TORPEDO_2"
	projectile_gfx = "neutron_torpedoes"
	tags = { weapon_type_energy }
	ai_tags = { weapon_role_artillery artillery artillery_stealth energy_torpedoes energy_torpedoes_stealth }
	ai_tag_weight = 0
	upgrades_to = "AVW_ENERGY_TORPEDO_3"
	resources = {
		category = ship_components
		cost = {
			alloys = @l_t6_cost
			exotic_gases = @l_t6_rare
		}
		upkeep = {
			alloys = @l_t6_upkeep_alloys
			energy = @l_t6_upkeep_energy
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = exotic_gases }
		}
		modifier = {
			factor = @cosmic_storm_gravity_ai_weight_factor
			has_country_flag = affected_by_gravity_storm
		}
	}
}
