Files
FlamingLily 6a9101e763 Fixes SMES hacking (#19549)
~~In preparation for my grand political strategy to get SMES hacking
wires added to the aurora wiki, I made sure they were working.~~

It's on the wiki now so you have to merge this it's canon 🫡 

Changes:
* The RCON wire in a SMES now actually disconnects a SMES from RCON
(before it only prevented AI control).
* When the input wire is cut in a SMES, it will now correctly report
that the SMES is not charging on the UI.
* The Failsafe and Grounding wires of a SMES now correctly trigger the
red light when only one is cut, instead of both needing to be triggered.

---------

Signed-off-by: FlamingLily <80451102+FlamingLily@users.noreply.github.com>
2024-07-03 04:01:44 +00:00

69 lines
1.7 KiB
Plaintext

/datum/wires/smes
proper_name = "SMES"
holder_type = /obj/machinery/power/smes/buildable
/datum/wires/smes/New()
wires = list(
WIRE_RCON,
WIRE_INPUT,
WIRE_OUTPUT,
WIRE_GROUNDING,
WIRE_FAILSAFES
)
add_duds(1)
..()
/datum/wires/smes/interactable(mob/user)
if(!..())
return FALSE
var/obj/machinery/power/smes/buildable/S = holder
if(S.open_hatch)
return TRUE
return FALSE
/datum/wires/smes/get_status()
var/obj/machinery/power/smes/buildable/S = holder
. += ..()
. += "The green light is [(S.input_cut || S.input_pulsed || S.output_cut || S.output_pulsed) ? "off" : "on"]."
. += "The red light is [(S.safeties_enabled && S.grounding) ? "off" : "blinking"]."
. += "The blue light is [S.RCon ? "on" : "off"]."
/datum/wires/smes/on_cut(wire, mend, source)
var/obj/machinery/power/smes/buildable/S = holder
switch(wire)
if(WIRE_RCON)
S.RCon = mend
if(WIRE_INPUT)
S.input_cut = !mend
if(WIRE_OUTPUT)
S.output_cut = !mend
if(WIRE_GROUNDING)
S.grounding = mend
if(WIRE_FAILSAFES)
S.safeties_enabled = mend
/datum/wires/smes/on_pulse(wire)
var/obj/machinery/power/smes/buildable/S = holder
switch(wire)
if(WIRE_RCON)
if(S.RCon)
S.RCon = 0
addtimer(CALLBACK(S, TYPE_PROC_REF(/obj/machinery/power/smes/buildable, reset_rcon)), 10)
if(WIRE_INPUT)
S.toggle_input()
if(WIRE_OUTPUT)
S.toggle_output()
if(WIRE_GROUNDING)
S.grounding = 0
if(WIRE_FAILSAFES)
if(S.safeties_enabled)
S.safeties_enabled = 0
addtimer(CALLBACK(S, TYPE_PROC_REF(/obj/machinery/power/smes/buildable, reset_safeties)), 10)
/obj/machinery/power/smes/buildable/proc/reset_safeties()
safeties_enabled = TRUE
/obj/machinery/power/smes/buildable/proc/reset_rcon()
RCon = TRUE