Skip to content

Commit

Permalink
Update mortar_shells.dm
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveloopers authored May 5, 2024
1 parent cedfbd7 commit 7c3926a
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions code/modules/cm_marines/equipment/mortar/mortar_shells.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -154,6 +156,31 @@
icon_state = initial(icon_state) +"_unlocked"
playsound(loc, 'sound/items/Screwdriver2.ogg', 25, 0, 6)

/obj/item/mortar_shell/attack_hand(mob/user)
if(burning)
to_chat(user, SPAN_DANGER("\The [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 = flame_cause_data
handle_fire()

/obj/item/mortar_shell/proc/handle_fire()
visible_message(SPAN_WARNING("\The [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.1 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."
Expand Down

0 comments on commit 7c3926a

Please sign in to comment.