Files
Bubberstation/code/datums/wires/autolathe.dm
SkyratBot 42f6f57dc0 [MIRROR] Replaces even more deciseconds with SECONDS (#27205)
Replaces even more deciseconds with SECONDS

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
Co-authored-by: Waterpig <wtryoutube@seznam.cz>
2024-04-16 12:58:35 +02:00

51 lines
1.3 KiB
Plaintext

/datum/wires/autolathe
holder_type = /obj/machinery/autolathe
proper_name = "Autolathe"
/datum/wires/autolathe/New(atom/holder)
wires = list(
WIRE_HACK, WIRE_DISABLE,
WIRE_SHOCK, WIRE_ZAP
)
add_duds(6)
..()
/datum/wires/autolathe/interactable(mob/user)
if(!..())
return FALSE
var/obj/machinery/autolathe/A = holder
if(A.panel_open)
return TRUE
/datum/wires/autolathe/get_status()
var/obj/machinery/autolathe/A = holder
var/list/status = list()
status += "The red light is [A.disabled ? "on" : "off"]."
status += "The blue light is [A.hacked ? "on" : "off"]."
return status
/datum/wires/autolathe/on_pulse(wire)
var/obj/machinery/autolathe/A = holder
switch(wire)
if(WIRE_HACK)
A.adjust_hacked(!A.hacked)
addtimer(CALLBACK(A, TYPE_PROC_REF(/obj/machinery/autolathe, reset), wire), 6 SECONDS)
if(WIRE_SHOCK)
A.shocked = !A.shocked
addtimer(CALLBACK(A, TYPE_PROC_REF(/obj/machinery/autolathe, reset), wire), 6 SECONDS)
if(WIRE_DISABLE)
A.disabled = !A.disabled
addtimer(CALLBACK(A, TYPE_PROC_REF(/obj/machinery/autolathe, reset), wire), 6 SECONDS)
/datum/wires/autolathe/on_cut(wire, mend, source)
var/obj/machinery/autolathe/A = holder
switch(wire)
if(WIRE_HACK)
A.adjust_hacked(!mend)
if(WIRE_SHOCK)
A.shocked = !mend
if(WIRE_DISABLE)
A.disabled = !mend
if(WIRE_ZAP)
A.shock(usr, 50)