From 015a3a6246305defa36e53780d365a147ebeb83b Mon Sep 17 00:00:00 2001 From: iloveloopers <140007537+iloveloopers@users.noreply.github.com> Date: Sun, 12 May 2024 22:34:02 -0400 Subject: [PATCH] mortar shells will now cook off and explode when flamed (#6243) # About the pull request title # Explain why it's good for the game immersion. ammo boxes do it, why not shells? realism (probably) its gonna be real funny on evac # Testing Photographs and Procedure https://github.com/cmss13-devs/cmss13/assets/140007537/a61e16dd-3119-4822-8ab2-8586895baddc # Changelog :cl: add: Mortar shells will now cook off and explode when flamed /:cl: --------- Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- .../equipment/mortar/mortar_shells.dm | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/code/modules/cm_marines/equipment/mortar/mortar_shells.dm b/code/modules/cm_marines/equipment/mortar/mortar_shells.dm index 45b3a6859d4a..dae0910cc9b4 100644 --- a/code/modules/cm_marines/equipment/mortar/mortar_shells.dm +++ b/code/modules/cm_marines/equipment/mortar/mortar_shells.dm @@ -8,6 +8,8 @@ var/datum/cause_data/cause_data ground_offset_x = 7 ground_offset_y = 6 + /// is it currently on fire and about to explode? + var/burning = FALSE /obj/item/mortar_shell/Destroy() @@ -154,6 +156,35 @@ icon_state = initial(icon_state) +"_unlocked" playsound(loc, 'sound/items/Screwdriver2.ogg', 25, 0, 6) +/obj/item/mortar_shell/ex_act(severity, explosion_direction) + if(!burning) + return ..() + +/obj/item/mortar_shell/attack_hand(mob/user) + if(burning) + to_chat(user, SPAN_DANGER("[src] is on fire and might explode!")) + return + return ..() + +/obj/item/mortar_shell/flamer_fire_act(dam, datum/cause_data/flame_cause_data) + if(burning) + return + burning = TRUE + cause_data = create_cause_data("Burning Mortar Shell", flame_cause_data.resolve_mob(), src) + handle_fire() + +/obj/item/mortar_shell/proc/handle_fire() + visible_message(SPAN_WARNING("[src] catches on fire and starts cooking off! It's gonna blow!")) + anchored = TRUE // don't want other explosions launching it elsewhere + + var/datum/effect_system/spark_spread/sparks = new() + sparks.set_up(n = 10, loca = loc) + sparks.start() + new /obj/effect/warning/explosive(loc, 5 SECONDS) + + addtimer(CALLBACK(src, PROC_REF(detonate), loc), 5 SECONDS) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), (src)), 5.5 SECONDS) + /obj/structure/closet/crate/secure/mortar_ammo name = "\improper M402 mortar ammo crate" desc = "A crate containing live mortar shells with various payloads. DO NOT DROP. KEEP AWAY FROM FIRE SOURCES."