Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Death is Our Destination (New funeral rite) #8346

Merged
merged 21 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions code/datums/craft/recipes/furniture.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@
list(CRAFT_MATERIAL, 10, MATERIAL_WOOD),
)

/datum/craft_recipe/furniture/bigcoffin
Mycah142 marked this conversation as resolved.
Show resolved Hide resolved
name = "pauper's coffin"
result = /obj/structure/closet/coffin/pauper
steps = list(
list(CRAFT_MATERIAL, 30, MATERIAL_WOOD),
Mycah142 marked this conversation as resolved.
Show resolved Hide resolved
)

/datum/craft_recipe/furniture/bed
name = "bed"
result = /obj/structure/bed
Expand Down
100 changes: 99 additions & 1 deletion code/game/objects/structures/crates_lockers/closets/coffin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@
spawn_frequency = 10
spawn_tags = SPAWN_TAG_CLOSET_COFFIN
bad_type = /obj/structure/closet/coffin
store_items = FALSE
store_misc = FALSE //It's a coffin, not a storage bin
var/mob/living/occupant = null
var/on_fire = FALSE
var/burning = null

/obj/structure/closet/coffin/pauper
name = "pauper's coffin"
desc = "A burial receptacle for the dearly departed. Perfect for the entire family."
icon_state = "coffin_wide"
matter = list(MATERIAL_WOOD = 30)
storage_capacity = 2 * MOB_HUGE //*slaps coffin* This bad boy fits two whole Iriskas

/obj/structure/closet/coffin/close(mob/living/user)
..()
Expand All @@ -19,6 +30,13 @@
occupant = L
break

/obj/structure/closet/coffin/open()
..()
occupant = null
on_fire = FALSE
deltimer(burning)
visible_message(SPAN_NOTICE("Opening the coffin has disrupted the fire!"))

//The coffin processes when there's a mob inside
/obj/structure/closet/coffin/lost_in_space()
//The coffin has left the ship. Burial at space
Expand All @@ -36,6 +54,21 @@

return TRUE

/obj/structure/closet/coffin/proc/pyre()
if(opened)
close() //If someone wanted an open casket funeral, we still need the casket to close to determine occupant
new /obj/effect/decal/cleanable/ash(loc)
if(occupant && occupant.is_dead())
var/mob/N = key2mob(occupant.mind.key)
to_chat(N, SPAN_NOTICE("Your remains have been reduced to ash. Your crew respawn time has been reduced by [(COFFIN_RESPAWN_BONUS)/600] minutes."))
hyperioo marked this conversation as resolved.
Show resolved Hide resolved
N << 'sound/effects/magic/blind.ogg'
N.set_respawn_bonus("CORPSE_HANDLING", COFFIN_RESPAWN_BONUS)

qdel(occupant)
qdel(src)

return

/obj/structure/closet/coffin/Destroy()
occupant = null
return ..()
Expand All @@ -51,4 +84,69 @@
var/atom/A = pick(/obj/landmark/corpse/chef, /obj/landmark/corpse/doctor, /obj/landmark/corpse/engineer, /obj/landmark/corpse/engineer/rig, /obj/landmark/corpse/clown, \
/obj/landmark/corpse/scientist, /obj/landmark/corpse/miner, /obj/landmark/corpse/miner/rig, /obj/landmark/corpse/bridgeofficer, /obj/landmark/corpse/commander, \
/obj/landmark/corpse/russian)
new A
new A

/obj/structure/closet/coffin/attack_hand(mob/user)
add_fingerprint(user)
if(opened)
to_chat(user, SPAN_NOTICE("You can't fit the cover back on without hammering it into place!"))
else
to_chat(user, SPAN_NOTICE("The cover is too heavy to lift without a prying tool!"))

/obj/structure/closet/coffin/proc/burn()
add_overlay("coffin_pyre")
on_fire = TRUE
burning = addtimer(CALLBACK(src, PROC_REF(pyre), src), 120 SECONDS, TIMER_STOPPABLE) //TODO: Add TIMER_STOPPABLE to being extinguished, which involves giving reagents touch effects to structures, which they currently don't affect

/obj/structure/closet/coffin/attackby(obj/item/I, mob/user)
if(!on_fire && isflamesource(I))
user.visible_message(SPAN_WARNING("[user] has lit the [src] on fire! In a couple minutes, it and its occupant will be ash!"))
burn()

var/list/usable_qualities = list()
if(opened)
usable_qualities += QUALITY_SAWING
usable_qualities += QUALITY_PRYING
usable_qualities += QUALITY_HAMMERING
if(!opened)
usable_qualities += QUALITY_PRYING

var/tool_type = I.get_tool_type(user, usable_qualities, src)
switch(tool_type)
if(QUALITY_PRYING)
if(!opened)
if(I.use_tool(user, src, WORKTIME_FAST, tool_type, FAILCHANCE_EASY, required_stat = STAT_MEC))
visible_message(
SPAN_NOTICE("\The [src] has been pried open by [user] with \the [I]."),
"You hear [tool_type]."
)
open()
else
if(I.use_tool(user, src, WORKTIME_FAST, tool_type, FAILCHANCE_EASY, required_stat = STAT_MEC))
visible_message(
SPAN_NOTICE("\The [src] has been pried apart by [user] with \the [I]."),
"You hear [tool_type]."
)
drop_materials(drop_location())
qdel(src)
return

if(QUALITY_SAWING)
if(opened)
if(I.use_tool(user, src, WORKTIME_FAST, tool_type, FAILCHANCE_EASY, required_stat = STAT_MEC))
visible_message(
Mycah142 marked this conversation as resolved.
Show resolved Hide resolved
SPAN_NOTICE("\The [src] has been cut apart by [user] with \the [I]."),
Mycah142 marked this conversation as resolved.
Show resolved Hide resolved
"You hear [tool_type]."
)
drop_materials(drop_location())
qdel(src)
return
if(QUALITY_HAMMERING)
if(opened)
if(I.use_tool(user, src, WORKTIME_FAST, tool_type, FAILCHANCE_EASY, required_stat = STAT_MEC))
visible_message(
Mycah142 marked this conversation as resolved.
Show resolved Hide resolved
SPAN_NOTICE("\The [src] has had it's cover secured by [user] with \the [I]."),
"You hear [tool_type]."
)
close()
return
Binary file modified icons/obj/closet.dmi
Binary file not shown.
Loading