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

66 lines
1.7 KiB
Plaintext

/datum/wires/nuclearbomb
proper_name = "Nuclear Fission Device"
holder_type = /obj/structure/machinery/nuclearbomb
random = 1
/datum/wires/nuclearbomb/New()
wires = list(
WIRE_LIGHT, WIRE_TIMING,
WIRE_SAFETY
)
/// Listen, Derek. I know you're a surgeon, but...
add_duds(2)
..()
/datum/wires/nuclearbomb/interactable(mob/user)
if(!..())
return FALSE
var/obj/structure/machinery/nuclearbomb/N = holder
return N.panel_open
/datum/wires/nuclearbomb/get_status()
var/obj/structure/machinery/nuclearbomb/N = holder
. += ..()
. += "The device is [N.timing ? "shaking!" : "still."]"
. += "The device is is [N.safety ? "quiet" : "whirring"]."
. += "The lights are [N.lighthack ? "static" : "functional"]."
/datum/wires/nuclearbomb/on_pulse(wire)
var/obj/structure/machinery/nuclearbomb/N = holder
switch(wire)
if(WIRE_LIGHT)
N.lighthack = !N.lighthack
N.update_icon()
spawn(100)
N.lighthack = !N.lighthack
N.update_icon()
if(WIRE_TIMING)
if(N.timing)
spawn
log_and_message_admins("pulsed a nuclear bomb's detonation wire, causing it to explode.")
N.explode()
if(WIRE_SAFETY)
N.safety = !N.safety
spawn(100)
N.safety = !N.safety
if(N.safety == 1)
N.visible_message(SPAN_NOTICE("\The [N] quiets down."))
N.secure_device()
else
N.visible_message(SPAN_NOTICE("\The [N] emits a quiet whirling noise!"))
/datum/wires/nuclearbomb/on_cut(wire, mend, source)
var/obj/structure/machinery/nuclearbomb/N = holder
switch(wire)
if(WIRE_SAFETY)
N.safety = mend
if(N.timing)
spawn
log_and_message_admins("cut a nuclear bomb's timing wire, causing it to explode.")
N.explode()
if(WIRE_TIMING)
N.secure_device()
if(WIRE_LIGHT)
N.lighthack = !mend
N.update_icon()