############################################################
##                 ESC : Gravitic Weapons                 ##
############################################################

# - Gravitational Anomaly Projector		S/M/L
# - Microsingularity Cannon				S/M/L
# - Spatial Distortion Warhead			G
# - Microsingularity Warhead			G
# - Super-Graviton Cannon				X
# - Focused Super-Graviton Cannon		X
# - Titanic Super-Graviton Cannon		Titanic
# - Singulatiry Bombers					H

############################################################
##             Gravitational Anomaly Projector            ##
############################################################

# small
weapon_component_template = {
	key = SMALL_ESC_GRAVITY_CANNON_1
	size = small
	icon = GFX_esc_gravitic_cannon_1
	icon_frame = 1
	type = instant

	damage = { min = 34 max = 66 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_S_2
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_gravity_cannon_1" }
	component_set = ESC_GRAVITY_CANNON_1
	projectile_gfx = "esc_gravity_cannon_small"
	upgrades_to = SMALL_ESC_GRAVITY_CANNON_2
	tags = { weapon_type_energy s_slot }
	ai_tags = { weapon_role_anti_shield gunship brawler }

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

weapon_component_template = {
	key = SMALL_ESC_BIO_GRAVITY_CANNON_1
	size = small
	icon = GFX_esc_bio_gravitic_cannon_1
	icon_frame = 1
	type = instant

	damage = { min = 34 max = 66 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_S_2
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_gravity_cannon_1" }
	component_set = ESC_BIO_GRAVITY_CANNON_1
	projectile_gfx = "esc_gravity_cannon_small"
	upgrades_to = SMALL_ESC_BIO_GRAVITY_CANNON_2
	tags = { weapon_type_energy s_slot }
	ai_tags = { weapon_role_anti_shield gunship brawler }

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

# medium
weapon_component_template = {
	key = MEDIUM_ESC_GRAVITY_CANNON_1
	size = medium
	icon = GFX_esc_gravitic_cannon_1
	icon_frame = 1
	type = instant

	damage = { min = 68 max = 138 }
	windup = { min = 6 max = 24 }
	total_fire_time = 35
	range = @ESC_WEAPON_RANGE_M_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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.25

	prerequisites = { "esc_tech_gravity_cannon_1" }
	component_set = ESC_GRAVITY_CANNON_1
	projectile_gfx = "esc_gravity_cannon_medium"
	upgrades_to = MEDIUM_ESC_GRAVITY_CANNON_2
	tags = { weapon_type_energy m_slot }
	ai_tags = { weapon_role_anti_shield gunship brawler }

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

weapon_component_template = {
	key = MEDIUM_ESC_BIO_GRAVITY_CANNON_1
	size = medium
	icon = GFX_esc_bio_gravitic_cannon_1
	icon_frame = 1
	type = instant

	damage = { min = 68 max = 138 }
	windup = { min = 6 max = 24 }
	total_fire_time = 35
	range = @ESC_WEAPON_RANGE_M_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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.25

	prerequisites = { "esc_tech_gravity_cannon_1" }
	component_set = ESC_BIO_GRAVITY_CANNON_1
	projectile_gfx = "esc_gravity_cannon_medium"
	upgrades_to = MEDIUM_ESC_BIO_GRAVITY_CANNON_2
	tags = { weapon_type_energy m_slot }
	ai_tags = { weapon_role_anti_shield gunship brawler }

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

# large
weapon_component_template = {
	key = LARGE_ESC_GRAVITY_CANNON_1
	size = large
	icon = GFX_esc_gravitic_cannon_1
	icon_frame = 1
	type = instant

	damage = { min = 182 max = 358 }
	windup = { min = 7 max = 27 }
	total_fire_time = 40
	range = @ESC_WEAPON_RANGE_L_2
	min_range = @ESC_WEAPON_MIN_RANGE_4
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_gravity_cannon_1" }
	component_set = ESC_GRAVITY_CANNON_1
	projectile_gfx = "esc_gravity_cannon_large"
	upgrades_to = LARGE_ESC_GRAVITY_CANNON_2
	tags = { weapon_type_energy l_slot }
	ai_tags = { weapon_role_anti_shield artillery }

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

weapon_component_template = {
	key = LARGE_ESC_BIO_GRAVITY_CANNON_1
	size = large
	icon = GFX_esc_bio_gravitic_cannon_1
	icon_frame = 1
	type = instant

	damage = { min = 182 max = 358 }
	windup = { min = 7 max = 27 }
	total_fire_time = 40
	range = @ESC_WEAPON_RANGE_L_2
	min_range = @ESC_WEAPON_MIN_RANGE_4
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_gravity_cannon_1" }
	component_set = ESC_BIO_GRAVITY_CANNON_1
	projectile_gfx = "esc_gravity_cannon_large"
	upgrades_to = LARGE_ESC_BIO_GRAVITY_CANNON_2
	tags = { weapon_type_energy l_slot }
	ai_tags = { weapon_role_anti_shield artillery }

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

############################################################
##                Microsingularity Cannon                 ##
############################################################

# small
weapon_component_template = {
	key = SMALL_ESC_GRAVITY_CANNON_2
	size = small
	icon = GFX_esc_gravitic_cannon_2
	icon_frame = 1
	type = instant

	damage = { min = 48 max = 88 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_S_2
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_gravity_cannon_2" }
	component_set = ESC_GRAVITY_CANNON_2
	projectile_gfx = "esc_gravity_cannon_small"
	tags = { weapon_type_energy s_slot }
	ai_tags = { weapon_role_anti_shield gunship brawler }

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

weapon_component_template = {
	key = SMALL_ESC_BIO_GRAVITY_CANNON_2
	size = small
	icon = GFX_esc_bio_gravitic_cannon_2
	icon_frame = 1
	type = instant

	damage = { min = 48 max = 88 }
	windup = { min = 5 max = 20 }
	total_fire_time = 30
	range = @ESC_WEAPON_RANGE_S_2
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.5

	prerequisites = { "esc_tech_gravity_cannon_2" }
	component_set = ESC_BIO_GRAVITY_CANNON_2
	projectile_gfx = "esc_gravity_cannon_small"
	tags = { weapon_type_energy s_slot }
	ai_tags = { weapon_role_anti_shield gunship brawler }

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

# medium
weapon_component_template = {
	key = MEDIUM_ESC_GRAVITY_CANNON_2
	size = medium
	icon = GFX_esc_gravitic_cannon_2
	icon_frame = 1
	type = instant

	damage = { min = 106 max = 242 }
	windup = { min = 6 max = 24 }
	total_fire_time = 35
	range = @ESC_WEAPON_RANGE_M_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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.25

	prerequisites = { "esc_tech_gravity_cannon_2" }
	component_set = ESC_GRAVITY_CANNON_2
	projectile_gfx = "esc_gravity_cannon_medium"
	tags = { weapon_type_energy m_slot }
	ai_tags = { weapon_role_anti_shield gunship brawler }

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

weapon_component_template = {
	key = MEDIUM_ESC_BIO_GRAVITY_CANNON_2
	size = medium
	icon = GFX_esc_bio_gravitic_cannon_2
	icon_frame = 1
	type = instant

	damage = { min = 106 max = 242 }
	windup = { min = 6 max = 24 }
	total_fire_time = 35
	range = @ESC_WEAPON_RANGE_M_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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.25

	prerequisites = { "esc_tech_gravity_cannon_2" }
	component_set = ESC_BIO_GRAVITY_CANNON_2
	projectile_gfx = "esc_gravity_cannon_medium"
	tags = { weapon_type_energy m_slot }
	ai_tags = { weapon_role_anti_shield gunship brawler }

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

# large
weapon_component_template = {
	key = LARGE_ESC_GRAVITY_CANNON_2
	size = large
	icon = GFX_esc_gravitic_cannon_2
	icon_frame = 1
	type = instant

	damage = { min = 256 max = 488 }
	windup = { min = 7 max = 27 }
	total_fire_time = 40
	range = @ESC_WEAPON_RANGE_L_2
	min_range = @ESC_WEAPON_MIN_RANGE_4
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_gravity_cannon_2" }
	component_set = ESC_GRAVITY_CANNON_2
	projectile_gfx = "esc_gravity_cannon_large"
	tags = { weapon_type_energy l_slot }
	ai_tags = { weapon_role_anti_shield artillery }

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

weapon_component_template = {
	key = LARGE_ESC_BIO_GRAVITY_CANNON_2
	size = large
	icon = GFX_esc_bio_gravitic_cannon_2
	icon_frame = 1
	type = instant

	damage = { min = 256 max = 488 }
	windup = { min = 7 max = 27 }
	total_fire_time = 40
	range = @ESC_WEAPON_RANGE_L_2
	min_range = @ESC_WEAPON_MIN_RANGE_4
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_gravity_cannon_2" }
	component_set = ESC_BIO_GRAVITY_CANNON_2
	projectile_gfx = "esc_gravity_cannon_large"
	tags = { weapon_type_energy l_slot }
	ai_tags = { weapon_role_anti_shield artillery }

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

############################################################
##               Spatial Distortion Warhead               ##
############################################################

weapon_component_template = {
	key = ESC_GRAVITY_TORPS_1
	size = torpedo
	icon = GFX_esc_gravitic_torpedo_1
	icon_frame = 1
	type = missile

	damage = { min = 115 max = 155 }
	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
	power = -70

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

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.2

	prerequisites = { "esc_tech_gravity_torpedo_1" }
	component_set = ESC_GRAVITY_TORPS_1
	projectile_gfx = "esc_gravitic_torpedoes"
	upgrades_to = ESC_GRAVITY_TORPS_2
	tags = { weapon_type_explosive weapon_type_energy g_slot }
	ai_tags = { weapon_role_anti_shield weapon_role_artillery artillery artillery_stealth energy_torpedoes energy_torpedoes_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_missiles_special

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_GRAVITY_TORPS_1
	size = torpedo
	icon = GFX_esc_bio_gravitic_torpedo_1
	icon_frame = 1
	type = missile

	damage = { min = 115 max = 155 }
	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
	power = -70

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

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.2

	prerequisites = { "esc_tech_gravity_torpedo_1" }
	component_set = ESC_BIO_GRAVITY_TORPS_1
	projectile_gfx = "esc_gravitic_torpedoes"
	upgrades_to = ESC_BIO_GRAVITY_TORPS_2
	tags = { weapon_type_explosive weapon_type_energy g_slot }
	ai_tags = { weapon_role_anti_shield weapon_role_artillery artillery artillery_stealth energy_torpedoes energy_torpedoes_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_missiles_special

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

############################################################
##                Microsingularity  Warhead               ##
############################################################

weapon_component_template = {
	key = ESC_GRAVITY_TORPS_2
	size = torpedo
	icon = GFX_esc_gravitic_torpedo_2
	icon_frame = 1
	type = missile

	damage = { min = 150 max = 215 }
	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
	power = -80

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

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.2

	prerequisites = { "esc_tech_gravity_torpedo_2" }
	component_set = ESC_GRAVITY_TORPS_2
	projectile_gfx = "esc_gravitic_torpedoes"
	tags = { weapon_type_explosive weapon_type_energy g_slot }
	ai_tags = { weapon_role_anti_shield weapon_role_artillery artillery artillery_stealth energy_torpedoes energy_torpedoes_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_missiles_special

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_GRAVITY_TORPS_2
	size = torpedo
	icon = GFX_esc_bio_gravitic_torpedo_2
	icon_frame = 1
	type = missile

	damage = { min = 150 max = 215 }
	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
	power = -80

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

	hull_damage = @ESC_WEAPON_gravitic_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.2

	prerequisites = { "esc_tech_gravity_torpedo_2" }
	component_set = ESC_BIO_GRAVITY_TORPS_2
	projectile_gfx = "esc_gravitic_torpedoes"
	tags = { weapon_type_explosive weapon_type_energy g_slot }
	ai_tags = { weapon_role_anti_shield weapon_role_artillery artillery artillery_stealth energy_torpedoes energy_torpedoes_stealth }
	military_power_multiplier = @ESC_MILITARY_POWER_MULT_missiles_special

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

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

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

############################################################
##                 Super-Graviton Cannon                  ##
############################################################

weapon_component_template = {
	key = ESC_GRAVITY_LANCE_1
	size = extra_large
	icon = GFX_esc_gravitic_lance_1
	icon_frame = 1
	type = instant

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_2
	#use_ship_kill_target = no

	damage = { min = 1300 max = 2600 }
	windup = { min = 12 max = 47 }
	total_fire_time = 70
	range = @ESC_WEAPON_RANGE_X_3
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_lance_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_gravity_lance_1" }
	component_set = ESC_GRAVITY_LANCE_1
	projectile_gfx = "esc_gravity_lance"
	upgrades_to = ESC_GRAVITY_LANCE_2
	tags = { weapon_type_energy 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
	}

	inline_script = {
		script = weapon_effects/esc_evasion_debuff
		EFFECT_LEVEL = 2
	}

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_fe = 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 = sr_dark_matter }
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_GRAVITY_LANCE_1
	size = extra_large
	icon = GFX_esc_bio_gravitic_lance_1
	icon_frame = 1
	type = instant

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_2
	#use_ship_kill_target = no

	damage = { min = 1300 max = 2600 }
	windup = { min = 12 max = 47 }
	total_fire_time = 70
	range = @ESC_WEAPON_RANGE_X_3
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_lance_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_gravity_lance_1" }
	component_set = ESC_BIO_GRAVITY_LANCE_1
	projectile_gfx = "esc_gravity_lance"
	upgrades_to = ESC_BIO_GRAVITY_LANCE_2
	tags = { weapon_type_energy 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
	}

	inline_script = {
		script = weapon_effects/esc_evasion_debuff
		EFFECT_LEVEL = 2
	}

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_fe = 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 = sr_dark_matter }
		}
	}
}

############################################################
##            Focused Super-Graviton Cannon               ##
############################################################

weapon_component_template = {
	key = ESC_GRAVITY_LANCE_2
	size = extra_large
	icon = GFX_esc_gravitic_lance_2
	icon_frame = 1
	type = instant

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_2
	#use_ship_kill_target = no

	damage = { min = 1600 max = 2800 }
	windup = { min = 12 max = 47 }
	total_fire_time = 70
	range = @ESC_WEAPON_RANGE_X_3
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_lance_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_gravity_lance_2" }
	component_set = ESC_GRAVITY_LANCE_2
	projectile_gfx = "esc_gravity_lance"
	upgrades_to = ESC_GRAVITY_LANCE_JUGGERNAUT
	tags = { weapon_type_energy 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
	}

	inline_script = {
		script = weapon_effects/esc_evasion_debuff
		EFFECT_LEVEL = 2
	}

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_fe = 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 = sr_dark_matter }
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_GRAVITY_LANCE_2
	size = extra_large
	icon = GFX_esc_bio_gravitic_lance_2
	icon_frame = 1
	type = instant

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_2
	#use_ship_kill_target = no

	damage = { min = 1600 max = 2800 }
	windup = { min = 12 max = 47 }
	total_fire_time = 70
	range = @ESC_WEAPON_RANGE_X_3
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_lance_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_gravity_lance_2" }
	component_set = ESC_BIO_GRAVITY_LANCE_2
	projectile_gfx = "esc_gravity_lance"
	upgrades_to = ESC_BIO_GRAVITY_LANCE_JUGGERNAUT
	tags = { weapon_type_energy 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
	}

	inline_script = {
		script = weapon_effects/esc_evasion_debuff
		EFFECT_LEVEL = 2
	}

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_fe = 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 = sr_dark_matter }
		}
	}
}

############################################################
##            Titanic Super-Graviton Cannon               ##
############################################################

# titan
weapon_component_template = {
	key = ESC_GRAVITY_LANCE_TITANIC
	size = titanic
	icon = GFX_esc_gravitic_lance_3
	icon_frame = 1
	type = instant

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_3
	#use_ship_kill_target = no

	inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 5000
		MAX_DAMAGE = 9500
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_ENERGY_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 30 max = 100 }
	total_fire_time = 165
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_lance_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_gravity_lance_titanic" }
	component_set = ESC_GRAVITY_LANCE_TITANIC
	projectile_gfx = "esc_gravity_lance_titanic"
	tags = { weapon_type_energy 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
	}

	inline_script = {
		script = weapon_effects/esc_evasion_debuff
		EFFECT_LEVEL = 2
	}

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_fe = 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 = sr_dark_matter }
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_GRAVITY_LANCE_TITANIC
	size = titanic
	icon = GFX_esc_bio_gravitic_lance_3
	icon_frame = 1
	type = instant

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_3
	#use_ship_kill_target = no

	inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 5000
		MAX_DAMAGE = 9500
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_ENERGY_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 30 max = 100 }
	total_fire_time = 165
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_lance_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_gravity_lance_titanic" }
	component_set = ESC_BIO_GRAVITY_LANCE_TITANIC
	projectile_gfx = "esc_gravity_lance_titanic"
	tags = { weapon_type_energy 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
	}

	inline_script = {
		script = weapon_effects/esc_evasion_debuff
		EFFECT_LEVEL = 2
	}

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_fe = 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 = sr_dark_matter }
		}
	}
}

# juggernaut
weapon_component_template = {
	key = ESC_GRAVITY_LANCE_JUGGERNAUT
	size = extra_large
	icon = GFX_esc_gravitic_lance_3
	icon_frame = 1
	type = instant

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_3
	#use_ship_kill_target = no

	inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 5000
		MAX_DAMAGE = 9500
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_ENERGY_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 30 max = 100 }
	total_fire_time = 165
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_lance_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_gravity_lance_titanic" }
	component_set = ESC_GRAVITY_LANCE_JUGGERNAUT
	projectile_gfx = "esc_gravity_lance"
	tags = { weapon_type_energy 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
	}

	inline_script = {
		script = weapon_effects/esc_evasion_debuff
		EFFECT_LEVEL = 2
	}

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_fe = 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 = sr_dark_matter }
		}
	}
}

weapon_component_template = {
	key = ESC_BIO_GRAVITY_LANCE_JUGGERNAUT
	size = extra_large
	icon = GFX_esc_bio_gravitic_lance_3
	icon_frame = 1
	type = instant

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_3
	#use_ship_kill_target = no

	inline_script = { # damage and collateral damage
		script = weapon_effects/esc_inlines_collateral_damage
		MIN_DAMAGE = 5000
		MAX_DAMAGE = 9500
		COLLATERAL_RANGE = @ESC_COLLATERAL_RANGE_ENERGY_t
		COLLATERAL_SCALE_MULTIPLIER = @ESC_COLLATERAL_MULTIPLIER
	}

	windup = { min = 30 max = 100 }
	total_fire_time = 165
	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 = sr_dark_matter
	}

	hull_damage = @ESC_WEAPON_gravitic_lance_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_gravity_lance_titanic" }
	component_set = ESC_BIO_GRAVITY_LANCE_JUGGERNAUT
	projectile_gfx = "esc_gravity_lance"
	tags = { weapon_type_energy 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
	}

	inline_script = {
		script = weapon_effects/esc_evasion_debuff
		EFFECT_LEVEL = 2
	}

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_fe = 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 = sr_dark_matter }
		}
	}
}

# arkship
weapon_component_template = {
	key = ESC_GRAVITY_LANCE_ARKSHIP
	size = titanic
	icon = GFX_esc_gravitic_lance_3
	icon_frame = 1
	type = instant

	firing_arc = 25.0
	min_range = @ESC_WEAPON_MIN_RANGE_3
	#use_ship_kill_target = no

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

	windup = { min = 30 max = 100 }
	total_fire_time = 165
	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_gravitic_lance_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_shield_damage
	tracking = 0.05

	prerequisites = { "esc_tech_gravity_lance_titanic" }
	component_set = ESC_GRAVITY_LANCE_ARKSHIP
	projectile_gfx = "esc_gravity_lance_titanic"
	tags = { weapon_type_energy t_slot weapon_role_artillery }
	ai_tags = { weapon_role_artillery artillery }

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

	inline_script = {
		script = weapon_effects/esc_evasion_debuff
		EFFECT_LEVEL = 2
	}

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_fe = yes
	}

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

	ai_weight = {
		weight = 1
	}
}

############################################################
##                   Singularity Bombers                  ##
############################################################

strike_craft_component_template = {
	key = ESC_GRAVITY_BOMBERS
	size = LARGE
	entity = "bomber_entity"
	icon = GFX_esc_gravitic_strikecraft
	icon_frame = 1

	weapon_type = point_defence
	projectile_gfx = "esc_gravity_cannon_tiny"
	power = -70

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

	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_bomber
	engagement_range = @ESC_STRIKECRAFT_engagement_range
	accuracy = @ESC_STRIKECRAFT_accuracy
	tracking = @ESC_STRIKECRAFT_tracking_bomber

	health = 30
	armor = 10
	shield = 50

	speed = @ESC_STRIKECRAFT_speed_5
	rotation_speed = @ESC_STRIKECRAFT_rot_speed_bomber
	acceleration = @ESC_STRIKECRAFT_acceleration_bomber
	evasion = @ESC_STRIKECRAFT_evasion

	hull_damage = @ESC_WEAPON_gravitic_bombers_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_bombers_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_bombers_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_bombers_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_bombers_shield_damage

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

	ship_behavior = "bombers_behavior"
	component_set = ESC_GRAVITY_BOMBERS
	prerequisites = { "esc_tech_gravity_bombers" }
	tags = { weapon_type_strike_craft carrier }
	ai_tags = { carrier weapon_role_anti_hull }

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}

strike_craft_component_template = {
	key = ESC_BIO_GRAVITY_BOMBERS
	size = LARGE
	entity = "space_amoeba_small_entity"
	icon = GFX_esc_bio_gravitic_strikecraft
	icon_frame = 1

	weapon_type = point_defence
	projectile_gfx = "esc_gravity_cannon_tiny"
	power = -70

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

	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_bomber
	engagement_range = @ESC_STRIKECRAFT_engagement_range
	accuracy = @ESC_STRIKECRAFT_accuracy
	tracking = @ESC_STRIKECRAFT_tracking_bomber

	health = 30
	armor = 10
	shield = 50

	speed = @ESC_STRIKECRAFT_speed_5
	rotation_speed = @ESC_STRIKECRAFT_rot_speed_bomber
	acceleration = @ESC_STRIKECRAFT_acceleration_bomber
	evasion = @ESC_STRIKECRAFT_evasion

	hull_damage = @ESC_WEAPON_gravitic_bombers_hull_damage
	armor_penetration = @ESC_WEAPON_gravitic_bombers_armor_penetration
	armor_damage = @ESC_WEAPON_gravitic_bombers_armor_damage
	shield_penetration = @ESC_WEAPON_gravitic_bombers_shield_penetration
	shield_damage = @ESC_WEAPON_gravitic_bombers_shield_damage

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

	ship_behavior = "bombers_behavior"
	component_set = ESC_BIO_GRAVITY_BOMBERS
	prerequisites = { "esc_tech_gravity_bombers" }
	tags = { weapon_type_strike_craft carrier }
	ai_tags = { carrier weapon_role_anti_hull }

	# only regular empires and materialist FE may use this component
	valid_for_country = {
		ESC_TRIGGER_is_normal_empire_or_materialist_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 = sr_dark_matter }
		}
	}
}
