Files
GeevesandGitHub 448932f01c Ship Weapon Fix (#23038)
* Fixed ship munitions occasionally failing to enter their overmap
target when their original physical projectile no longer existed.
* Fixed several ship munitions reconstructing as the wrong projectile
after overmap travel, ensuring explosive rounds correctly detonate on
impact.

Also had the AI write a unit test that simulates ship combat using every
munition type, so we don't have more regressions here.

AI usage disclosure: The code for this was created using GPT 5.6 Sol.
2026-08-10 19:47:19 +00:00

42 lines
2.2 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/obj/structure/machinery/ship_weapon/coilgun/light
name = "M302A7 piledriver light coilgun"
desc = "A miniaturized version of the Solarian Navys coilgun platform, the M302A7 is the latest version of a weapon class that has served with honor since the Interstellar War. A semiautomatic, magazine-loaded design, it excels at applying pressure to enemy shields and hulls."
desc_extended = "Pressed for a smaller version of a coilgun to fit onto escort craft, the Alliance contracted what was then Necropolis Industries to design and manufacture the Navys first coilgun for corvette use in the mid-2200s. The M2307 is a post-Interstellar War modernization of earlier models that had been steadily improved upon over time. Though phased out of use in some battlegroups in favor of the M455A1 light coilgun, it remains a common sight in many fleets."
icon = 'icons/obj/machinery/ship_guns/sol_light_coilgun.dmi'
icon_state = "weapon_base"
max_ammo = 3
projectile_type = /obj/projectile/ship_ammo/coilgun/light
heavy_firing_sound = 'sound/weapons/railgun.ogg'
firing_effects = FIRING_EFFECT_FLAG_EXTREMELY_LOUD
screenshake_type = SHIP_GUN_SCREENSHAKE_ALL_MOBS
caliber = SHIP_CALIBER_COILGUN
/obj/item/ship_ammunition/coilgun/light
name = "light tungsten rod pack"
name_override = "light tungsten rod"
desc = "A pack of rods used as ammunition for a light coilgun."
icon = 'icons/obj/ammo.dmi'
icon_state = "trodpack-2"
caliber = SHIP_CALIBER_COILGUN
overmap_icon_state = "light_pulse"
impact_type = SHIP_AMMO_IMPACT_AP
projectile_type_override = /obj/projectile/ship_ammo/coilgun/light
/obj/projectile/ship_ammo/coilgun/light
name = "low-power tungsten rod"
icon_state = "heavy"
damage = 10000
armor_penetration = 1000
penetrating = 1
explosion_strength = list(2, 3, 4)
/obj/projectile/ship_ammo/coilgun/light/on_hit(atom/target, blocked, def_zone, is_landmark_hit)
. = ..()
var/turf/epicenter = get_turf(target)
if(ismob(target))
var/mob/M = target
M.visible_message(SPAN_DANGER("<font size=5>\The [src] blows [M]'s chest apart and punches straight through!</font>"))
if(isturf(target) || isobj(target))
explosion(epicenter, explosion_strength[1], explosion_strength[2], explosion_strength[3])