Files
VOREStation/code/datums/wires/particle_accelerator.dm
T
Kashargul 3735a31e05 Fix a bunch of issues and runtimes (#17951)
* selection target

* ugh

* fix deadmin

* larger

* fix paper icons

* those are inverted

* don't miss that

* fix all

* point transfer

* add nostrip flag to items

* un....  teppi

* .

* end life proc after qdel

* this could be null in very rare cases

* this has a lot of sleeps, someday should be refactored and check for qdeleted

* needs to be an object

* qdel check this

* use the rsc properly

* wtf?

* .

* fix narrate

* .

* push

* inform user, null it

* .

* can be null

* fix maint lurkers

* .

* spans

* .

* fix that too

* urg

* fix distillery

* don't wrap them

* needs usr

* Update cash_register.dm

* quick hook cleanup

* lots of fixes

* .

* clean that up for reasons
2025-07-05 00:45:18 -04:00

49 lines
1.4 KiB
Plaintext

/datum/wires/particle_acc/control_box
wire_count = 5
holder_type = /obj/machinery/particle_accelerator/control_box
proper_name = "Particle accelerator control"
/datum/wires/particle_acc/control_box/New(atom/_holder)
wires = list(WIRE_PARTICLE_POWER, WIRE_PARTICLE_STRENGTH, WIRE_PARTICLE_INTERFACE, WIRE_PARTICLE_POWER_LIMIT)
return ..()
/datum/wires/particle_acc/control_box/interactable(mob/user)
var/obj/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/machinery/particle_accelerator/control_box/C = holder
switch(wire)
if(WIRE_PARTICLE_POWER)
C.toggle_power()
if(WIRE_PARTICLE_STRENGTH)
C.add_strength(usr)
if(WIRE_PARTICLE_INTERFACE)
C.interface_control = !C.interface_control
if(WIRE_PARTICLE_POWER_LIMIT)
C.visible_message("[icon2html(C,viewers(holder))]<b>[C]</b> makes a large whirring noise.")
/datum/wires/particle_acc/control_box/on_cut(wire, mend)
var/obj/machinery/particle_accelerator/control_box/C = holder
switch(wire)
if(WIRE_PARTICLE_POWER)
if(C.active == !mend)
C.toggle_power()
if(WIRE_PARTICLE_STRENGTH)
for(var/i = 1; i < 3; i++)
C.remove_strength()
if(WIRE_PARTICLE_INTERFACE)
C.interface_control = mend
if(WIRE_PARTICLE_POWER_LIMIT)
C.strength_upper_limit = (mend ? 2 : 3)
if(C.strength_upper_limit < C.strength)
C.remove_strength()