Skip to content

Commit

Permalink
mortar shells will now cook off and explode when flamed (#6243)
Browse files Browse the repository at this point in the history
# 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 <[email protected]>
  • Loading branch information
iloveloopers and Drulikar committed May 13, 2024
1 parent 0e816e6 commit 015a3a6
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 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,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."
Expand Down

0 comments on commit 015a3a6

Please sign in to comment.