# ####################
# Energy Lance
# ####################

# ## Energy Lance 1

weapon_component_template = {
	key = "ENERGY_LANCE_2"
	size = extra_large
	type = instant

	icon = "GFX_ship_part_energy_lance_2"
	icon_frame = 1

	firing_arc = 25.0
	use_ship_main_target = no
	potential = {
		OR = {
			from = {
				country_uses_bio_ships = no
			}
			is_arkship_ship = yes
		}
	}

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}
	prerequisites = { "tech_energy_lance_2" }
	component_set = "ENERGY_LANCE_2"
	projectile_gfx = "tachyon_lance"
	tags = { weapon_type_energy weapon_role_artillery x_slot }
	ai_tags = { weapon_role_artillery artillery }
	ai_tag_weight = 0
	upgrades_to = "AVW_ENERGY_LANCE_3"
	resources = {
		category = ship_components
		cost = {
			alloys = @xl_t6_cost
			rare_crystals = @xl_t6_rare
		}
		upkeep = {
			alloys = @xl_t6_upkeep_alloys
			energy = @xl_t6_upkeep_energy
		}
	}

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

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

weapon_component_template = {
	key = "ARC_EMITTER_2"
	size = extra_large
	type = instant

	icon = "GFX_ship_part_arc_emitter_2"
	icon_frame = 1
	potential = {
		OR = {
			from = {
				country_uses_bio_ships = no
			}
			is_arkship_ship = yes
		}
	}

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}
	firing_arc = 35.0
	min_range = 10.0
	use_ship_main_target = no

	prerequisites = { "tech_arc_emitter_2" }
	component_set = "ARC_EMITTER_2"
	projectile_gfx = "focused_arc_emitter"
	tags = { weapon_type_energy weapon_role_artillery x_slot }
	ai_tags = { weapon_role_artillery artillery }
	ai_tag_weight = 0
	upgrades_to = "AVW_ARC_EMITTER_3"
	resources = {
		category = ship_components
		cost = {
			alloys = @xl_t6_cost
			rare_crystals = @xl_t6_rare
		}
		upkeep = {
			alloys = @xl_t6_upkeep_alloys
			energy = @xl_t6_upkeep_energy
		}
	}

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

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

weapon_component_template = {
	type = instant

	key = "MASS_ACCELERATOR_2"
	size = extra_large

	icon = "GFX_ship_part_mass_accelerator_2"
	icon_frame = 1

	firing_arc = 25.0
	min_range = 45.0
	use_ship_main_target = no

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

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}
	component_set = "MASS_ACCELERATOR_2"
	projectile_gfx = "adv_kinetic_artillery"
	tags = { weapon_type_kinetic weapon_role_artillery x_slot }
	ai_tags = { weapon_role_artillery artillery }
	ai_tag_weight = 0
	upgrades_to = "AVW_MASS_ACCELERATOR_3"
	resources = {
		category = ship_components
		cost = {
			alloys = @xl_t6_cost
			volatile_motes = @xl_t6_rare
		}
		upkeep = {
			energy = @xl_t6_upkeep_energy
			alloys = @xl_t6_upkeep_alloys
		}
	}

	target_weights = {
		titan = 3
		battleship = 2
		stinger_stage_1 = 1.5
		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 = "PERDITION_BEAM_TITAN"
	size = titanic
	type = instant
	prio_projectile = yes

	icon = "GFX_ship_part_perdition_beam"
	icon_frame = 1

#	firing_arc = 10.0
	use_ship_main_target = no

	tags = { weapon_type_energy weapon_role_artillery t_slot }
	prerequisites = { "tech_titans" }
	component_set = "PERDITION_BEAM"
	projectile_gfx = "perdition_beam"
	potential = {
		ship_uses_titan_components = yes
	}
	upgrades_to = "AVW_PERDITION_BEAM_2"
	resources = {
		category = ship_components
		cost = {
			alloys = @titanic_t6_cost
			rare_crystals = @titanic_t6_rare
		}
		upkeep = {
			alloys = @titanic_t6_upkeep_alloys
		}
		upkeep = {
			trigger = {
				from = {
					country_uses_bio_ships = no
				}
			}
			energy = @titanic_t6_upkeep_energy
		}
		upkeep = {
			trigger = {
				from = {
					country_uses_bio_ships = yes
				}
			}
			food = @titanic_t6_upkeep_energy
		}
	}

	collateral_damage = @perdition_beam_fleet_damage
	collateral_range = @perdition_beam_collateral_range

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

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

weapon_component_template = {
	key = "PERDITION_BEAM_ION"
	size = titanic
	type = instant
	prio_projectile = yes

	icon = "GFX_ship_part_perdition_beam"
	icon_frame = 1

#	firing_arc = 10.0
	use_ship_main_target = no

	tags = { weapon_type_energy weapon_role_artillery t_slot }

	prerequisites = { "tech_titans" }
	component_set = "PERDITION_BEAM"
	projectile_gfx = "ion_cannon"
	potential = {
		OR = {
			ship_uses_ion_cannon_components = yes
			ship_uses_dsc_components = yes
		}
	}
	upgrades_to = "AVW_PERDITION_BEAM_2_ION"
	resources = {
		category = ship_components
		cost = {
			alloys = @titanic_t6_cost
			rare_crystals = @titanic_t6_rare
		}
		upkeep = {
			alloys = @titanic_t6_upkeep_alloys
		}
		upkeep = {
			trigger = {
				from = {
					country_uses_bio_ships = no
				}
			}
			energy = @titanic_t6_upkeep_energy
		}
		upkeep = {
			trigger = {
				from = {
					country_uses_bio_ships = yes
				}
			}
			food = @titanic_t6_upkeep_energy
		}
	}

	collateral_damage = @ion_cannon_fleet_damage
	collateral_range = @ion_cannon_collateral_range

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

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