From 534e1b44ae2101e190e3c24e9477d45c64b3f6dd Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:46:53 +0300 Subject: [PATCH] Cooked mortar shell explosion is now fixed (#6638) # About the pull request Fixed as in static, doesn't change for different mortar shell types Makes the explosion when setting mortar shells on fire fixed and small # Explain why it's good for the game This was supposed to be a niche feature like ammo boxes exploding and instead it is being used to blow up inside pylons \ caves or even on shipside. This is why we can't have nice things. # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: del: Mortar shells no longer blow up their payload, instead they will create a small fixed explosion. /:cl: --- .../equipment/mortar/mortar_shells.dm | 40 ++++++++++++++----- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/code/modules/cm_marines/equipment/mortar/mortar_shells.dm b/code/modules/cm_marines/equipment/mortar/mortar_shells.dm index dae0910cc9b4..1cb93c6a809e 100644 --- a/code/modules/cm_marines/equipment/mortar/mortar_shells.dm +++ b/code/modules/cm_marines/equipment/mortar/mortar_shells.dm @@ -167,23 +167,43 @@ return ..() /obj/item/mortar_shell/flamer_fire_act(dam, datum/cause_data/flame_cause_data) + addtimer(VARSET_CALLBACK(src, burning, FALSE), 5 SECONDS, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_DELETE_ME) + if(burning) return burning = TRUE cause_data = create_cause_data("Burning Mortar Shell", flame_cause_data.resolve_mob(), src) - handle_fire() + handle_fire(cause_data) -/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 +/obj/item/mortar_shell/proc/can_explode() + return TRUE - 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) +/obj/item/mortar_shell/custom/can_explode() + for(var/obj/item/reagent_container/glass/container in warhead?.containers) + for(var/datum/reagent/reagent in container?.reagents?.reagent_list) + if(reagent.explosive) + return TRUE - addtimer(CALLBACK(src, PROC_REF(detonate), loc), 5 SECONDS) - addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), (src)), 5.5 SECONDS) + return FALSE + +/obj/item/mortar_shell/flare/can_explode() + return FALSE + +/obj/item/mortar_shell/proc/handle_fire(cause_data) + if(can_explode()) + 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(explode), cause_data), 5 SECONDS) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), (src)), 5.5 SECONDS) + + +/obj/item/mortar_shell/proc/explode(flame_cause_data) + cell_explosion(src, 100, 25, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, flame_cause_data) /obj/structure/closet/crate/secure/mortar_ammo name = "\improper M402 mortar ammo crate"