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"