From 5a5c620692a29ec1d0f173be56bdd01d545888c3 Mon Sep 17 00:00:00 2001 From: Miniature Date: Wed, 4 Jan 2012 22:52:01 +1030 Subject: [PATCH] Now atmos alarms automatically let atmos techs change them if they go off, as well as people can turn that off or make them permamently controllable by the computer also made it possible for them to mess with any alarm that hasn't had the atmos control completely disabled, but not a way to turn that feature on --- code/WorkInProgress/Mini/atmos_control.dm | 3 +- code/game/machinery/alarm.dm | 46 +++++++++++++++++++++-- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/code/WorkInProgress/Mini/atmos_control.dm b/code/WorkInProgress/Mini/atmos_control.dm index e1aa431fd7f..b5a656ce352 100644 --- a/code/WorkInProgress/Mini/atmos_control.dm +++ b/code/WorkInProgress/Mini/atmos_control.dm @@ -10,6 +10,7 @@ anchored = 1.0 circuit = "/obj/item/weapon/circuitboard/atmoscontrol" var/obj/machinery/alarm/current = "" + var/overridden = 0 //not set yet, can't think of a good way to do it /obj/machinery/computer/atmoscontrol/attack_hand(mob/user) if(..()) @@ -36,7 +37,7 @@ return "" var/dat = "

[current.name]


" dat += current.return_status() - if(current.remote_control) + if(current.remote_control || overridden && current.rcon_setting) dat += "
[src.return_controls()]" return dat diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index f022e1ec89c..2d24ac4c8b8 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -41,6 +41,11 @@ //var/skipprocess = 0 //Experimenting var/alarm_frequency = 1437 var/remote_control = 0 +#define RCON_NO 1 +#define RCON_AUTO 2 +#define RCON_YES 3 + var/rcon_setting = 2 + var/rcon_time = 0 #define AALARM_REPORT_TIMEOUT 100 var/datum/radio_frequency/radio_connection var/locked = 1 @@ -212,9 +217,9 @@ /obj/machinery/alarm/proc/return_text() if(!(istype(usr, /mob/living/silicon)) && locked) - return "[src][return_status()]
[remote_control ? "Disable" : "Enable"] Remote Control
(Swipe ID card to unlock interface)" + return "[src][return_status()]
[rcon_text()]
(Swipe ID card to unlock interface)" else - return "[src][return_status()]
[remote_control ? "Disable" : "Enable"] Remote Control
[return_controls()]" + return "[src][return_status()]
[rcon_text()]
[return_controls()]" /obj/machinery/alarm/proc/return_status() var/turf/location = src.loc @@ -298,6 +303,24 @@ Temperature: [environment.temperature] return output +/obj/machinery/alarm/proc/rcon_text() + var/dat = "Remote Control:
" + if(src.rcon_setting == RCON_NO) + dat += "Off" + else + dat += "Off" + dat += " | " + if(src.rcon_setting == RCON_AUTO) + dat += "Auto" + else + dat += "Auto" + dat += " | " + if(src.rcon_setting == RCON_YES) + dat += "On" + else + dat += "On" + return dat + /obj/machinery/alarm/proc/return_controls() var/output = ""//"[alarm_zone] Air [name]
" @@ -492,8 +515,8 @@ table tr:first-child th:first-child { border: none;} /obj/machinery/alarm/Topic(href, href_list) if(..()) return - if(href_list["ctrl"]) - remote_control = !remote_control + if(href_list["rcon"]) + rcon_setting = text2num(href_list["rcon"]) src.updateUsrDialog() if(href_list["command"]) var/device_id = href_list["id_tag"] @@ -675,6 +698,21 @@ table tr:first-child th:first-child { border: none;} mode=AALARM_MODE_SCRUBBING apply_mode() + //atmos computer remote controll stuff + switch(rcon_setting) + if(RCON_NO) + remote_control = 0 + if(RCON_AUTO) + if(danger_level == 2) + remote_control = 1 + rcon_time = 60 + if(RCON_YES) + remote_control = 1 + if(rcon_time > 0) + rcon_time-- + else if(rcon_setting == RCON_AUTO) + remote_control = 0 + src.updateDialog() return