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

53 lines
1.6 KiB
Plaintext

/datum/wires/particle_acc/control_box
proper_name = "Particle Accelerator"
holder_type = /obj/structure/machinery/particle_accelerator/control_box
/datum/wires/particle_acc/control_box/New()
wires = list(
WIRE_POWER,
WIRE_STRENGTH, WIRE_POWER_LIMIT
)
add_duds(2)
..()
/datum/wires/particle_acc/control_box/get_status()
var/obj/structure/machinery/particle_accelerator/control_box/C = holder
. += ..()
. += (C.active && C.assembled) ? "The firing light is on." : "The firing light is off."
. += C.strength ? "The strength light is blinking." : "The strength light is off."
. += C.strength_upper_limit == 2 ? "The strength limiter light is on." : "The strength limiter light is off."
/datum/wires/particle_acc/control_box/interactable(mob/user)
if(!..())
return FALSE
var/obj/structure/machinery/particle_accelerator/control_box/C = holder
if(C.construction_state == 2)
return TRUE
return FALSE
/datum/wires/particle_acc/control_box/on_pulse(wire)
var/obj/structure/machinery/particle_accelerator/control_box/C = holder
switch(wire)
if(WIRE_POWER)
C.toggle_power(usr)
if(WIRE_STRENGTH)
C.add_strength()
if(WIRE_POWER_LIMIT)
C.visible_message("[icon2html(C, viewers(get_turf(C)))]<b>[C]</b> makes a large whirring noise.")
/datum/wires/particle_acc/control_box/on_cut(wire, mend, source)
var/obj/structure/machinery/particle_accelerator/control_box/C = holder
switch(wire)
if(WIRE_POWER)
if(C.active == !mend)
C.toggle_power(usr)
if(WIRE_POWER_LIMIT)
C.strength_upper_limit = (mend ? 2 : 3)
if(C.strength_upper_limit < C.strength)
C.remove_strength()