From b3e916cc68949659553b4a453d898bfe3a8c0203 Mon Sep 17 00:00:00 2001 From: kappa-sama <44128284+kappa-sama@users.noreply.github.com> Date: Wed, 8 Jan 2020 09:44:16 -0500 Subject: [PATCH] e --- code/datums/wires/autoylathe.dm | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 code/datums/wires/autoylathe.dm diff --git a/code/datums/wires/autoylathe.dm b/code/datums/wires/autoylathe.dm new file mode 100644 index 0000000000..736c9551ec --- /dev/null +++ b/code/datums/wires/autoylathe.dm @@ -0,0 +1,48 @@ +/datum/wires/autoylathe + holder_type = /obj/machinery/autoylathe + proper_name = "Autoylathe" + +/datum/wires/autoylathe/New(atom/holder) + wires = list( + WIRE_HACK, WIRE_DISABLE, + WIRE_SHOCK, WIRE_ZAP + ) + add_duds(6) + ..() + +/datum/wires/autoylathe/interactable(mob/user) + var/obj/machinery/autoylathe/A = holder + if(A.panel_open) + return TRUE + +/datum/wires/autoylathe/get_status() + var/obj/machinery/autoylathe/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/autoylathe/on_pulse(wire) + var/obj/machinery/autoylathe/A = holder + switch(wire) + if(WIRE_HACK) + A.adjust_hacked(!A.hacked) + addtimer(CALLBACK(A, /obj/machinery/autoylathe.proc/reset, wire), 60) + if(WIRE_SHOCK) + A.shocked = !A.shocked + addtimer(CALLBACK(A, /obj/machinery/autoylathe.proc/reset, wire), 60) + if(WIRE_DISABLE) + A.disabled = !A.disabled + addtimer(CALLBACK(A, /obj/machinery/autoylathe.proc/reset, wire), 60) + +/datum/wires/autoylathe/on_cut(wire, mend) + var/obj/machinery/autoylathe/A = holder + switch(wire) + if(WIRE_HACK) + A.adjust_hacked(!mend) + if(WIRE_HACK) + A.shocked = !mend + if(WIRE_DISABLE) + A.disabled = !mend + if(WIRE_ZAP) + A.shock(usr, 50)