############################################################
##                   ESC : Tesla Weapons                  ##
############################################################

# - Tesla Coil							S/M/L/X
# - Improved Tesla Coil					S/M/L/X
# - Tesla Bomb							S/M/L/X
# - Improved Tesla Bomb					S/M/L/X
# - Tesla Interdictors					S/M/L/X

############################################################
##                       Tesla Coil                       ##
############################################################

# small
weapon_component_template = {
	key = SMALL_ESC_TESLA_COIL_CREATURE_1
	size = small
	icon = GFX_esc_bio_tesla_coil_1
	icon_frame = 1
	type = instant

	damage = { min = 35 max = 80 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 0.9

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

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_shield_damage
	tracking = 0.6

	prerequisites = { "esc_tech_tesla_coil_1" }
	component_set = ESC_TESLA_COIL_CREATURE_1
	projectile_gfx = "esc_tesla_1_small"
	upgrades_to = SMALL_ESC_TESLA_COIL_CREATURE_2
	tags = { weapon_type_energy s_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull brawler gunship }

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

# medium
weapon_component_template = {
	key = MEDIUM_ESC_TESLA_COIL_CREATURE_1
	size = medium
	icon = GFX_esc_bio_tesla_coil_1
	icon_frame = 1
	type = instant

	damage = { min = 70 max = 160 }
	windup = { min = 6 max = 24 }
	total_fire_time = 35
	range = @ESC_WEAPON_RANGE_M_2
	accuracy = 0.9

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

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_shield_damage
	tracking = 0.3

	prerequisites = { "esc_tech_tesla_coil_1" }
	component_set = ESC_TESLA_COIL_CREATURE_1
	projectile_gfx = "esc_tesla_1_medium"
	upgrades_to = MEDIUM_ESC_TESLA_COIL_CREATURE_2
	tags = { weapon_type_energy m_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull brawler gunship }

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

# large
weapon_component_template = {
	key = LARGE_ESC_TESLA_COIL_CREATURE_1
	size = large
	icon = GFX_esc_bio_tesla_coil_1
	icon_frame = 1
	type = instant

	damage = { min = 180 max = 415 }
	windup = { min = 7 max = 27 }
	total_fire_time = 40
	range = @ESC_WEAPON_RANGE_L_2
	min_range = @ESC_WEAPON_MIN_RANGE_4
	accuracy = 0.9

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

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_shield_damage
	tracking = 0.1

	prerequisites = { "esc_tech_tesla_coil_1" }
	component_set = ESC_TESLA_COIL_CREATURE_1
	projectile_gfx = "esc_tesla_1_large"
	upgrades_to = LARGE_ESC_TESLA_COIL_CREATURE_2
	tags = { weapon_type_energy l_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull artillery }

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

# extra-large
weapon_component_template = {
	key = XL_ESC_TESLA_COIL_CREATURE_1
	size = extra_large
	icon = GFX_esc_bio_tesla_coil_1
	icon_frame = 1
	type = instant

	damage = { min = 360 max = 830 }
	windup = { min = 7 max = 27 }
	total_fire_time = 40
	range = @ESC_WEAPON_RANGE_L_5
	min_range = @ESC_WEAPON_MIN_RANGE_4
	accuracy = 0.9

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

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_shield_damage
	tracking = 0.1

	prerequisites = { "esc_tech_tesla_coil_1" }
	component_set = ESC_TESLA_COIL_CREATURE_1
	projectile_gfx = "esc_tesla_1_large"
	upgrades_to = XL_ESC_TESLA_COIL_CREATURE_2
	tags = { weapon_type_energy x_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull artillery }

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

############################################################
##                  Improved Tesla Coil                   ##
############################################################

# small
weapon_component_template = {
	key = SMALL_ESC_TESLA_COIL_CREATURE_2
	size = small
	icon = GFX_esc_bio_tesla_coil_2
	icon_frame = 1
	type = instant

	damage = { min = 50 max = 105 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 0.9

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = rare_crystals
	}

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_shield_damage
	tracking = 0.6

	prerequisites = { "esc_tech_tesla_coil_2" }
	component_set = ESC_TESLA_COIL_CREATURE_2
	projectile_gfx = "esc_tesla_2_small"
	tags = { weapon_type_energy s_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull brawler gunship }

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

# medium
weapon_component_template = {
	key = MEDIUM_ESC_TESLA_COIL_CREATURE_2
	size = medium
	icon = GFX_esc_bio_tesla_coil_2
	icon_frame = 1
	type = instant

	damage = { min = 115 max = 265 }
	windup = { min = 6 max = 24 }
	total_fire_time = 35
	range = @ESC_WEAPON_RANGE_M_2
	accuracy = 0.9

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = rare_crystals
	}

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_shield_damage
	tracking = 0.3

	prerequisites = { "esc_tech_tesla_coil_2" }
	component_set = ESC_TESLA_COIL_CREATURE_2
	projectile_gfx = "esc_tesla_2_medium"
	tags = { weapon_type_energy m_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull brawler gunship }

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

# large
weapon_component_template = {
	key = LARGE_ESC_TESLA_COIL_CREATURE_2
	size = large
	icon = GFX_esc_bio_tesla_coil_2
	icon_frame = 1
	type = instant

	damage = { min = 260 max = 530 }
	windup = { min = 7 max = 27 }
	total_fire_time = 40
	range = @ESC_WEAPON_RANGE_L_2
	min_range = @ESC_WEAPON_MIN_RANGE_4
	accuracy = 0.9

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

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_shield_damage
	tracking = 0.1

	prerequisites = { "esc_tech_tesla_coil_2" }
	component_set = ESC_TESLA_COIL_CREATURE_2
	projectile_gfx = "esc_tesla_2_large"
	tags = { weapon_type_energy l_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull artillery }

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

# extra-large
weapon_component_template = {
	key = XL_ESC_TESLA_COIL_CREATURE_2
	size = extra_large
	icon = GFX_esc_bio_tesla_coil_2
	icon_frame = 1
	type = instant

	damage = { min = 260 max = 530 }
	windup = { min = 7 max = 27 }
	total_fire_time = 40
	range = @ESC_WEAPON_RANGE_L_5
	min_range = @ESC_WEAPON_MIN_RANGE_4
	accuracy = 0.9

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

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_shield_damage
	tracking = 0.1

	prerequisites = { "esc_tech_tesla_coil_2" }
	component_set = ESC_TESLA_COIL_CREATURE_2
	projectile_gfx = "esc_tesla_2_large"
	tags = { weapon_type_energy x_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull artillery }

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

############################################################
##                        Tesla Bomb                      ##
############################################################

# small
weapon_component_template = {
	key = SMALL_ESC_TESLA_BOMB_CREATURE_1
	size = small
	icon = GFX_esc_bio_tesla_bomb_1
	icon_frame = 1
	type = missile

	damage = { min = 50 max = 65 }
	size_damage_factor = 0.2
	windup = { min = 5 max = 10 }
	total_fire_time = 100
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 1.0
	missile_speed = @ESC_MISSILE_SPEED_2
	missile_evasion = 0.1
	missile_health = 15
	missile_armor = 10
	missile_shield = 0
	missile_retarget_range = @ESC_WEAPON_RANGE_G_2
	firing_arc = 25.0

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

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_bomb_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_bomb_shield_damage
	tracking = 0.2

	prerequisites = { "esc_tech_tesla_bomb_1" }
	component_set = ESC_TESLA_BOMB_CREATURE_1
	projectile_gfx = "esc_tesla_bomb_1_missile"
	upgrades_to = SMALL_ESC_TESLA_BOMB_CREATURE_2
	tags = { weapon_type_energy s_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull weapon_role_artillery energy_torpedoes energy_torpedoes_stealth artillery artillery_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_missiles_special

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

# medium
weapon_component_template = {
	key = MEDIUM_ESC_TESLA_BOMB_CREATURE_1
	size = medium
	icon = GFX_esc_bio_tesla_bomb_1
	icon_frame = 1
	type = missile

	damage = { min = 100 max = 125 }
	size_damage_factor = 0.2
	windup = { min = 5 max = 10 }
	total_fire_time = 100
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 1.0
	missile_speed = @ESC_MISSILE_SPEED_2
	missile_evasion = 0.1
	missile_health = 15
	missile_armor = 10
	missile_shield = 0
	missile_retarget_range = @ESC_WEAPON_RANGE_G_2
	firing_arc = 25.0

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

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_bomb_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_bomb_shield_damage
	tracking = 0.2

	prerequisites = { "esc_tech_tesla_bomb_1" }
	component_set = ESC_TESLA_BOMB_CREATURE_1
	projectile_gfx = "esc_tesla_bomb_1_missile"
	upgrades_to = MEDIUM_ESC_TESLA_BOMB_CREATURE_2
	tags = { weapon_type_energy m_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull weapon_role_artillery energy_torpedoes energy_torpedoes_stealth artillery artillery_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_missiles_special

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

# large
weapon_component_template = {
	key = LARGE_ESC_TESLA_BOMB_CREATURE_1
	size = large
	icon = GFX_esc_bio_tesla_bomb_1
	icon_frame = 1
	type = missile

	damage = { min = 200 max = 250 }
	size_damage_factor = 0.2
	windup = { min = 5 max = 10 }
	total_fire_time = 100
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 1.0
	missile_speed = @ESC_MISSILE_SPEED_2
	missile_evasion = 0.1
	missile_health = 15
	missile_armor = 10
	missile_shield = 0
	missile_retarget_range = @ESC_WEAPON_RANGE_G_2
	firing_arc = 25.0

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

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_bomb_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_bomb_shield_damage
	tracking = 0.2

	prerequisites = { "esc_tech_tesla_bomb_1" }
	component_set = ESC_TESLA_BOMB_CREATURE_1
	projectile_gfx = "esc_tesla_bomb_1_missile"
	upgrades_to = LARGE_ESC_TESLA_BOMB_CREATURE_2
	tags = { weapon_type_energy l_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull weapon_role_artillery energy_torpedoes energy_torpedoes_stealth artillery artillery_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_missiles_special

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

# extra-large
weapon_component_template = {
	key = XL_ESC_TESLA_BOMB_CREATURE_1
	size = extra_large
	icon = GFX_esc_bio_tesla_bomb_1
	icon_frame = 1
	type = missile

	damage = { min = 400 max = 500 }
	size_damage_factor = 0.2
	windup = { min = 5 max = 10 }
	total_fire_time = 100
	range = @ESC_WEAPON_RANGE_S_3
	accuracy = 1.0
	missile_speed = @ESC_MISSILE_SPEED_2
	missile_evasion = 0.1
	missile_health = 15
	missile_armor = 10
	missile_shield = 0
	missile_retarget_range = @ESC_WEAPON_RANGE_G_2
	firing_arc = 25.0

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

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_bomb_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_bomb_shield_damage
	tracking = 0.2

	prerequisites = { "esc_tech_tesla_bomb_1" }
	component_set = ESC_TESLA_BOMB_CREATURE_1
	projectile_gfx = "esc_tesla_bomb_1_missile"
	upgrades_to = XL_ESC_TESLA_BOMB_CREATURE_2
	tags = { weapon_type_energy x_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull weapon_role_artillery energy_torpedoes energy_torpedoes_stealth artillery artillery_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_missiles_special

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

############################################################
##                   Improved Tesla Bomb                  ##
############################################################

# small
weapon_component_template = {
	key = SMALL_ESC_TESLA_BOMB_CREATURE_2
	size = small
	icon = GFX_esc_bio_tesla_bomb_2
	icon_frame = 1
	type = missile

	damage = { min = 65 max = 76 }
	size_damage_factor = 0.2
	windup = { min = 5 max = 10 }
	total_fire_time = 100
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 1.0
	missile_speed = @ESC_MISSILE_SPEED_2
	missile_evasion = 0.1
	missile_health = 18
	missile_armor = 12
	missile_shield = 0
	missile_retarget_range = @ESC_WEAPON_RANGE_G_2
	firing_arc = 25.0

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = s
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = rare_crystals
	}

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_bomb_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_bomb_shield_damage
	tracking = 0.2

	prerequisites = { "esc_tech_tesla_bomb_2" }
	component_set = ESC_TESLA_BOMB_CREATURE_2
	projectile_gfx = "esc_tesla_bomb_2_missile"
	tags = { weapon_type_energy s_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull weapon_role_artillery energy_torpedoes energy_torpedoes_stealth artillery artillery_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_missiles_special

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

# medium
weapon_component_template = {
	key = MEDIUM_ESC_TESLA_BOMB_CREATURE_2
	size = medium
	icon = GFX_esc_bio_tesla_bomb_2
	icon_frame = 1
	type = missile

	damage = { min = 125 max = 150 }
	size_damage_factor = 0.2
	windup = { min = 5 max = 10 }
	total_fire_time = 100
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 1.0
	missile_speed = @ESC_MISSILE_SPEED_2
	missile_evasion = 0.1
	missile_health = 18
	missile_armor = 12
	missile_shield = 0
	missile_retarget_range = @ESC_WEAPON_RANGE_G_2
	firing_arc = 25.0

	inline_script = {
		script = component_costs/shorthands/esc_inlines_standard_cost
		COMPONENT_TYPE = WEAPON
		SIZE = m
		TIER = 8
		STRATEGIC_RESOURCE_TYPE = rare_crystals
	}

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_bomb_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_bomb_shield_damage
	tracking = 0.2

	prerequisites = { "esc_tech_tesla_bomb_2" }
	component_set = ESC_TESLA_BOMB_CREATURE_2
	projectile_gfx = "esc_tesla_bomb_2_missile"
	tags = { weapon_type_energy m_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull weapon_role_artillery energy_torpedoes energy_torpedoes_stealth artillery artillery_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_missiles_special

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

# large
weapon_component_template = {
	key = LARGE_ESC_TESLA_BOMB_CREATURE_2
	size = large
	icon = GFX_esc_bio_tesla_bomb_2
	icon_frame = 1
	type = missile

	damage = { min = 250 max = 300 }
	size_damage_factor = 0.2
	windup = { min = 5 max = 10 }
	total_fire_time = 100
	range = @ESC_WEAPON_RANGE_S_2
	accuracy = 1.0
	missile_speed = @ESC_MISSILE_SPEED_2
	missile_evasion = 0.1
	missile_health = 18
	missile_armor = 12
	missile_shield = 0
	missile_retarget_range = @ESC_WEAPON_RANGE_G_2
	firing_arc = 25.0

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

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_bomb_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_bomb_shield_damage
	tracking = 0.2

	prerequisites = { "esc_tech_tesla_bomb_2" }
	component_set = ESC_TESLA_BOMB_CREATURE_2
	projectile_gfx = "esc_tesla_bomb_2_missile"
	tags = { weapon_type_energy l_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull weapon_role_artillery energy_torpedoes energy_torpedoes_stealth artillery artillery_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_missiles_special

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

# extra-large
weapon_component_template = {
	key = XL_ESC_TESLA_BOMB_CREATURE_2
	size = extra_large
	icon = GFX_esc_bio_tesla_bomb_2
	icon_frame = 1
	type = missile

	damage = { min = 500 max = 600 }
	size_damage_factor = 0.2
	windup = { min = 5 max = 10 }
	total_fire_time = 100
	range = @ESC_WEAPON_RANGE_S_3
	accuracy = 1.0
	missile_speed = @ESC_MISSILE_SPEED_2
	missile_evasion = 0.1
	missile_health = 18
	missile_armor = 12
	missile_shield = 0
	missile_retarget_range = @ESC_WEAPON_RANGE_G_2
	firing_arc = 25.0

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

	hull_damage = @ESC_WEAPON_tesla_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_bomb_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_bomb_shield_damage
	tracking = 0.2

	prerequisites = { "esc_tech_tesla_bomb_2" }
	component_set = ESC_TESLA_BOMB_CREATURE_2
	projectile_gfx = "esc_tesla_bomb_2_missile"
	tags = { weapon_type_energy x_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_anti_hull weapon_role_artillery energy_torpedoes energy_torpedoes_stealth artillery artillery_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_missiles_special

	inline_script = {
		script = weapon_effects/esc_fire_rate_debuff
		EFFECT_LEVEL = 1
	}

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

############################################################
##                    Tesla Interdictor                   ##
############################################################

# small
strike_craft_component_template = {
	key = SMALL_ESC_TESLA_INTERDICTOR_CREATURE
	size = small
	entity = "space_amoeba_small_entity"
	icon = GFX_esc_bio_tesla_strikecraft
	icon_frame = 1

	weapon_type = point_defence
	projectile_gfx = "esc_tesla_1_tiny"

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

	count = 2 # @ESC_STRIKECRAFT_count_small
	regeneration_per_day = @ESC_STRIKECRAFT_regen
	launch_time = @ESC_STRIKECRAFT_launch_time

	damage = { min = 20 max = 30 }
	cooldown = 2.0
	range = @ESC_STRIKECRAFT_attack_range_fighter
	engagement_range = @ESC_STRIKECRAFT_engagement_range
	accuracy = @ESC_STRIKECRAFT_accuracy
	tracking = @ESC_STRIKECRAFT_tracking_fighter

	health = 30
	armor = 10
	shield = 50

	speed = @ESC_STRIKECRAFT_speed_5
	rotation_speed = @ESC_STRIKECRAFT_rot_speed_fighter
	acceleration = @ESC_STRIKECRAFT_acceleration_fighter
	evasion = @ESC_STRIKECRAFT_evasion

	hull_damage = @ESC_WEAPON_tesla_interdictor_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_interdictor_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_interdictor_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_interdictor_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_interdictor_shield_damage

	ship_behavior = "fighters_behavior"
	component_set = ESC_TESLA_INTERDICTOR_CREATURE
	prerequisites = { "esc_tech_tesla_interdictor" }
	tags = { weapon_type_strike_craft s_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_point_defense carrier }
	point_defence_targets = { "strike_craft" }

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

# medium
strike_craft_component_template = {
	key = MEDIUM_ESC_TESLA_INTERDICTOR_CREATURE
	size = medium
	entity = "space_amoeba_small_entity"
	icon = GFX_esc_bio_tesla_strikecraft
	icon_frame = 1

	weapon_type = point_defence
	projectile_gfx = "esc_tesla_1_tiny"

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

	count = 4 # @ESC_STRIKECRAFT_count_medium
	regeneration_per_day = @ESC_STRIKECRAFT_regen
	launch_time = @ESC_STRIKECRAFT_launch_time

	damage = { min = 20 max = 30 }
	cooldown = 2.0
	range = @ESC_STRIKECRAFT_attack_range_fighter
	engagement_range = @ESC_STRIKECRAFT_engagement_range
	accuracy = @ESC_STRIKECRAFT_accuracy
	tracking = @ESC_STRIKECRAFT_tracking_fighter

	health = 30
	armor = 10
	shield = 50

	speed = @ESC_STRIKECRAFT_speed_5
	rotation_speed = @ESC_STRIKECRAFT_rot_speed_fighter
	acceleration = @ESC_STRIKECRAFT_acceleration_fighter
	evasion = @ESC_STRIKECRAFT_evasion

	hull_damage = @ESC_WEAPON_tesla_interdictor_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_interdictor_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_interdictor_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_interdictor_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_interdictor_shield_damage

	ship_behavior = "fighters_behavior"
	component_set = ESC_TESLA_INTERDICTOR_CREATURE
	prerequisites = { "esc_tech_tesla_interdictor" }
	tags = { weapon_type_strike_craft m_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_point_defense carrier }
	point_defence_targets = { "strike_craft" }

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

# large
strike_craft_component_template = {
	key = LARGE_ESC_TESLA_INTERDICTOR_CREATURE
	size = large
	entity = "space_amoeba_small_entity"
	icon = GFX_esc_bio_tesla_strikecraft
	icon_frame = 1

	weapon_type = point_defence
	projectile_gfx = "esc_tesla_1_tiny"

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

	count = @ESC_STRIKECRAFT_count_large
	regeneration_per_day = @ESC_STRIKECRAFT_regen
	launch_time = @ESC_STRIKECRAFT_launch_time

	damage = { min = 20 max = 30 }
	cooldown = 2.0
	range = @ESC_STRIKECRAFT_attack_range_fighter
	engagement_range = @ESC_STRIKECRAFT_engagement_range
	accuracy = @ESC_STRIKECRAFT_accuracy
	tracking = @ESC_STRIKECRAFT_tracking_fighter

	health = 30
	armor = 10
	shield = 50

	speed = @ESC_STRIKECRAFT_speed_5
	rotation_speed = @ESC_STRIKECRAFT_rot_speed_fighter
	acceleration = @ESC_STRIKECRAFT_acceleration_fighter
	evasion = @ESC_STRIKECRAFT_evasion

	hull_damage = @ESC_WEAPON_tesla_interdictor_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_interdictor_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_interdictor_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_interdictor_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_interdictor_shield_damage

	ship_behavior = "fighters_behavior"
	component_set = ESC_TESLA_INTERDICTOR_CREATURE
	prerequisites = { "esc_tech_tesla_interdictor" }
	tags = { weapon_type_strike_craft l_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_point_defense carrier }
	point_defence_targets = { "strike_craft" }

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}

# extra_large
strike_craft_component_template = {
	key = XL_ESC_TESLA_INTERDICTOR_CREATURE
	size = extra_large
	entity = "space_amoeba_small_entity"
	icon = GFX_esc_bio_tesla_strikecraft
	icon_frame = 1

	weapon_type = point_defence
	projectile_gfx = "esc_tesla_1_tiny"

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

	count = 16 # @ESC_STRIKECRAFT_count_xl
	regeneration_per_day = @ESC_STRIKECRAFT_regen
	launch_time = @ESC_STRIKECRAFT_launch_time

	damage = { min = 20 max = 30 }
	cooldown = 2.0
	range = @ESC_STRIKECRAFT_attack_range_fighter
	engagement_range = @ESC_STRIKECRAFT_engagement_range
	accuracy = @ESC_STRIKECRAFT_accuracy
	tracking = @ESC_STRIKECRAFT_tracking_fighter

	health = 30
	armor = 10
	shield = 50

	speed = @ESC_STRIKECRAFT_speed_5
	rotation_speed = @ESC_STRIKECRAFT_rot_speed_fighter
	acceleration = @ESC_STRIKECRAFT_acceleration_fighter
	evasion = @ESC_STRIKECRAFT_evasion

	hull_damage = @ESC_WEAPON_tesla_interdictor_hull_damage
	armor_penetration = @ESC_WEAPON_tesla_interdictor_armor_penetration
	armor_damage = @ESC_WEAPON_tesla_interdictor_armor_damage
	shield_penetration = @ESC_WEAPON_tesla_interdictor_shield_penetration
	shield_damage = @ESC_WEAPON_tesla_interdictor_shield_damage

	ship_behavior = "fighters_behavior"
	component_set = ESC_TESLA_INTERDICTOR_CREATURE
	prerequisites = { "esc_tech_tesla_interdictor" }
	tags = { weapon_type_strike_craft x_slot weapon_type_space_fauna }
	ai_tags = { weapon_role_point_defense carrier }
	point_defence_targets = { "strike_craft" }

	# only regular empires and machine FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_machine_fe = 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 = rare_crystals }
		}
	}
}
