Files
Aurora.3/code/datums/wires/disposals.dm
T
BatrachophrenoandGitHub 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

43 lines
1.1 KiB
Plaintext

/datum/wires/disposal
proper_name = "Disposals"
random = TRUE
holder_type = /obj/structure/machinery/disposal
/datum/wires/disposal/New(atom/holder)
wires = list(
WIRE_FLUSH
)
add_duds(3)
..()
/datum/wires/disposal/get_status()
var/obj/structure/machinery/disposal/D = holder
. = ..()
. += "<br>\nThe light indicator inserted within the flush handle is [D.can_flush ? "on" : "off"]."
/datum/wires/disposal/on_cut(wire, mend, source)
var/obj/structure/machinery/disposal/D = holder
switch(wire)
if(WIRE_FLUSH)
if(!mend)
D.can_flush = FALSE
D.visible_message(SPAN_WARNING("\The [D] whines loudly."), range = 3)
else
D.can_flush = TRUE
D.visible_message(SPAN_NOTICE("\The [D] hums soothingly."), range = 3)
/datum/wires/disposal/on_pulse(wire)
var/obj/structure/machinery/disposal/D = holder
switch(wire)
if(WIRE_FLUSH)
if(XGM_PRESSURE(D.air_contents) >= (700 + ONE_ATMOSPHERE) || !D.uses_air)
D.flush()
/datum/wires/disposal/interactable(mob/user)
if(!..())
return FALSE
var/obj/structure/machinery/disposal/D = holder
if(D.mode <= 0)
return TRUE
return FALSE