############################################################
##                 ESC : Kinetic Weapons                  ##
############################################################

# - Advanced Gauss Cannon				S/M/L
# - Strike Cannon						S/M/L
# - Improved Stromfire Autocannon		S/M/L
# - Shredder Autocannon					S/M/L
# - Improved Kinetic Artillery			L
# - Skypiercer Artillery				L
# - Improved Giga-cannon				X
# - The Grand Cannon					X
# - Relativistic Kinetic Kill Vehicle	Titanic + Juggernaut
# - Hailstorm Autocannon				X
# - Firestorm Autocannon				X
# - Tempest Autocannon					Titanic + Juggernaut
# - Juggernaut Artillery				M (Juggernaut only)
# - Improved Juggernaut Artillery		M (Juggernaut only)
# - Ferromagnetic Liquid Cannon			X
# - Imp. Ferromagnetic Liquid Cannon	X
# - MagnetoHydroDynamic Cannon			Titanic + Juggernaut

############################################################
##                Advanced Gauss Cannon                   ##
############################################################

# small
weapon_component_template = {
	key = SMALL_ESC_MASS_DRIVER_6
	size = small
	icon = GFX_esc_mass_driver_6
	icon_frame = 1
	type = instant

	damage = { min = 18 max = 57 }
	windup = { min = 4 max = 14 }
	total_fire_time = 20
	range = @ESC_WEAPON_RANGE_S_3
	accuracy = 0.75
	power = -20

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mass_driver_hull_damage
	armor_penetration = @ESC_WEAPON_mass_driver_armor_penetration
	armor_damage = @ESC_WEAPON_mass_driver_armor_damage
	shield_penetration = @ESC_WEAPON_mass_driver_shield_penetration
	shield_damage = @ESC_WEAPON_mass_driver_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_mass_driver_6" }
	component_set = ESC_MASS_DRIVER_6
	projectile_gfx = "gauss_cannon_s"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth gunship }
	upgrades_to = SMALL_ESC_MASS_DRIVER_7

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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 = {
	key = SMALL_ESC_BIO_MASS_DRIVER_6
	size = small
	icon = GFX_esc_bio_mass_driver_6
	icon_frame = 1
	type = instant

	damage = { min = 18 max = 57 }
	windup = { min = 4 max = 14 }
	total_fire_time = 20
	range = @ESC_WEAPON_RANGE_S_3
	accuracy = 0.75
	power = -20

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mass_driver_hull_damage
	armor_penetration = @ESC_WEAPON_mass_driver_armor_penetration
	armor_damage = @ESC_WEAPON_mass_driver_armor_damage
	shield_penetration = @ESC_WEAPON_mass_driver_shield_penetration
	shield_damage = @ESC_WEAPON_mass_driver_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_mass_driver_6" }
	component_set = ESC_BIO_MASS_DRIVER_6
	projectile_gfx = "gauss_cannon_s"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth gunship }
	upgrades_to = SMALL_ESC_BIO_MASS_DRIVER_7

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

# medium
weapon_component_template = {
	key = MEDIUM_ESC_MASS_DRIVER_6
	size = medium
	icon = GFX_esc_mass_driver_6
	icon_frame = 1
	type = instant

	damage = { min = 44 max = 148 }
	windup = { min = 5 max = 17 }
	total_fire_time = 25
	range = @ESC_WEAPON_RANGE_M_4
	accuracy = 0.75
	power = -34

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mass_driver_hull_damage
	armor_penetration = @ESC_WEAPON_mass_driver_armor_penetration
	armor_damage = @ESC_WEAPON_mass_driver_armor_damage
	shield_penetration = @ESC_WEAPON_mass_driver_shield_penetration
	shield_damage = @ESC_WEAPON_mass_driver_shield_damage
	tracking = 0.3

	prerequisites = { "esc_tech_mass_driver_6" }
	component_set = ESC_MASS_DRIVER_6
	projectile_gfx = "gauss_cannon_m"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = MEDIUM_ESC_MASS_DRIVER_7

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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 = {
	key = MEDIUM_ESC_BIO_MASS_DRIVER_6
	size = medium
	icon = GFX_esc_bio_mass_driver_6
	icon_frame = 1
	type = instant

	damage = { min = 44 max = 148 }
	windup = { min = 5 max = 17 }
	total_fire_time = 25
	range = @ESC_WEAPON_RANGE_M_4
	accuracy = 0.75
	power = -34

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mass_driver_hull_damage
	armor_penetration = @ESC_WEAPON_mass_driver_armor_penetration
	armor_damage = @ESC_WEAPON_mass_driver_armor_damage
	shield_penetration = @ESC_WEAPON_mass_driver_shield_penetration
	shield_damage = @ESC_WEAPON_mass_driver_shield_damage
	tracking = 0.3

	prerequisites = { "esc_tech_mass_driver_6" }
	component_set = ESC_BIO_MASS_DRIVER_6
	projectile_gfx = "gauss_cannon_m"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield gunship }
	upgrades_to = MEDIUM_ESC_BIO_MASS_DRIVER_7

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

# large
weapon_component_template = {
	key = LARGE_ESC_MASS_DRIVER_6
	size = large
	icon = GFX_esc_mass_driver_6
	icon_frame = 1
	type = instant

	damage = { min = 104 max = 318 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_L_4
	min_range = @ESC_WEAPON_MIN_RANGE_4
	accuracy = 0.75
	power = -64

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mass_driver_hull_damage
	armor_penetration = @ESC_WEAPON_mass_driver_armor_penetration
	armor_damage = @ESC_WEAPON_mass_driver_armor_damage
	shield_penetration = @ESC_WEAPON_mass_driver_shield_penetration
	shield_damage = @ESC_WEAPON_mass_driver_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_mass_driver_6" }
	component_set = ESC_MASS_DRIVER_6
	projectile_gfx = "gauss_cannon_l"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield brawler gunship }
	upgrades_to = LARGE_ESC_MASS_DRIVER_7

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

weapon_component_template = {
	key = LARGE_ESC_BIO_MASS_DRIVER_6
	size = large
	icon = GFX_esc_bio_mass_driver_6
	icon_frame = 1
	type = instant

	damage = { min = 104 max = 318 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_L_4
	min_range = @ESC_WEAPON_MIN_RANGE_4
	accuracy = 0.75
	power = -64

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mass_driver_hull_damage
	armor_penetration = @ESC_WEAPON_mass_driver_armor_penetration
	armor_damage = @ESC_WEAPON_mass_driver_armor_damage
	shield_penetration = @ESC_WEAPON_mass_driver_shield_penetration
	shield_damage = @ESC_WEAPON_mass_driver_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_mass_driver_6" }
	component_set = ESC_BIO_MASS_DRIVER_6
	projectile_gfx = "gauss_cannon_l"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield brawler gunship }
	upgrades_to = LARGE_ESC_BIO_MASS_DRIVER_7

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

############################################################
##                     Strike Cannon                      ##
############################################################

# small
weapon_component_template = {
	key = SMALL_ESC_MASS_DRIVER_7
	size = small
	icon = GFX_esc_mass_driver_7
	icon_frame = 1
	type = instant

	damage = { min = 24 max = 74 }
	windup = { min = 4 max = 14 }
	total_fire_time = 20
	range = @ESC_WEAPON_RANGE_S_3
	accuracy = 0.75
	power = -24

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mass_driver_hull_damage
	armor_penetration = @ESC_WEAPON_mass_driver_armor_penetration
	armor_damage = @ESC_WEAPON_mass_driver_armor_damage
	shield_penetration = @ESC_WEAPON_mass_driver_shield_penetration
	shield_damage = @ESC_WEAPON_mass_driver_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_mass_driver_7" }
	component_set = ESC_MASS_DRIVER_7
	projectile_gfx = "gauss_cannon_s"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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 = {
	key = SMALL_ESC_BIO_MASS_DRIVER_7
	size = small
	icon = GFX_esc_bio_mass_driver_7
	icon_frame = 1
	type = instant

	damage = { min = 24 max = 74 }
	windup = { min = 4 max = 14 }
	total_fire_time = 20
	range = @ESC_WEAPON_RANGE_S_3
	accuracy = 0.75
	power = -24

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mass_driver_hull_damage
	armor_penetration = @ESC_WEAPON_mass_driver_armor_penetration
	armor_damage = @ESC_WEAPON_mass_driver_armor_damage
	shield_penetration = @ESC_WEAPON_mass_driver_shield_penetration
	shield_damage = @ESC_WEAPON_mass_driver_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_mass_driver_7" }
	component_set = ESC_BIO_MASS_DRIVER_7
	projectile_gfx = "gauss_cannon_s"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

# medium
weapon_component_template = {
	key = MEDIUM_ESC_MASS_DRIVER_7
	size = medium
	icon = GFX_esc_mass_driver_7
	icon_frame = 1
	type = instant

	damage = { min = 67 max = 192 }
	windup = { min = 5 max = 17 }
	total_fire_time = 25
	range = @ESC_WEAPON_RANGE_M_4
	accuracy = 0.75
	power = -46

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mass_driver_hull_damage
	armor_penetration = @ESC_WEAPON_mass_driver_armor_penetration
	armor_damage = @ESC_WEAPON_mass_driver_armor_damage
	shield_penetration = @ESC_WEAPON_mass_driver_shield_penetration
	shield_damage = @ESC_WEAPON_mass_driver_shield_damage
	tracking = 0.3

	prerequisites = { "esc_tech_mass_driver_7" }
	component_set = ESC_MASS_DRIVER_7
	projectile_gfx = "gauss_cannon_m"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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 = {
	key = MEDIUM_ESC_BIO_MASS_DRIVER_7
	size = medium
	icon = GFX_esc_bio_mass_driver_7
	icon_frame = 1
	type = instant

	damage = { min = 67 max = 192 }
	windup = { min = 5 max = 17 }
	total_fire_time = 25
	range = @ESC_WEAPON_RANGE_M_4
	accuracy = 0.75
	power = -46

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mass_driver_hull_damage
	armor_penetration = @ESC_WEAPON_mass_driver_armor_penetration
	armor_damage = @ESC_WEAPON_mass_driver_armor_damage
	shield_penetration = @ESC_WEAPON_mass_driver_shield_penetration
	shield_damage = @ESC_WEAPON_mass_driver_shield_damage
	tracking = 0.3

	prerequisites = { "esc_tech_mass_driver_7" }
	component_set = ESC_BIO_MASS_DRIVER_7
	projectile_gfx = "gauss_cannon_m"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

# large
weapon_component_template = {
	key = LARGE_ESC_MASS_DRIVER_7
	size = large
	icon = GFX_esc_mass_driver_7
	icon_frame = 1
	type = instant

	damage = { min = 158 max = 378 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_L_4
	min_range = @ESC_WEAPON_MIN_RANGE_4
	accuracy = 0.75
	power = -90

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mass_driver_hull_damage
	armor_penetration = @ESC_WEAPON_mass_driver_armor_penetration
	armor_damage = @ESC_WEAPON_mass_driver_armor_damage
	shield_penetration = @ESC_WEAPON_mass_driver_shield_penetration
	shield_damage = @ESC_WEAPON_mass_driver_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_mass_driver_7" }
	component_set = ESC_MASS_DRIVER_7
	projectile_gfx = "gauss_cannon_l"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

weapon_component_template = {
	key = LARGE_ESC_BIO_MASS_DRIVER_7
	size = large
	icon = GFX_esc_bio_mass_driver_7
	icon_frame = 1
	type = instant

	damage = { min = 158 max = 378 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_L_4
	min_range = @ESC_WEAPON_MIN_RANGE_4
	accuracy = 0.75
	power = -90

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mass_driver_hull_damage
	armor_penetration = @ESC_WEAPON_mass_driver_armor_penetration
	armor_damage = @ESC_WEAPON_mass_driver_armor_damage
	shield_penetration = @ESC_WEAPON_mass_driver_shield_penetration
	shield_damage = @ESC_WEAPON_mass_driver_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_mass_driver_7" }
	component_set = ESC_BIO_MASS_DRIVER_7
	projectile_gfx = "gauss_cannon_l"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield gunship }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

############################################################
##            Improved Stormfire Autocannon               ##
############################################################

# small
weapon_component_template = {
	key = SMALL_ESC_AUTOCANNON_4
	size = small
	icon = GFX_esc_autocannon_4
	icon_frame = 1
	type = instant

	damage = { min = 17 max = 35 }
	windup = { min = 1 max = 4 }
	total_fire_time = 6
	range = @ESC_WEAPON_RANGE_S_1
	accuracy = 0.85
	power = -20

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.75

	prerequisites = { "esc_tech_autocannon_4" }
	component_set = ESC_AUTOCANNON_4
	projectile_gfx = "esc_autocannon_4_small"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	upgrades_to = SMALL_ESC_AUTOCANNON_5
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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 = {
	key = SMALL_ESC_BIO_AUTOCANNON_4
	size = small
	icon = GFX_esc_bio_autocannon_4
	icon_frame = 1
	type = instant

	damage = { min = 17 max = 35 }
	windup = { min = 1 max = 4 }
	total_fire_time = 6
	range = @ESC_WEAPON_RANGE_S_1
	accuracy = 0.85
	power = -20

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.75

	prerequisites = { "esc_tech_autocannon_4" }
	component_set = ESC_BIO_AUTOCANNON_4
	projectile_gfx = "esc_autocannon_4_small"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	upgrades_to = SMALL_ESC_BIO_AUTOCANNON_5
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

# medium
weapon_component_template = {
	key = MEDIUM_ESC_AUTOCANNON_4
	size = medium
	icon = GFX_esc_autocannon_4
	icon_frame = 1
	type = instant

	damage = { min = 43 max = 88 }
	windup = { min = 2 max = 6 }
	total_fire_time = 9
	range = @ESC_WEAPON_RANGE_P_2
	accuracy = 0.85
	power = -34

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_autocannon_4" }
	component_set = ESC_AUTOCANNON_4
	projectile_gfx = "esc_autocannon_4_medium"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	upgrades_to = MEDIUM_ESC_AUTOCANNON_5
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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 = {
	key = MEDIUM_ESC_BIO_AUTOCANNON_4
	size = medium
	icon = GFX_esc_bio_autocannon_4
	icon_frame = 1
	type = instant

	damage = { min = 43 max = 88 }
	windup = { min = 2 max = 6 }
	total_fire_time = 9
	range = @ESC_WEAPON_RANGE_P_2
	accuracy = 0.85
	power = -34

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_autocannon_4" }
	component_set = ESC_BIO_AUTOCANNON_4
	projectile_gfx = "esc_autocannon_4_medium"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	upgrades_to = MEDIUM_ESC_BIO_AUTOCANNON_5
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

# large
weapon_component_template = {
	key = LARGE_ESC_AUTOCANNON_4
	size = large
	icon = GFX_esc_autocannon_4
	icon_frame = 1
	type = instant

	damage = { min = 102 max = 210 }
	windup = { min = 2 max = 8 }
	total_fire_time = 12
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 0.85
	power = -64

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.25

	prerequisites = { "esc_tech_autocannon_4" }
	component_set = ESC_AUTOCANNON_4
	projectile_gfx = "esc_autocannon_4_large"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	upgrades_to = LARGE_ESC_AUTOCANNON_5
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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 = {
	key = LARGE_ESC_BIO_AUTOCANNON_4
	size = large
	icon = GFX_esc_bio_autocannon_4
	icon_frame = 1
	type = instant

	damage = { min = 102 max = 210 }
	windup = { min = 2 max = 8 }
	total_fire_time = 12
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 0.85
	power = -64

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.25

	prerequisites = { "esc_tech_autocannon_4" }
	component_set = ESC_BIO_AUTOCANNON_4
	projectile_gfx = "esc_autocannon_4_large"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	upgrades_to = LARGE_ESC_BIO_AUTOCANNON_5
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

############################################################
##                  Shredder Autocannon                   ##
############################################################

# small
weapon_component_template = {
	key = SMALL_ESC_AUTOCANNON_5
	size = small
	icon = GFX_esc_autocannon_5
	icon_frame = 1
	type = instant

	damage = { min = 22 max = 44 }
	windup = { min = 1 max = 4 }
	total_fire_time = 6
	range = @ESC_WEAPON_RANGE_S_1
	accuracy = 0.85
	power = -24

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.75

	prerequisites = { "esc_tech_autocannon_5" }
	component_set = ESC_AUTOCANNON_5
	projectile_gfx = "esc_autocannon_5_small"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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 = {
	key = SMALL_ESC_BIO_AUTOCANNON_5
	size = small
	icon = GFX_esc_bio_autocannon_5
	icon_frame = 1
	type = instant

	damage = { min = 22 max = 44 }
	windup = { min = 1 max = 4 }
	total_fire_time = 6
	range = @ESC_WEAPON_RANGE_S_1
	accuracy = 0.85
	power = -24

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.75

	prerequisites = { "esc_tech_autocannon_5" }
	component_set = ESC_BIO_AUTOCANNON_5
	projectile_gfx = "esc_autocannon_5_small"
	tags = { weapon_type_kinetic s_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

# medium
weapon_component_template = {
	key = MEDIUM_ESC_AUTOCANNON_5
	size = medium
	icon = GFX_esc_autocannon_5
	icon_frame = 1
	type = instant

	damage = { min = 54 max = 110 }
	windup = { min = 2 max = 6 }
	total_fire_time = 9
	range = @ESC_WEAPON_RANGE_P_2
	accuracy = 0.85
	power = -46

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_autocannon_5" }
	component_set = ESC_AUTOCANNON_5
	projectile_gfx = "esc_autocannon_5_medium"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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 = {
	key = MEDIUM_ESC_BIO_AUTOCANNON_5
	size = medium
	icon = GFX_esc_bio_autocannon_5
	icon_frame = 1
	type = instant

	damage = { min = 54 max = 110 }
	windup = { min = 2 max = 6 }
	total_fire_time = 9
	range = @ESC_WEAPON_RANGE_P_2
	accuracy = 0.85
	power = -46

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_autocannon_5" }
	component_set = ESC_BIO_AUTOCANNON_5
	projectile_gfx = "esc_autocannon_5_medium"
	tags = { weapon_type_kinetic m_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

# large
weapon_component_template = {
	key = LARGE_ESC_AUTOCANNON_5
	size = large
	icon = GFX_esc_autocannon_5
	icon_frame = 1
	type = instant

	damage = { min = 132 max = 246 }
	windup = { min = 2 max = 8 }
	total_fire_time = 12
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 0.85
	power = -90

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.25

	prerequisites = { "esc_tech_autocannon_5" }
	component_set = ESC_AUTOCANNON_5
	projectile_gfx = "esc_autocannon_5_large"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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 = {
	key = LARGE_ESC_BIO_AUTOCANNON_5
	size = large
	icon = GFX_esc_bio_autocannon_5
	icon_frame = 1
	type = instant

	damage = { min = 132 max = 246 }
	windup = { min = 2 max = 8 }
	total_fire_time = 12
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 0.85
	power = -90

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.25

	prerequisites = { "esc_tech_autocannon_5" }
	component_set = ESC_BIO_AUTOCANNON_5
	projectile_gfx = "esc_autocannon_5_large"
	tags = { weapon_type_kinetic l_slot }
	ai_tags = { weapon_role_anti_shield brawler brawler_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

############################################################
##                Improved Kinetic Artillery              ##
############################################################

# standard
weapon_component_template = {
	key = ESC_ARTILLERY_3
	size = large
	icon = GFX_esc_kinetic_artillery_3
	icon_frame = 1
	type = instant

	damage = { min = 245 max = 720 }
	windup = { min = 9 max = 34 }
	total_fire_time = 50
	range = @ESC_WEAPON_RANGE_L_5
	min_range = @ESC_WEAPON_MIN_RANGE_5
	accuracy = 0.75
	power = -110

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_artillery_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_kinetic_artillery_3" }
	component_set = ESC_ARTILLERY_3
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic l_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield artillery artillery_stealth }
	upgrades_to = ESC_ARTILLERY_4

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_ARTILLERY_3
	size = large
	icon = GFX_esc_bio_kinetic_artillery_3
	icon_frame = 1
	type = instant

	damage = { min = 245 max = 720 }
	windup = { min = 9 max = 34 }
	total_fire_time = 50
	range = @ESC_WEAPON_RANGE_L_5
	min_range = @ESC_WEAPON_MIN_RANGE_5
	accuracy = 0.75
	power = -110

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_artillery_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_kinetic_artillery_3" }
	component_set = ESC_BIO_ARTILLERY_3
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic l_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield artillery artillery_stealth }
	upgrades_to = ESC_BIO_ARTILLERY_4

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

# infernal
weapon_component_template = {
	key = ESC_LM_ACCELERATOR_2
	size = large
	icon = GFX_esc_lm_accelerator_2
	icon_frame = 1
	type = instant

	damage = { min = 205 max = 640 }
	windup = { min = 9 max = 34 }
	total_fire_time = 50
	range = @ESC_WEAPON_RANGE_L_5
	min_range = @ESC_WEAPON_MIN_RANGE_5
	accuracy = 0.85
	power = -110

	inline_script = {
		script = component_costs/shorthands/esc_inlines_infernal_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_infernal_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_infernal_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_infernal_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_infernal_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_infernal_artillery_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_kinetic_artillery_3" }
	component_set = ESC_LM_ACCELERATOR_2
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic l_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield artillery artillery_stealth }
	upgrades_to = ESC_LM_ACCELERATOR_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_galvanic_components
		IS_GALVANIC = yes
		USES_BIO_SHIPS = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

weapon_component_template = {
	key = ESC_LM_ACCELERATOR_BIO_2
	size = large
	icon = GFX_esc_bio_lm_accelerator_2
	icon_frame = 1
	type = instant

	damage = { min = 205 max = 640 }
	windup = { min = 9 max = 34 }
	total_fire_time = 50
	range = @ESC_WEAPON_RANGE_L_5
	min_range = @ESC_WEAPON_MIN_RANGE_5
	accuracy = 0.85
	power = -110

	inline_script = {
		script = component_costs/shorthands/esc_inlines_infernal_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_infernal_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_infernal_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_infernal_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_infernal_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_infernal_artillery_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_kinetic_artillery_3" }
	component_set = ESC_LM_ACCELERATOR_BIO_2
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic l_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield artillery artillery_stealth }
	upgrades_to = ESC_LM_ACCELERATOR_BIO_3

	inline_script = {
		script = ship_components_general/esc_inlines_uses_galvanic_components
		IS_GALVANIC = yes
		USES_BIO_SHIPS = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

############################################################
##                  Skypiercer Artillery                  ##
############################################################

# standard
weapon_component_template = {
	key = ESC_ARTILLERY_4
	size = large
	icon = GFX_esc_kinetic_artillery_4
	icon_frame = 1
	type = instant

	damage = { min = 300 max = 870 }
	windup = { min = 9 max = 34 }
	total_fire_time = 50
	range = @ESC_WEAPON_RANGE_L_5
	min_range = @ESC_WEAPON_MIN_RANGE_5
	accuracy = 0.75
	power = -130

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_artillery_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_kinetic_artillery_4" }
	component_set = ESC_ARTILLERY_4
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic l_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield artillery artillery_stealth }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_ARTILLERY_4
	size = large
	icon = GFX_esc_bio_kinetic_artillery_4
	icon_frame = 1
	type = instant

	damage = { min = 300 max = 870 }
	windup = { min = 9 max = 34 }
	total_fire_time = 50
	range = @ESC_WEAPON_RANGE_L_5
	min_range = @ESC_WEAPON_MIN_RANGE_5
	accuracy = 0.75
	power = -130

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_artillery_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_kinetic_artillery_4" }
	component_set = ESC_BIO_ARTILLERY_4
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic l_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield artillery artillery_stealth }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

# infernal
weapon_component_template = {
	key = ESC_LM_ACCELERATOR_3
	size = large
	icon = GFX_esc_lm_accelerator_3
	icon_frame = 1
	type = instant

	damage = { min = 275 max = 785 }
	windup = { min = 9 max = 34 }
	total_fire_time = 50
	range = @ESC_WEAPON_RANGE_L_5
	min_range = @ESC_WEAPON_MIN_RANGE_5
	accuracy = 0.85
	power = -110

	inline_script = {
		script = component_costs/shorthands/esc_inlines_infernal_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_infernal_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_infernal_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_infernal_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_infernal_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_infernal_artillery_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_kinetic_artillery_4" }
	component_set = ESC_LM_ACCELERATOR_3
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic l_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield artillery artillery_stealth }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_galvanic_components
		IS_GALVANIC = yes
		USES_BIO_SHIPS = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

weapon_component_template = {
	key = ESC_LM_ACCELERATOR_BIO_3
	size = large
	icon = GFX_esc_bio_lm_accelerator_3
	icon_frame = 1
	type = instant

	damage = { min = 275 max = 785 }
	windup = { min = 9 max = 34 }
	total_fire_time = 50
	range = @ESC_WEAPON_RANGE_L_5
	min_range = @ESC_WEAPON_MIN_RANGE_5
	accuracy = 0.85
	power = -110

	inline_script = {
		script = component_costs/shorthands/esc_inlines_infernal_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_infernal_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_infernal_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_infernal_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_infernal_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_infernal_artillery_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_kinetic_artillery_4" }
	component_set = ESC_LM_ACCELERATOR_BIO_3
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic l_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield artillery artillery_stealth }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_galvanic_components
		IS_GALVANIC = yes
		USES_BIO_SHIPS = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

############################################################
##                  Improved Giga-Cannon                  ##
############################################################

weapon_component_template = {
	key = ESC_MASS_ACCELERATOR_3
	size = extra_large
	icon = GFX_esc_mass_accelerator_3
	icon_frame = 1
	type = instant

    damage = { min = 1200 max = 3200 }
	windup = { min = 14 max = 54 }
	total_fire_time = 80
	range = @ESC_WEAPON_RANGE_X_3
	accuracy = 0.75
	power = -280

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_megacannon_hull_damage
	armor_penetration = @ESC_WEAPON_megacannon_armor_penetration
	armor_damage = @ESC_WEAPON_megacannon_armor_damage
	shield_penetration = @ESC_WEAPON_megacannon_shield_penetration
	shield_damage = @ESC_WEAPON_megacannon_shield_damage
	tracking = 0.0

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_5
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_giga_cannon_3" }
	component_set = ESC_MASS_ACCELERATOR_3
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }
	upgrades_to = ESC_MASS_ACCELERATOR_4

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	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
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_MASS_ACCELERATOR_3
	size = extra_large
	icon = GFX_esc_bio_mass_accelerator_3
	icon_frame = 1
	type = instant

    damage = { min = 1200 max = 3200 }
	windup = { min = 14 max = 54 }
	total_fire_time = 80
	range = @ESC_WEAPON_RANGE_X_3
	accuracy = 0.75
	power = -280

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_megacannon_hull_damage
	armor_penetration = @ESC_WEAPON_megacannon_armor_penetration
	armor_damage = @ESC_WEAPON_megacannon_armor_damage
	shield_penetration = @ESC_WEAPON_megacannon_shield_penetration
	shield_damage = @ESC_WEAPON_megacannon_shield_damage
	tracking = 0.0

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_5
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_giga_cannon_3" }
	component_set = ESC_BIO_MASS_ACCELERATOR_3
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }
	upgrades_to = ESC_BIO_MASS_ACCELERATOR_4

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	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
		}
	}
}

############################################################
##                    The Grand Cannon                    ##
############################################################

weapon_component_template = {
	key = ESC_MASS_ACCELERATOR_4
	size = extra_large
	icon = GFX_esc_mass_accelerator_4
	icon_frame = 1
	type = instant

	damage = { min = 1500 max = 3700 }
	windup = { min = 14 max = 54 }
	total_fire_time = 80
	range = @ESC_WEAPON_RANGE_X_3
	accuracy = 0.75
	power = -330

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_megacannon_hull_damage
	armor_penetration = @ESC_WEAPON_megacannon_armor_penetration
	armor_damage = @ESC_WEAPON_megacannon_armor_damage
	shield_penetration = @ESC_WEAPON_megacannon_shield_penetration
	shield_damage = @ESC_WEAPON_megacannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_5
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_giga_cannon_4" }
	component_set = ESC_MASS_ACCELERATOR_4
	projectile_gfx = "adv_kinetic_artillery"
	upgrades_to = ESC_MASS_ACCELERATOR_JUGGERNAUT
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	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
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_MASS_ACCELERATOR_4
	size = extra_large
	icon = GFX_esc_bio_mass_accelerator_4
	icon_frame = 1
	type = instant

	damage = { min = 1500 max = 3700 }
	windup = { min = 14 max = 54 }
	total_fire_time = 80
	range = @ESC_WEAPON_RANGE_X_3
	accuracy = 0.75
	power = -330

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_megacannon_hull_damage
	armor_penetration = @ESC_WEAPON_megacannon_armor_penetration
	armor_damage = @ESC_WEAPON_megacannon_armor_damage
	shield_penetration = @ESC_WEAPON_megacannon_shield_penetration
	shield_damage = @ESC_WEAPON_megacannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_5
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_giga_cannon_4" }
	component_set = ESC_BIO_MASS_ACCELERATOR_4
	projectile_gfx = "adv_kinetic_artillery"
	upgrades_to = ESC_BIO_MASS_ACCELERATOR_JUGGERNAUT
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	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
		}
	}
}

############################################################
##           Relativistic Kinetic Kill Vehicle            ##
############################################################

# titan
weapon_component_template = {
	key = ESC_MASS_ACCELERATOR_TITANIC
	size = titanic
	icon = GFX_esc_mass_accelerator_titanic
	icon_frame = 1
	type = instant

    inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 5500
		MAX_DAMAGE = 10000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 40 max = 100 }
	total_fire_time = 155
	range = @ESC_WEAPON_RANGE_T_3
	accuracy = 0.8
	power = -500

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_megacannon_hull_damage
	armor_penetration = @ESC_WEAPON_megacannon_armor_penetration
	armor_damage = @ESC_WEAPON_megacannon_armor_damage
	shield_penetration = @ESC_WEAPON_megacannon_shield_penetration
	shield_damage = @ESC_WEAPON_megacannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_5
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_giga_cannon_titanic" }
	component_set =ESC_MASS_ACCELERATOR_TITANIC
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic t_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_titanic_standard_bio
		BIOSHIP_WEAPON = no
		ARKSHIP_WEAPON = no
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	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
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_MASS_ACCELERATOR_TITANIC
	size = titanic
	icon = GFX_esc_mass_accelerator_titanic
	icon_frame = 1
	type = instant

    inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 5500
		MAX_DAMAGE = 10000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 40 max = 100 }
	total_fire_time = 155
	range = @ESC_WEAPON_RANGE_T_3
	accuracy = 0.8
	power = -500

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_megacannon_hull_damage
	armor_penetration = @ESC_WEAPON_megacannon_armor_penetration
	armor_damage = @ESC_WEAPON_megacannon_armor_damage
	shield_penetration = @ESC_WEAPON_megacannon_shield_penetration
	shield_damage = @ESC_WEAPON_megacannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_5
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_giga_cannon_titanic" }
	component_set =ESC_BIO_MASS_ACCELERATOR_TITANIC
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic t_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_titanic_standard_bio
		BIOSHIP_WEAPON = yes
		ARKSHIP_WEAPON = no
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	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
		}
	}
}

# juggernaut
weapon_component_template = {
	key = ESC_MASS_ACCELERATOR_JUGGERNAUT
	size = extra_large
	icon = GFX_esc_mass_accelerator_titanic
	icon_frame = 1
	type = instant

    inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 5500
		MAX_DAMAGE = 10000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 40 max = 100 }
	total_fire_time = 155
	range = @ESC_WEAPON_RANGE_J_3
	accuracy = 0.8
	power = -500

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_megacannon_hull_damage
	armor_penetration = @ESC_WEAPON_megacannon_armor_penetration
	armor_damage = @ESC_WEAPON_megacannon_armor_damage
	shield_penetration = @ESC_WEAPON_megacannon_shield_penetration
	shield_damage = @ESC_WEAPON_megacannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_5
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_giga_cannon_titanic" }
	component_set = ESC_MASS_ACCELERATOR_JUGGERNAUT
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ESC_ship_uses_juggernaut_components"
		EXTRA_CONDITION_VALUE = yes
		EVAL_TARGET = no
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	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
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_MASS_ACCELERATOR_JUGGERNAUT
	size = extra_large
	icon = GFX_esc_mass_accelerator_titanic
	icon_frame = 1
	type = instant

    inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 5500
		MAX_DAMAGE = 10000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 40 max = 100 }
	total_fire_time = 155
	range = @ESC_WEAPON_RANGE_J_3
	accuracy = 0.8
	power = -500

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_megacannon_hull_damage
	armor_penetration = @ESC_WEAPON_megacannon_armor_penetration
	armor_damage = @ESC_WEAPON_megacannon_armor_damage
	shield_penetration = @ESC_WEAPON_megacannon_shield_penetration
	shield_damage = @ESC_WEAPON_megacannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_5
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_giga_cannon_titanic" }
	component_set = ESC_BIO_MASS_ACCELERATOR_JUGGERNAUT
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ESC_ship_uses_juggernaut_components"
		EXTRA_CONDITION_VALUE = yes
		EVAL_TARGET = yes
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	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
		}
	}
}

# arkship
weapon_component_template = {
	key = ESC_MASS_ACCELERATOR_ARKSHIP
	size = titanic
	icon = GFX_esc_mass_accelerator_titanic
	icon_frame = 1
	type = instant

    inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 7500
		MAX_DAMAGE = 15000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 40 max = 100 }
	total_fire_time = 155
	range = @ESC_WEAPON_RANGE_ARKSHIP_4
	accuracy = 0.75
	power = 0

	resources = {
		category = ship_components
		upkeep = {
			alloys = @titanic_t7_upkeep_alloys
			energy = @titanic_t7_upkeep_energy
		}
	}

	hull_damage = @ESC_WEAPON_megacannon_hull_damage
	armor_penetration = @ESC_WEAPON_megacannon_armor_penetration
	armor_damage = @ESC_WEAPON_megacannon_armor_damage
	shield_penetration = @ESC_WEAPON_megacannon_shield_penetration
	shield_damage = @ESC_WEAPON_megacannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_5
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_giga_cannon_titanic" }
	component_set = ESC_MASS_ACCELERATOR_ARKSHIP
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic t_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_titanic_standard
		ARKSHIP_WEAPON = yes
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	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
		}
	}
}

############################################################
##                 Hailstorm Autocannon                   ##
############################################################

weapon_component_template = {
	key = ESC_AUTOCANNON_X_1
	size = extra_large
	icon = GFX_esc_x_autocannon_1
	icon_frame = 1
	type = instant

    damage = { min = 400 max = 750 }
	windup = { min = 3 max = 12 }
	total_fire_time = 22
	range = @ESC_WEAPON_RANGE_X_1
	accuracy = 0.85
	power = -275

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_xl_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.25

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_1
	#use_ship_kill_target = no

	prerequisites = { esc_tech_autocannon_x_1 }
	component_set = ESC_AUTOCANNON_X_1
	projectile_gfx = "esc_autocannon_5_large"
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_anti_shield }
	upgrades_to = ESC_AUTOCANNON_X_2
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon_grand

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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 = {
	key = ESC_BIO_AUTOCANNON_X_1
	size = extra_large
	icon = GFX_esc_bio_x_autocannon_1
	icon_frame = 1
	type = instant

    damage = { min = 400 max = 750 }
	windup = { min = 3 max = 12 }
	total_fire_time = 22
	range = @ESC_WEAPON_RANGE_X_1
	accuracy = 0.85
	power = -275

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_xl_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.25

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_1
	#use_ship_kill_target = no

	prerequisites = { esc_tech_autocannon_x_1 }
	component_set = ESC_BIO_AUTOCANNON_X_1
	projectile_gfx = "esc_autocannon_5_large"
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_anti_shield }
	upgrades_to = ESC_BIO_AUTOCANNON_X_2
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon_grand

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

############################################################
##                  Firestorm Autocannon                  ##
############################################################

weapon_component_template = {
	key = ESC_AUTOCANNON_X_2
	size = extra_large
	icon = GFX_esc_x_autocannon_2
	icon_frame = 1
	type = instant

	damage = { min = 500 max = 850 }
	windup = { min = 3 max = 12 }
	total_fire_time = 22
	range = @ESC_WEAPON_RANGE_X_1
	accuracy = 0.85
	power = -325

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_xl_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.25

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_1
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_autocannon_x_2" }
	component_set = ESC_AUTOCANNON_X_2
	projectile_gfx = "stormfire_auto_cannons_l"
	upgrades_to = ESC_AUTOCANNON_J
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_anti_shield }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon_grand

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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 = {
	key = ESC_BIO_AUTOCANNON_X_2
	size = extra_large
	icon = GFX_esc_bio_x_autocannon_2
	icon_frame = 1
	type = instant

	damage = { min = 500 max = 850 }
	windup = { min = 3 max = 12 }
	total_fire_time = 22
	range = @ESC_WEAPON_RANGE_X_1
	accuracy = 0.85
	power = -325

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_xl_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.25

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_1
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_autocannon_x_2" }
	component_set = ESC_BIO_AUTOCANNON_X_2
	projectile_gfx = "stormfire_auto_cannons_l"
	upgrades_to = ESC_BIO_AUTOCANNON_J
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_anti_shield }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon_grand

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

############################################################
##                   Tempest Autocannon                   ##
############################################################

# titan
weapon_component_template = {
	key = ESC_AUTOCANNON_T
	size = titanic
	icon = GFX_esc_x_autocannon_3
	icon_frame = 1
	type = instant

    inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 750
		MAX_DAMAGE = 1250
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_xl
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 3 max = 12 }
	total_fire_time = 22
	range = @ESC_WEAPON_RANGE_T_1
	accuracy = 0.85
	power = -500

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_xl_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.25

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_2
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_autocannon_titanic" }
	component_set = ESC_AUTOCANNON_T
	projectile_gfx = "esc_autocannon_4_large"
	tags = { weapon_type_kinetic t_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon_grand

	inline_script = {
		script = ship_components_general/esc_inlines_titanic_standard_bio
		BIOSHIP_WEAPON = no
		ARKSHIP_WEAPON = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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 = {
	key = ESC_BIO_AUTOCANNON_T
	size = titanic
	icon = GFX_esc_bio_x_autocannon_3
	icon_frame = 1
	type = instant

    inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 750
		MAX_DAMAGE = 1250
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_xl
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 3 max = 12 }
	total_fire_time = 22
	range = @ESC_WEAPON_RANGE_T_1
	accuracy = 0.85
	power = -500

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_xl_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.25

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_2
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_autocannon_titanic" }
	component_set = ESC_BIO_AUTOCANNON_T
	projectile_gfx = "esc_autocannon_4_large"
	tags = { weapon_type_kinetic t_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon_grand

	inline_script = {
		script = ship_components_general/esc_inlines_titanic_standard_bio
		BIOSHIP_WEAPON = yes
		ARKSHIP_WEAPON = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

# juggernaut
weapon_component_template = {
	key = ESC_AUTOCANNON_J
	size = extra_large
	icon = GFX_esc_x_autocannon_3
	icon_frame = 1
	type = instant

    inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 750
		MAX_DAMAGE = 1250
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_xl
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 3 max = 12 }
	total_fire_time = 22
	range = @ESC_WEAPON_RANGE_J_1
	accuracy = 0.85
	power = -500

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_xl_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.25

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_2
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_autocannon_titanic" }
	component_set = ESC_AUTOCANNON_J
	projectile_gfx = "esc_autocannon_4_large"
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon_grand

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ESC_ship_uses_juggernaut_components"
		EXTRA_CONDITION_VALUE = yes
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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 = {
	key = ESC_BIO_AUTOCANNON_J
	size = extra_large
	icon = GFX_esc_bio_x_autocannon_3
	icon_frame = 1
	type = instant

    inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 750
		MAX_DAMAGE = 1250
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_xl
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 3 max = 12 }
	total_fire_time = 22
	range = @ESC_WEAPON_RANGE_J_1
	accuracy = 0.85
	power = -500

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_xl_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.25

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_2
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_autocannon_titanic" }
	component_set = ESC_BIO_AUTOCANNON_J
	projectile_gfx = "esc_autocannon_4_large"
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon_grand

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ESC_ship_uses_juggernaut_components"
		EXTRA_CONDITION_VALUE = yes
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

# arkship
weapon_component_template = {
	key = ESC_AUTOCANNON_ARKSHIP
	size = titanic
	icon = GFX_esc_x_autocannon_3
	icon_frame = 1
	type = instant

    inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 1000
		MAX_DAMAGE = 2250
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_xl
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 3 max = 12 }
	total_fire_time = 22
	range = @ESC_WEAPON_RANGE_ARKSHIP_3
	accuracy = 0.85
	power = 0

	resources = {
		category = ship_components
		upkeep = {
			alloys = @titanic_t7_upkeep_alloys
			energy = @titanic_t7_upkeep_energy
		}
	}

	hull_damage = @ESC_WEAPON_autocannon_hull_damage
	armor_penetration = @ESC_WEAPON_autocannon_armor_penetration
	armor_damage = @ESC_WEAPON_autocannon_xl_armor_damage
	shield_penetration = @ESC_WEAPON_autocannon_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.25

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_2
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_autocannon_titanic" }
	component_set = ESC_AUTOCANNON_ARKSHIP
	projectile_gfx = "esc_autocannon_4_large"
	tags = { weapon_type_kinetic t_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_autocannon_grand

	inline_script = {
		script = ship_components_general/esc_inlines_titanic_standard
		ARKSHIP_WEAPON = yes
	}

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

############################################################
##                  Juggernaut Artillery                  ##
############################################################

weapon_component_template = {
	key = ESC_JUGGERNAUT_ARTILLERY_1
	size = medium
	icon = GFX_esc_juggernaut_cannon_1
	icon_frame = 1
	type = instant

	damage = { min = 220 max = 650 }
	windup = { min = 9 max = 34 }
	total_fire_time = 50
	range = @ESC_WEAPON_RANGE_L_5
	min_range = @ESC_WEAPON_MIN_RANGE_5
	accuracy = 0.80
	power = -110

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_artillery_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_juggernaut_artillery_1" }
	component_set = ESC_JUGGERNAUT_ARTILLERY_1
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic m_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield artillery }
	upgrades_to = ESC_JUGGERNAUT_ARTILLERY_2

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ESC_ship_uses_juggernaut_components"
		EXTRA_CONDITION_VALUE = yes
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_JUGGERNAUT_ARTILLERY_1
	size = medium
	icon = GFX_esc_bio_juggernaut_cannon_1
	icon_frame = 1
	type = instant

	damage = { min = 220 max = 650 }
	windup = { min = 9 max = 34 }
	total_fire_time = 50
	range = @ESC_WEAPON_RANGE_L_5
	min_range = @ESC_WEAPON_MIN_RANGE_5
	accuracy = 0.80
	power = -110

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_artillery_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_juggernaut_artillery_1" }
	component_set = ESC_BIO_JUGGERNAUT_ARTILLERY_1
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic m_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield artillery }
	upgrades_to = ESC_BIO_JUGGERNAUT_ARTILLERY_2

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ESC_ship_uses_juggernaut_components"
		EXTRA_CONDITION_VALUE = yes
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

############################################################
##              Improved Juggernaut Artillery             ##
############################################################

weapon_component_template = {
	key = ESC_JUGGERNAUT_ARTILLERY_2
	size = medium
	icon = GFX_esc_juggernaut_cannon_2
	icon_frame = 1
	type = instant

	damage = { min = 280 max = 760 }
	windup = { min = 9 max = 34 }
	total_fire_time = 50
	range = @ESC_WEAPON_RANGE_L_5
	min_range = @ESC_WEAPON_MIN_RANGE_5
	accuracy = 0.8
	power = -130

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_artillery_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_juggernaut_artillery_2" }
	component_set = ESC_JUGGERNAUT_ARTILLERY_2
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic m_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ESC_ship_uses_juggernaut_components"
		EXTRA_CONDITION_VALUE = yes
		EVAL_TARGET = no
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_JUGGERNAUT_ARTILLERY_2
	size = medium
	icon = GFX_esc_bio_juggernaut_cannon_2
	icon_frame = 1
	type = instant

	damage = { min = 280 max = 760 }
	windup = { min = 9 max = 34 }
	total_fire_time = 50
	range = @ESC_WEAPON_RANGE_L_5
	min_range = @ESC_WEAPON_MIN_RANGE_5
	accuracy = 0.8
	power = -130

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = l
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_artillery_armor_damage
	shield_penetration = @ESC_WEAPON_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_artillery_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_juggernaut_artillery_2" }
	component_set = ESC_BIO_JUGGERNAUT_ARTILLERY_2
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic m_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ESC_ship_uses_juggernaut_components"
		EXTRA_CONDITION_VALUE = yes
		EVAL_TARGET = yes
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		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
		}
	}
}

############################################################
##                     Asteroid Thrower                   ##
############################################################

# titan
weapon_component_template = {
	key = ESC_ASTEROID_THROWER
	size = titanic
	icon = GFX_esc_asteroid_cannon
	icon_frame = 1
	type = instant

	inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 7000
		MAX_DAMAGE = 10000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 20.0 max = 40.0 }
	total_fire_time = 180
	range = @ESC_WEAPON_RANGE_T_3
	accuracy = 0.75
	power = -500

	inline_script = {
		script = component_costs/shorthands/esc_inlines_no_sr_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 6
	}

	hull_damage = @ESC_WEAPON_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_rkkv_armor_damage
	shield_penetration = @ESC_WEAPON_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.0

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_4
	#use_ship_kill_target = no

	prerequisites = { "tech_titans" }
	component_set = ESC_ASTEROID_THROWER
	projectile_gfx = "esc_asteroid_thrower_projectile"
	tags = { weapon_type_kinetic t_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield artillery }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_asteroid_gun

	inline_script = {
		script = ship_components_general/esc_inlines_titanic_standard
		ARKSHIP_WEAPON = no
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = { weight = 1 }
}

# arkship
weapon_component_template = {
	key = ESC_ASTEROID_THROWER_ARKSHIP
	size = titanic
	icon = GFX_esc_asteroid_cannon
	icon_frame = 1
	type = instant

	inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 8000
		MAX_DAMAGE = 14000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 20.0 max = 40.0 }
	total_fire_time = 180
	range = @ESC_WEAPON_RANGE_ARKSHIP_4
	accuracy = 0.75
	power = 0

	resources = {
		category = ship_components
		upkeep = {
			alloys = @titanic_t7_upkeep_alloys
			energy = @titanic_t7_upkeep_energy
		}
	}

	hull_damage = @ESC_WEAPON_artillery_hull_damage
	armor_penetration = @ESC_WEAPON_artillery_armor_penetration
	armor_damage = @ESC_WEAPON_rkkv_armor_damage
	shield_penetration = @ESC_WEAPON_artillery_shield_penetration
	shield_damage = @ESC_WEAPON_autocannon_shield_damage
	tracking = 0.0

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_4
	#use_ship_kill_target = no

	prerequisites = { "tech_titans" }
	component_set = ESC_ASTEROID_THROWER_ARKSHIP
	projectile_gfx = "esc_asteroid_thrower_projectile"
	tags = { weapon_type_kinetic t_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery weapon_role_anti_shield artillery }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_asteroid_gun

	inline_script = {
		script = ship_components_general/esc_inlines_titanic_standard
		ARKSHIP_WEAPON = yes
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = { weight = 1 }
}

############################################################
##                Ferromagnetic Liquid Cannon             ##
############################################################

weapon_component_template = {
	key = ESC_MHD_CANNON_1
	size = extra_large
	icon = GFX_esc_mhd_cannon_1
	icon_frame = 1
	type = instant

    damage = { min = 1250 max = 2500 }
	windup = { min = 14 max = 54 }
	total_fire_time = 80
	range = @ESC_WEAPON_RANGE_X_2
	accuracy = 0.85
	power = -280

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mhd_cannon_hull_damage
	armor_penetration = @ESC_WEAPON_mhd_cannon_armor_penetration
	armor_damage = @ESC_WEAPON_mhd_cannon_armor_damage
	shield_penetration = @ESC_WEAPON_mhd_cannon_shield_penetration
	shield_damage = @ESC_WEAPON_mhd_cannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_3
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_mhd_cannon_1" }
	component_set = ESC_MHD_CANNON_1
	projectile_gfx = "esc_mhd_cannon_1"
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }
	upgrades_to = ESC_MHD_CANNON_2

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_MHD_CANNON_1
	size = extra_large
	icon = GFX_esc_bio_mhd_cannon_1
	icon_frame = 1
	type = instant

    damage = { min = 1250 max = 2500 }
	windup = { min = 14 max = 54 }
	total_fire_time = 80
	range = @ESC_WEAPON_RANGE_X_2
	accuracy = 0.85
	power = -280

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 7
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mhd_cannon_hull_damage
	armor_penetration = @ESC_WEAPON_mhd_cannon_armor_penetration
	armor_damage = @ESC_WEAPON_mhd_cannon_armor_damage
	shield_penetration = @ESC_WEAPON_mhd_cannon_shield_penetration
	shield_damage = @ESC_WEAPON_mhd_cannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_3
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_mhd_cannon_1" }
	component_set = ESC_BIO_MHD_CANNON_1
	projectile_gfx = "esc_tiyanki_lance"
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }
	upgrades_to = ESC_BIO_MHD_CANNON_2

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
	}
}

############################################################
##           Improved Ferromagnetic Liquid Cannon         ##
############################################################

weapon_component_template = {
	key = ESC_MHD_CANNON_2
	size = extra_large
	icon = GFX_esc_mhd_cannon_2
	icon_frame = 1
	type = instant

	damage = { min = 1500 max = 2750 }
	windup = { min = 14 max = 54 }
	total_fire_time = 80
	range = @ESC_WEAPON_RANGE_X_2
	accuracy = 0.85
	power = -330

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mhd_cannon_hull_damage
	armor_penetration = @ESC_WEAPON_mhd_cannon_armor_penetration
	armor_damage = @ESC_WEAPON_mhd_cannon_armor_damage
	shield_penetration = @ESC_WEAPON_mhd_cannon_shield_penetration
	shield_damage = @ESC_WEAPON_mhd_cannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_3
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_mhd_cannon_2" }
	component_set = ESC_MHD_CANNON_2
	projectile_gfx = "esc_mhd_cannon_2"
	upgrades_to = ESC_MHD_CANNON_JUGGERNAUT
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = no
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_MHD_CANNON_2
	size = extra_large
	icon = GFX_esc_bio_mhd_cannon_2
	icon_frame = 1
	type = instant

	damage = { min = 1500 max = 2750 }
	windup = { min = 14 max = 54 }
	total_fire_time = 80
	range = @ESC_WEAPON_RANGE_X_2
	accuracy = 0.85
	power = -330

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = xl
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mhd_cannon_hull_damage
	armor_penetration = @ESC_WEAPON_mhd_cannon_armor_penetration
	armor_damage = @ESC_WEAPON_mhd_cannon_armor_damage
	shield_penetration = @ESC_WEAPON_mhd_cannon_shield_penetration
	shield_damage = @ESC_WEAPON_mhd_cannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_3
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_mhd_cannon_2" }
	component_set = ESC_BIO_MHD_CANNON_2
	projectile_gfx = "esc_tiyanki_lance"
	upgrades_to = ESC_BIO_MHD_CANNON_JUGGERNAUT
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships
		EVAL_TARGET = yes
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
	}
}

############################################################
##               MagnetoHydroDynamic Cannon               ##
############################################################

# titan
weapon_component_template = {
	key =  ESC_MHD_CANNON_TITANIC
	size = titanic
	icon = GFX_esc_mhd_cannon_3
	icon_frame = 1
	type = instant

    inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 4000
		MAX_DAMAGE = 9000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_xl
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 40 max = 100 }
	total_fire_time = 160
	range = @ESC_WEAPON_RANGE_T_3
	accuracy = 0.85
	power = -500

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mhd_cannon_hull_damage
	armor_penetration = @ESC_WEAPON_mhd_cannon_armor_penetration
	armor_damage = @ESC_WEAPON_mhd_cannon_armor_damage
	shield_penetration = @ESC_WEAPON_mhd_cannon_shield_penetration
	shield_damage = @ESC_WEAPON_mhd_cannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_3
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_mhd_cannon_titanic" }
	component_set = ESC_MHD_CANNON_TITANIC
	projectile_gfx = "esc_mhd_cannon_3_titanic"
	tags = { weapon_type_kinetic t_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_titanic_standard_bio
		BIOSHIP_WEAPON = no
		ARKSHIP_WEAPON = no
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
	}
}

weapon_component_template = {
	key =  ESC_BIO_MHD_CANNON_TITANIC
	size = titanic
	icon = GFX_esc_bio_mhd_cannon_3
	icon_frame = 1
	type = instant

    inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 4000
		MAX_DAMAGE = 9000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_xl
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 40 max = 100 }
	total_fire_time = 160
	range = @ESC_WEAPON_RANGE_T_3
	accuracy = 0.85
	power = -500

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mhd_cannon_hull_damage
	armor_penetration = @ESC_WEAPON_mhd_cannon_armor_penetration
	armor_damage = @ESC_WEAPON_mhd_cannon_armor_damage
	shield_penetration = @ESC_WEAPON_mhd_cannon_shield_penetration
	shield_damage = @ESC_WEAPON_mhd_cannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_3
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_mhd_cannon_titanic" }
	component_set = ESC_BIO_MHD_CANNON_TITANIC
	projectile_gfx = "esc_tiyanki_lance"
	tags = { weapon_type_kinetic t_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_titanic_standard_bio
		BIOSHIP_WEAPON = yes
		ARKSHIP_WEAPON = no
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
	}
}

# juggernaut
weapon_component_template = {
	key = ESC_MHD_CANNON_JUGGERNAUT
	size = extra_large
	icon = GFX_esc_mhd_cannon_3
	icon_frame = 1
	type = instant

    inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 4000
		MAX_DAMAGE = 9000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_xl
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 40 max = 100 }
	total_fire_time = 160
	range = @ESC_WEAPON_RANGE_J_3
	accuracy = 0.85
	power = -500

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mhd_cannon_hull_damage
	armor_penetration = @ESC_WEAPON_mhd_cannon_armor_penetration
	armor_damage = @ESC_WEAPON_mhd_cannon_armor_damage
	shield_penetration = @ESC_WEAPON_mhd_cannon_shield_penetration
	shield_damage = @ESC_WEAPON_mhd_cannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_3
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_mhd_cannon_titanic" }
	component_set = ESC_MHD_CANNON_JUGGERNAUT
	projectile_gfx = "esc_mhd_cannon_3"
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ESC_ship_uses_juggernaut_components"
		EXTRA_CONDITION_VALUE = yes
		EVAL_TARGET = no
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_MHD_CANNON_JUGGERNAUT
	size = extra_large
	icon = GFX_esc_bio_mhd_cannon_3
	icon_frame = 1
	type = instant

    inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 4000
		MAX_DAMAGE = 9000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_xl
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 40 max = 100 }
	total_fire_time = 160
	range = @ESC_WEAPON_RANGE_J_3
	accuracy = 0.85
	power = -500

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = t
		TIER = 6
		STRATEGIC_RESOURCE_TYPE = volatile_motes
	}

	hull_damage = @ESC_WEAPON_mhd_cannon_hull_damage
	armor_penetration = @ESC_WEAPON_mhd_cannon_armor_penetration
	armor_damage = @ESC_WEAPON_mhd_cannon_armor_damage
	shield_penetration = @ESC_WEAPON_mhd_cannon_shield_penetration
	shield_damage = @ESC_WEAPON_mhd_cannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_3
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_mhd_cannon_titanic" }
	component_set = ESC_BIO_MHD_CANNON_JUGGERNAUT
	projectile_gfx = "esc_tiyanki_lance"
	tags = { weapon_type_kinetic x_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_uses_bio_ships_conditional
		EXTRA_CONDITION = "ESC_ship_uses_juggernaut_components"
		EXTRA_CONDITION_VALUE = yes
		EVAL_TARGET = yes
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 1
		### AI shouldn't use this component if it can't afford at least some upgrades right away
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = volatile_motes }
		}
	}
}

# arkship
weapon_component_template = {
	key =  ESC_MHD_CANNON_ARKSHIP
	size = titanic
	icon = GFX_esc_mhd_cannon_3
	icon_frame = 1
	type = instant

    inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 7500
		MAX_DAMAGE = 16000
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_KINETIC_xl
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 40 max = 100 }
	total_fire_time = 160
	range = @ESC_WEAPON_RANGE_ARKSHIP_4
	accuracy = 0.75
	power = 0

	resources = {
		category = ship_components
		upkeep = {
			alloys = @titanic_t7_upkeep_alloys
			energy = @titanic_t7_upkeep_energy
		}
	}

	hull_damage = @ESC_WEAPON_mhd_cannon_hull_damage
	armor_penetration = @ESC_WEAPON_mhd_cannon_armor_penetration
	armor_damage = @ESC_WEAPON_mhd_cannon_armor_damage
	shield_penetration = @ESC_WEAPON_mhd_cannon_shield_penetration
	shield_damage = @ESC_WEAPON_mhd_cannon_shield_damage
	tracking = 0.05

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_3
	#use_ship_kill_target = no

	prerequisites = { "esc_tech_mhd_cannon_titanic" }
	component_set = ESC_MHD_CANNON_ARKSHIP
	projectile_gfx = "esc_mhd_cannon_3_titanic"
	tags = { weapon_type_kinetic t_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }

	inline_script = {
		script = ship_components_general/esc_inlines_titanic_standard
		ARKSHIP_WEAPON = yes
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 2
		stinger_stage_2 = 2
		stinger_stage_3 = 2
	}

	ai_weight = {
		weight = 1
	}
}
