diff --git a/code/datums/wires/suitstorage.dm b/code/datums/wires/suitstorage.dm new file mode 100644 index 00000000000..57a567ce431 --- /dev/null +++ b/code/datums/wires/suitstorage.dm @@ -0,0 +1,66 @@ +/datum/wires/suitstorage + holder_type = /obj/machinery/suit_storage_unit + wire_count = 6 + +var/const/SSU_WIRE_ID = 1 +var/const/SSU_WIRE_SHOCK = 2 +var/const/SSU_WIRE_SAFETY = 4 +var/const/SSU_WIRE_UV = 8 + + +/datum/wires/suitstorage/GetWireName(index) + switch(index) + if(SSU_WIRE_ID) + return "ID lock" + if(SSU_WIRE_SHOCK) + return "Shock wire" + if(SSU_WIRE_SAFETY) + return "Safety wire" + if(SSU_WIRE_UV) + return "UV wire" + + +/datum/wires/suitstorage/get_status() + . = ..() + var/obj/machinery/suit_storage_unit/A = holder + . += "The blue light is [A.secure ? "off" : "on"]." + . += "The red light is [A.safeties ? "off" : "blinking"]." + . += "The green light is [A.shocked ? "on" : "off"]." + . += "The UV display shows [A.uv_super ? "185 nm" : "15 nm"]." + +datum/wires/suitstorage/CanUse() + var/obj/machinery/suit_storage_unit/A = holder + if(A.panel_open) + return 1 + return 0 + +/datum/wires/suitstorage/UpdateCut(index, mended) + var/obj/machinery/suit_storage_unit/A = holder + switch(index) + if(SSU_WIRE_ID) + A.secure = mended + if(SSU_WIRE_SAFETY) + A.safeties = mended + if(SSU_WIRE_SHOCK) + A.shocked = !mended + A.shock(usr, 50) + if(SSU_WIRE_UV) + A.uv_super = !mended + ..() + +datum/wires/suitstorage/UpdatePulsed(index) + var/obj/machinery/suit_storage_unit/A = holder + if(IsIndexCut(index)) + return + switch(index) + if(SSU_WIRE_ID) + A.secure = !A.secure + if(SSU_WIRE_SAFETY) + A.safeties = !A.safeties + if(SSU_WIRE_SHOCK) + A.shocked = !A.shocked + if(A.shocked) + A.shock(usr, 50) + if(SSU_WIRE_UV) + A.uv_super = !A.uv_super + ..() \ No newline at end of file diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index f7fed41581d..4595b265b79 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -21,6 +21,10 @@ var/locked = FALSE var/safeties = TRUE var/broken = FALSE + var/secure = FALSE //set to true to enable ID locking + var/shocked = FALSE + req_access = list(access_eva) //the ID needed if ID lock is enabled + var/datum/wires/suitstorage/asd var/uv = FALSE var/uv_super = FALSE @@ -108,7 +112,9 @@ mask_type = /obj/item/clothing/mask/breath storage_type = /obj/item/tank/emergency_oxygen/double - +/obj/machinery/suit_storage_unit/New() + ..() + asd = new(src) /obj/machinery/suit_storage_unit/Initialize() . = ..() diff --git a/paradise.dme b/paradise.dme index 48290761e6a..6bc307dd5c2 100644 --- a/paradise.dme +++ b/paradise.dme @@ -386,6 +386,7 @@ #include "code\datums\wires\radio.dm" #include "code\datums\wires\robot.dm" #include "code\datums\wires\smartfridge.dm" +#include "code\datums\wires\suitstorage.dm" #include "code\datums\wires\syndicatebomb.dm" #include "code\datums\wires\tesla_coil.dm" #include "code\datums\wires\vending.dm"