# Icons set here are the ones show in the actual slot. The reason is so that we can support different icons for different sizes.

#Updated Range on these

# DEFAULT VALUES:
# is_missile = no
# is_beam = no
# is_point_defence = no

# ####################
# Mass Drivers
# ####################

# ## Mass Drivers
weapon_component_template = {
	type = instant

	key = "SMALL_MASS_DRIVER_1"
	size = small

	icon = "GFX_ship_part_mass_driver_1"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_mass_drivers_1" }
	component_set = "MASS_DRIVER_1"
	projectile_gfx = "mass_driver_s"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = "SMALL_MASS_DRIVER_2"
	resources = {
		category = ship_components
		cost = {
			alloys = @s_t1_cost
		}
		upkeep = {
			energy = @s_t1_upkeep_energy
			alloys = @s_t1_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "MEDIUM_MASS_DRIVER_1"
	size = medium

	icon = "GFX_ship_part_mass_driver_1"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_mass_drivers_1"}
	component_set = "MASS_DRIVER_1"
	projectile_gfx = "mass_driver_m"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = "MEDIUM_MASS_DRIVER_2"
	resources = {
		category = ship_components
		cost = {
			alloys = @m_t1_cost
		}
		upkeep = {
			energy = @m_t1_upkeep_energy
			alloys = @m_t1_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "LARGE_MASS_DRIVER_1"
	size = large

	icon = "GFX_ship_part_mass_driver_1"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	min_range = 7.0 #45.0

	prerequisites = { "tech_mass_drivers_1" }
	component_set = "MASS_DRIVER_1"
	projectile_gfx = "mass_driver_l"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = "LARGE_MASS_DRIVER_2"
	resources = {
		category = ship_components
		cost = {
			alloys = @l_t1_cost
		}
		upkeep = {
			energy = @l_t1_upkeep_energy
			alloys = @l_t1_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
		modifier = {
			factor = @cosmic_storm_gravity_ai_weight_factor
			has_country_flag = affected_by_gravity_storm
		}
	}
}

# ## Coilguns
weapon_component_template = {
	type = instant

	key = "SMALL_MASS_DRIVER_2"
	size = small

	icon = "GFX_ship_part_mass_driver_2"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_mass_drivers_2" }
	component_set = "MASS_DRIVER_2"
	projectile_gfx = "coilgun_s"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = "SMALL_MASS_DRIVER_3"
	resources = {
		category = ship_components
		cost = {
			alloys = @s_t2_cost
		}
		upkeep = {
			energy = @s_t2_upkeep_energy
			alloys = @s_t2_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "MEDIUM_MASS_DRIVER_2"
	size = medium

	icon = "GFX_ship_part_mass_driver_2"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_mass_drivers_2" }
	component_set = "MASS_DRIVER_2"
	projectile_gfx = "coilgun_m"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = "MEDIUM_MASS_DRIVER_3"
	resources = {
		category = ship_components
		cost = {
			alloys = @m_t2_cost
		}
		upkeep = {
			energy = @m_t2_upkeep_energy
			alloys = @m_t2_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "LARGE_MASS_DRIVER_2"
	size = large

	icon = "GFX_ship_part_mass_driver_2"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	min_range = 7.0 #45.0

	prerequisites = { "tech_mass_drivers_2" }
	component_set = "MASS_DRIVER_2"
	projectile_gfx = "coilgun_l"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = "LARGE_MASS_DRIVER_3"
	resources = {
		category = ship_components
		cost = {
			alloys = @l_t2_cost
		}
		upkeep = {
			energy = @l_t2_upkeep_energy
			alloys = @l_t2_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
		modifier = {
			factor = @cosmic_storm_gravity_ai_weight_factor
			has_country_flag = affected_by_gravity_storm
		}
	}
}

# ## Railguns
weapon_component_template = {
	type = instant

	key = "SMALL_MASS_DRIVER_3"
	size = small

	icon = "GFX_ship_part_mass_driver_3"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_mass_drivers_3" }
	component_set = "MASS_DRIVER_3"
	projectile_gfx = "railgun_s"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = "SMALL_MASS_DRIVER_4"
	resources = {
		category = ship_components
		cost = {
			alloys = @s_t3_cost
		}
		upkeep = {
			energy = @s_t3_upkeep_energy
			alloys = @s_t3_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "MEDIUM_MASS_DRIVER_3"
	size = medium

	icon = "GFX_ship_part_mass_driver_3"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_mass_drivers_3" }
	component_set = "MASS_DRIVER_3"
	projectile_gfx = "railgun_m"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = "MEDIUM_MASS_DRIVER_4"
	resources = {
		category = ship_components
		cost = {
			alloys = @m_t3_cost
		}
		upkeep = {
			energy = @m_t3_upkeep_energy
			alloys = @m_t3_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "LARGE_MASS_DRIVER_3"
	size = large

	icon = "GFX_ship_part_mass_driver_3"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	min_range = 7.0 #45.0

	prerequisites = { "tech_mass_drivers_3" }
	component_set = "MASS_DRIVER_3"
	projectile_gfx = "railgun_l"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = "LARGE_MASS_DRIVER_4"
	resources = {
		category = ship_components
		cost = {
			alloys = @l_t3_cost
		}
		upkeep = {
			energy = @l_t3_upkeep_energy
			alloys = @l_t3_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
		modifier = {
			factor = @cosmic_storm_gravity_ai_weight_factor
			has_country_flag = affected_by_gravity_storm
		}
	}
}

# ## Advanced Railguns
weapon_component_template = {
	type = instant

	key = "SMALL_MASS_DRIVER_4"
	size = small

	icon = "GFX_ship_part_mass_driver_4"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_mass_drivers_4" }
	component_set = "MASS_DRIVER_4"
	projectile_gfx = "advanced_railgun_s"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = "SMALL_MASS_DRIVER_5"
	resources = {
		category = ship_components
		cost = {
			alloys = @s_t4_cost
			volatile_motes = @s_t4_rare
		}
		upkeep = {
			energy = @s_t4_upkeep_energy
			alloys = @s_t4_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "MEDIUM_MASS_DRIVER_4"
	size = medium

	icon = "GFX_ship_part_mass_driver_4"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_mass_drivers_4" }
	component_set = "MASS_DRIVER_4"
	projectile_gfx = "advanced_railgun_m"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = "MEDIUM_MASS_DRIVER_5"
	resources = {
		category = ship_components
		cost = {
			alloys = @m_t4_cost
			volatile_motes = @m_t4_rare
		}
		upkeep = {
			energy = @m_t4_upkeep_energy
			alloys = @m_t4_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "LARGE_MASS_DRIVER_4"
	size = large

	icon = "GFX_ship_part_mass_driver_4"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	min_range = 7.0 #45.0

	prerequisites = { "tech_mass_drivers_4" }
	component_set = "MASS_DRIVER_4"
	projectile_gfx = "advanced_railgun_l"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = "LARGE_MASS_DRIVER_5"
	resources = {
		category = ship_components
		cost = {
			alloys = @l_t4_cost
			volatile_motes = @l_t4_rare
		}
		upkeep = {
			energy = @l_t4_upkeep_energy
			alloys = @l_t4_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
		modifier = {
			factor = @cosmic_storm_gravity_ai_weight_factor
			has_country_flag = affected_by_gravity_storm
		}
	}
}

# ## Gauss Cannons
weapon_component_template = {
	type = instant

	key = "SMALL_MASS_DRIVER_5"
	size = small

	icon = "GFX_ship_part_mass_driver_5"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_mass_drivers_5" }
	component_set = "MASS_DRIVER_5"
	projectile_gfx = "gauss_cannon_s"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth gunship }
	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
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "MEDIUM_MASS_DRIVER_5"
	size = medium

	icon = "GFX_ship_part_mass_driver_5"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_mass_drivers_5" }
	component_set = "MASS_DRIVER_5"
	projectile_gfx = "gauss_cannon_m"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield gunship}
	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 }
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "LARGE_MASS_DRIVER_5"
	size = large

	icon = "GFX_ship_part_mass_driver_5"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	min_range = 7.0 #45.0

	prerequisites = { "tech_mass_drivers_5" }
	component_set = "MASS_DRIVER_5"
	projectile_gfx = "gauss_cannon_l"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield gunship }
	resources = {
		category = ship_components
		cost = {
			alloys = @l_t5_cost
			volatile_motes = @l_t5_rare
		}
		upkeep = {
			energy = @l_t5_upkeep_energy
			alloys = @l_t5_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
		modifier = {
			factor = @cosmic_storm_gravity_ai_weight_factor
			has_country_flag = affected_by_gravity_storm
		}
	}
}

# ####################
# Kinetic Artillery
# ####################

# ## Kinetic Artillery 1
weapon_component_template = {
	type = instant

	key = "KINETIC_ARTILLERY_1"
	size = large

	icon = "GFX_ship_part_kinetic_artillery_1"
	icon_frame = 1

	min_range = 7.0 #45.0

	prerequisites = { "tech_kinetic_artillery_1" }
	potential = {
		OR = {
			from = {
				country_uses_bio_ships = no
			}
			is_arkship_ship = yes
		}
	}

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}
	component_set = "KINETIC_ARTILLERY_1"
	projectile_gfx = "kinetic_artillery"
	tags = { weapon_type_kinetic l_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery artillery_stealth }
	ai_tag_weight = 0
	upgrades_to = "KINETIC_ARTILLERY_2"
	resources = {
		category = ship_components
		cost = {
			alloys = @l_t5_cost
			volatile_motes = @l_t5_rare
		}
		upkeep = {
			energy = @l_t5_upkeep_energy
			alloys = @l_t5_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
		modifier = {
			factor = @cosmic_storm_gravity_ai_weight_factor
			has_country_flag = affected_by_gravity_storm
		}
	}
}

# ## Kinetic Artillery 2
weapon_component_template = {
	type = instant

	key = "KINETIC_ARTILLERY_2"
	size = large

	icon = "GFX_ship_part_kinetic_artillery_2"
	icon_frame = 1

	min_range = 7.0 #45.0

	prerequisites = { "tech_kinetic_artillery_2" }
	potential = {
		OR = {
			from = {
				country_uses_bio_ships = no
			}
			is_arkship_ship = yes
		}
	}

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}
	component_set = "KINETIC_ARTILLERY_2"
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic l_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery artillery_stealth }
	ai_tag_weight = 0
	resources = {
		category = ship_components
		cost = {
			alloys = @l_t6_cost
			volatile_motes = @l_t6_rare
		}
		upkeep = {
			energy = @l_t6_upkeep_energy
			alloys = @l_t6_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
		modifier = {
			factor = @cosmic_storm_gravity_ai_weight_factor
			has_country_flag = affected_by_gravity_storm
		}
	}
}


# ####################
# Autocannons
# ####################

# ## Autocannons 1
weapon_component_template = {
	type = instant

	key = "SMALL_AUTOCANNON_1"
	size = small

	icon = "GFX_ship_part_autocannon_1"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_autocannons_1" }
	component_set = "AUTOCANNON_1"
	projectile_gfx = "auto_cannons_s"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	upgrades_to = "SMALL_AUTOCANNON_2"
	resources = {
		category = ship_components
		cost = {
			alloys = @s_t3_cost
		}
		upkeep = {
			energy = @s_t3_upkeep_energy
			alloys = @s_t3_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "MEDIUM_AUTOCANNON_1"
	size = medium

	icon = "GFX_ship_part_autocannon_1"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_autocannons_1" }
	component_set = "AUTOCANNON_1"
	projectile_gfx = "auto_cannons_m"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	upgrades_to = "MEDIUM_AUTOCANNON_2"
	resources = {
		category = ship_components
		cost = {
			alloys = @m_t3_cost
		}
		upkeep = {
			energy = @m_t3_upkeep_energy
			alloys = @m_t3_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "LARGE_AUTOCANNON_1"
	size = large

	icon = "GFX_ship_part_autocannon_1"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_autocannons_1" }
	component_set = "AUTOCANNON_1"
	projectile_gfx = "auto_cannons_l"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	upgrades_to = "LARGE_AUTOCANNON_2"
	resources = {
		category = ship_components
		cost = {
			alloys = @l_t3_cost
		}
		upkeep = {
			energy = @l_t3_upkeep_energy
			alloys = @l_t3_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

# ## Autocannons 2
weapon_component_template = {
	type = instant

	key = "SMALL_AUTOCANNON_2"
	size = small

	icon = "GFX_ship_part_autocannon_2"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_autocannons_2" }
	component_set = "AUTOCANNON_2"
	projectile_gfx = "ripper_auto_cannons_s"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	upgrades_to = "SMALL_AUTOCANNON_3"
	resources = {
		category = ship_components
		cost = {
			alloys = @s_t4_cost
			volatile_motes = @s_t4_rare
		}
		upkeep = {
			energy = @s_t4_upkeep_energy
			alloys = @s_t4_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "MEDIUM_AUTOCANNON_2"
	size = medium

	icon = "GFX_ship_part_autocannon_2"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_autocannons_2" }
	component_set = "AUTOCANNON_2"
	projectile_gfx = "ripper_auto_cannons_m"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	upgrades_to = "MEDIUM_AUTOCANNON_3"
	resources = {
		category = ship_components
		cost = {
			alloys = @m_t4_cost
			volatile_motes = @m_t4_rare
		}
		upkeep = {
			energy = @m_t4_upkeep_energy
			alloys = @m_t4_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "LARGE_AUTOCANNON_2"
	size = large

	icon = "GFX_ship_part_autocannon_2"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_autocannons_2" }
	component_set = "AUTOCANNON_2"
	projectile_gfx = "ripper_auto_cannons_l"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	upgrades_to = "LARGE_AUTOCANNON_3"
	resources = {
		category = ship_components
		cost = {
			alloys = @l_t4_cost
			volatile_motes = @l_t4_rare
		}
		upkeep = {
			energy = @l_t4_upkeep_energy
			alloys = @l_t4_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

# ## Autocannons 3
weapon_component_template = {
	type = instant

	key = "SMALL_AUTOCANNON_3"
	size = small

	icon = "GFX_ship_part_autocannon_3"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_autocannons_3" }
	component_set = "AUTOCANNON_3"
	projectile_gfx = "stormfire_auto_cannons_s"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	upgrades_to = "SMALL_AUTOCANNON_4"
	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
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "MEDIUM_AUTOCANNON_3"
	size = medium

	icon = "GFX_ship_part_autocannon_3"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_autocannons_3" }
	component_set = "AUTOCANNON_3"
	projectile_gfx = "stormfire_auto_cannons_m"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	upgrades_to = "MEDIUM_AUTOCANNON_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 }
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

weapon_component_template = {
	type = instant

	key = "LARGE_AUTOCANNON_3"
	size = large

	icon = "GFX_ship_part_autocannon_3"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_autocannons_3" }
	component_set = "AUTOCANNON_3"
	projectile_gfx = "stormfire_auto_cannons_l"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	upgrades_to = "LARGE_AUTOCANNON_4"
	resources = {
		category = ship_components
		cost = {
			alloys = @l_t5_cost
			volatile_motes = @l_t5_rare
		}
		upkeep = {
			energy = @l_t5_upkeep_energy
			alloys = @l_t5_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
	}
}

# ## Autocannons 4
weapon_component_template = {
	type = instant

	key = "SMALL_AUTOCANNON_4"
	size = small

	icon = "GFX_ship_part_autocannon_4"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_nanite_autocannon" }
	component_set = "AUTOCANNON_4"
	projectile_gfx = "stormfire_auto_cannons_s"
	tags = { weapon_type_kinetic }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	resources = {
		category = ship_components
		cost = {
			alloys = @s_t6_cost
			nanites = @s_t6_rare
		}
		upkeep = {
			energy = @s_t6_upkeep_energy
			alloys = @s_t6_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = nanites }
		}
		modifier = {
			factor = 0.0
			is_ai = yes
		}
	}
}

weapon_component_template = {
	type = instant

	key = "MEDIUM_AUTOCANNON_4"
	size = medium

	icon = "GFX_ship_part_autocannon_4"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_nanite_autocannon" }
	component_set = "AUTOCANNON_4"
	projectile_gfx = "stormfire_auto_cannons_m"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	resources = {
		category = ship_components
		cost = {
			alloys = @m_t6_cost
			nanites = @m_t6_rare
		}
		upkeep = {
			energy = @m_t6_upkeep_energy
			alloys = @m_t6_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = nanites }
		}
		modifier = {
			factor = 0.0
			is_ai = yes
		}
	}
}

weapon_component_template = {
	type = instant

	key = "LARGE_AUTOCANNON_4"
	size = large

	icon = "GFX_ship_part_autocannon_4"
	icon_frame = 1

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_nanite_autocannon" }
	component_set = "AUTOCANNON_4"
	projectile_gfx = "stormfire_auto_cannons_l"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	resources = {
		category = ship_components
		cost = {
			alloys = @l_t6_cost
			nanites = @l_t6_rare
		}
		upkeep = {
			energy = @l_t6_upkeep_energy
			alloys = @l_t6_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = nanites }
		}
		modifier = {
			factor = 0.0
			is_ai = yes
		}
	}
}

# ####################
# Reshaping Projectile Accelerator
# ####################

weapon_component_template = {
	type = instant
	key = "LM_ACCELERATOR"
	size = large
	icon = "GFX_ship_part_lm_accelerator"
	icon_frame = 1
	min_range = 7.0 #45.0

	prerequisites = { "tech_kinetic_artillery_2" }
	potential = {
		from = {
			is_galvanic_empire = yes
			country_uses_bio_ships = no
		}
	}

	show_tech_unlock_if = {
		is_galvanic_empire = yes
		country_uses_bio_ships = no
	}

	component_set = "LM_ACCELERATOR_SET"
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic l_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery artillery_stealth }
	ai_tag_weight = 0
	resources = {
		category = ship_components
		cost = {
			sr_living_metal = @l_t6_cost
			volatile_motes = @l_t6_rare
		}
		upkeep = {
			energy = @l_t6_upkeep_energy
			alloys = @l_t6_upkeep_alloys
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = sr_living_metal }
		}
		modifier = {
			factor = @cosmic_storm_shroud_ai_weight_factor
			has_country_flag = affected_by_shroud_storm
		}
		modifier = {
			factor = @cosmic_storm_gravity_ai_weight_factor
			has_country_flag = affected_by_gravity_storm
		}
	}
}