Files
Aurora.3/code/game/objects/structures/sarcophagus.dm
T
Batrachophreno 4ecb0bc21c Repath obj/machinery to obj/structure/machinery [MDB Ignore] (#22500)
Repaths obj/machinery to obj/structure/machinery. **Note for
reviewers:** the only meaningful changed code exists within
**code/game/objects/structures.dm** and
**code/game/objects/structures/_machinery.dm**, largely concerning
damage procs. With the exception of moving airlock defines to their own
file, ALL OTHER CHANGES ARE STRICTLY PATH CHANGES.

Objects, _categorically_, are largely divided between those you can hold
in your hand/inventory and those you can't. Machinery objects are
already subtypes of Structures behaviorally, this PR just makes their
pathing reflect that, and allows for future work (tool actions, more
health/destruction functionality) to be developed without unnecessary
code duplication.

I have tested this PR by loading up the Horizon and dismantling various
machines and structures with tools, shooting guns of various types
throughout the ship, and detonating a bunch of explosions throughout the
ship.
2026-05-26 19:35:48 +00:00

79 lines
2.0 KiB
Plaintext

/obj/structure/sarcophagus
name = "sarcophagus"
desc = "A sealed ancient sarcophagus."
icon = 'icons/obj/sarcophagus.dmi'
icon_state = "sarcophagus"
density = 1
anchored = 0
var/open = FALSE
/obj/structure/sarcophagus/feedback_hints(mob/user, distance, is_adjacent)
. += ..()
if(!open)
. += "\The [src]'s lid is closed shut."
else
. += "\The [src]'s lid is open."
/obj/structure/sarcophagus/Initialize()
. = ..()
if(prob(25))
desc = "Don't open it."
/obj/structure/sarcophagus/update_icon()
if(open)
icon_state = "sarcophagus_open"
else
icon_state = initial(icon_state)
/obj/structure/sarcophagus/ex_act(severity)
switch(severity)
if(1.0)
qdel(src)
if(2.0)
if(prob(50))
qdel(src)
if(3.0)
if(prob(25))
open()
return
/obj/structure/sarcophagus/attackby(obj/item/attacking_item, mob/user)
if(open)
return
if(istype(attacking_item, /obj/item/sarcophagus_key))
to_chat(usr, SPAN_NOTICE("You slide \the [attacking_item] inside an opening in \the [src]."))
open()
/obj/structure/sarcophagus/proc/open()
playsound((get_turf(src)), 'sound/effects/stonedoor_openclose.ogg', 100, 1)
open = TRUE
update_icon()
if(prob(25))
explosion(get_turf(src), 2, 3, 4, 4)
qdel(src)
return
var/outcomes = pick("remains", "xenoarch", "highvalue", "supermatter", "artifact", "beyond")
switch(outcomes)
if("remains")
new /obj/effect/decal/remains/xeno (get_turf(src))
if("xenoarch")
new /obj/item/archaeological_find (get_turf(src))
if("highvalue")
new /obj/random/highvalue (get_turf(src))
if("supermatter")
new /obj/structure/machinery/power/supermatter/shard (get_turf(src))
if("artifact")
new /obj/structure/machinery/artifact (get_turf(src))
if("beyond")
new /obj/structure/machinery/from_beyond (get_turf(src))
return
/obj/item/sarcophagus_key
name = "ancient key"
desc = "An archaic key, probably not used to open any airlock on station."
icon = 'icons/obj/xenoarchaeology.dmi'
icon_state = "unknown1"
w_class = WEIGHT_CLASS_SMALL