mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Co-authored-by: Selis <selis@xynolabs.com> Co-authored-by: Selis <sirlionfur@hotmail.de> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> Co-authored-by: SatinIsle <thesatinisle@gmail.com> Co-authored-by: Heroman <alesha3000@list.ru> Co-authored-by: Casey <a.roaming.shadow@gmail.com> Co-authored-by: Raeschen <rycoop29@gmail.com>
49 lines
1.4 KiB
Plaintext
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()
|
|
|
|
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()
|