mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-09 07:48:55 +00:00
57 lines
1.5 KiB
Plaintext
57 lines
1.5 KiB
Plaintext
/datum/wires/mod
|
|
holder_type = /obj/item/mod/control
|
|
proper_name = "MOD control unit"
|
|
req_knowledge = JOB_SKILL_MASTER
|
|
req_skill = JOB_SKILL_TRAINED
|
|
|
|
/datum/wires/mod/New(atom/holder)
|
|
wires = list(WIRE_DISABLE, WIRE_SHOCK, WIRE_INTERFACE)
|
|
add_duds(3)
|
|
..()
|
|
|
|
/datum/wires/mod/interactable(mob/user)
|
|
if(!..())
|
|
return FALSE
|
|
var/obj/item/mod/control/mod = holder
|
|
return mod.open
|
|
|
|
/datum/wires/mod/get_status()
|
|
var/obj/item/mod/control/mod = holder
|
|
var/list/status = list()
|
|
status += "The orange light is [mod.seconds_electrified ? "on" : "off"]."
|
|
status += "The red light is [mod.malfunctioning ? "off" : "blinking"]."
|
|
status += "The yellow light is [mod.interface_break ? "off" : "on"]."
|
|
return status
|
|
|
|
/datum/wires/mod/on_pulse(wire)
|
|
var/obj/item/mod/control/mod = holder
|
|
switch(wire)
|
|
if(WIRE_DISABLE)
|
|
mod.malfunctioning = TRUE
|
|
if(WIRE_SHOCK)
|
|
mod.seconds_electrified = MACHINE_DEFAULT_ELECTRIFY_TIME
|
|
if(WIRE_INTERFACE)
|
|
mod.interface_break = !mod.interface_break
|
|
|
|
/datum/wires/mod/on_cut(wire, mend)
|
|
var/obj/item/mod/control/mod = holder
|
|
switch(wire)
|
|
if(WIRE_HACK)
|
|
if(!mend)
|
|
mod.req_access = list()
|
|
if(WIRE_DISABLE)
|
|
mod.malfunctioning = !mend
|
|
if(WIRE_SHOCK)
|
|
if(mend)
|
|
mod.seconds_electrified = MACHINE_NOT_ELECTRIFIED
|
|
else
|
|
mod.seconds_electrified = MACHINE_ELECTRIFIED_PERMANENT
|
|
if(WIRE_INTERFACE)
|
|
mod.interface_break = !mend
|
|
|
|
/datum/wires/mod/ui_act(action, params)
|
|
var/obj/item/mod/control/mod = holder
|
|
if(!issilicon(usr) && mod.seconds_electrified && mod.shock(usr))
|
|
return FALSE
|
|
return ..()
|