diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm
index a47f261f9c1..c8ddbc6e40a 100644
--- a/code/__HELPERS/game.dm
+++ b/code/__HELPERS/game.dm
@@ -455,4 +455,7 @@ proc/isInSight(var/atom/A, var/atom/B)
return 1
/proc/MinutesToTicks(var/minutes as num)
- return minutes * 60 * 10
\ No newline at end of file
+ return minutes * 60 * 10
+
+/proc/SecondsToTicks(var/seconds)
+ return seconds * 10
\ No newline at end of file
diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm
index 96709e751f7..0dc271e4364 100644
--- a/code/_onclick/ai.dm
+++ b/code/_onclick/ai.dm
@@ -125,22 +125,20 @@
return
/obj/machinery/door/airlock/AIAltShiftClick() // Sets/Unsets Emergency Access Override
- if(emagged)
- return
- if(!emergency)
- Topic("aiEnable=11", list("aiEnable"="11"), 1) // 1 meaning no window (consistency!)
+ if(density)
+ Topic(src, list("src"= "\ref[src]", "command"="emergency", "activate" = "1"), 1) // 1 meaning no window (consistency!)
else
- Topic("aiDisable=11", list("aiDisable"="11"), 1)
+ Topic(src, list("src"= "\ref[src]", "command"="emergency", "activate" = "0"), 1)
return
-
+
/atom/proc/AIShiftClick()
return
/obj/machinery/door/airlock/AIShiftClick() // Opens and closes doors!
if(density)
- Topic("aiEnable=7", list("aiEnable"="7"), 1) // 1 meaning no window (consistency!)
+ Topic(src, list("src"= "\ref[src]", "command"="open", "activate" = "1"), 1) // 1 meaning no window (consistency!)
else
- Topic("aiDisable=7", list("aiDisable"="7"), 1)
+ Topic(src, list("src"= "\ref[src]", "command"="open", "activate" = "0"), 1)
return
/atom/proc/AICtrlClick(var/mob/living/silicon/ai/user)
@@ -151,9 +149,9 @@
/obj/machinery/door/airlock/AICtrlClick() // Bolts doors
if(locked)
- Topic("aiEnable=4", list("aiEnable"="4"), 1)// 1 meaning no window (consistency!)
+ Topic(src, list("src"= "\ref[src]", "command"="bolts", "activate" = "0"), 1)// 1 meaning no window (consistency!)
else
- Topic("aiDisable=4", list("aiDisable"="4"), 1)
+ Topic(src, list("src"= "\ref[src]", "command"="bolts", "activate" = "1"), 1)
/obj/machinery/power/apc/AICtrlClick() // turns off/on APCs.
Topic("breaker=1", list("breaker"="1"), 0) // 0 meaning no window (consistency! wait...)
@@ -165,16 +163,12 @@
AltClick(A)
/obj/machinery/door/airlock/AIAltClick() // Electrifies doors.
- if(emagged)
- return
- if(!secondsElectrified)
+ if(!electrified_until)
// permanent shock
- Topic("aiEnable=6", list("aiEnable"="6"), 1) // 1 meaning no window (consistency!)
- use_log += text("\[[time_stamp()]\] [usr.name] ([usr.ckey]) electrified [src].")
+ Topic(src, list("src"= "\ref[src]", "command"="electrify_permanently", "activate" = "1"), 1) // 1 meaning no window (consistency!)
else
// disable/6 is not in Topic; disable/5 disables both temporary and permanent shock
- Topic("aiDisable=5", list("aiDisable"="5"), 1)
- use_log += text("\[[time_stamp()]\] [usr.name] ([usr.ckey]) toggled turned off the [src]'s electrification.")
+ Topic(src, list("src"= "\ref[src]", "command"="electrify_permanently", "activate" = "0"), 1)
return
/obj/machinery/turretid/AIAltClick() //toggles lethal on turrets
@@ -185,11 +179,12 @@
/obj/machinery/door/airlock/AIMiddleClick() // Toggles door bolt lights.
if(!src.lights)
- Topic("aiEnable=10", list("aiEnable"="10"), 1) // 1 meaning no window (consistency!)
+ Topic(src, list("src"= "\ref[src]", "command"="lights", "activate" = "1"), 1) // 1 meaning no window (consistency!)
else
- Topic("aiDisable=10", list("aiDisable"="10"), 1)
+ Topic(src, list("src"= "\ref[src]", "command"="lights", "activate" = "0"), 1)
return
+
//
// Override AdjacentQuick for AltClicking
//
diff --git a/code/datums/wires/airlock.dm b/code/datums/wires/airlock.dm
index 211e82d4394..62f9628b467 100644
--- a/code/datums/wires/airlock.dm
+++ b/code/datums/wires/airlock.dm
@@ -42,13 +42,14 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
((A.aiControlDisabled==0 && !A.emagged && haspower) ? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."),
((A.safe==0 && haspower) ? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off."),
((A.normalspeed==0 && haspower) ? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off."),
- ((A.emergency==0 && haspower) ? "The emergency lights are off." : "The emergency lights are on."))
-
+ ((A.emergency && haspower) ? "The emergency lights are on." : "The emergency lights are off."))
/datum/wires/airlock/UpdateCut(var/index, var/mended)
var/obj/machinery/door/airlock/A = holder
switch(index)
+ if(AIRLOCK_WIRE_IDSCAN)
+ A.aiDisabledIdScanner = !mended
if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2)
if(!mended)
@@ -56,9 +57,8 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
A.loseMainPower()
A.shock(usr, 50)
else
- if((!IsIndexCut(AIRLOCK_WIRE_MAIN_POWER1)) && (!IsIndexCut(AIRLOCK_WIRE_MAIN_POWER2)))
- A.regainMainPower()
- A.shock(usr, 50)
+ A.regainMainPower()
+ A.shock(usr, 50)
if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2)
@@ -67,9 +67,8 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
A.loseBackupPower()
A.shock(usr, 50)
else
- if((!IsIndexCut(AIRLOCK_WIRE_BACKUP_POWER1)) && (!IsIndexCut(AIRLOCK_WIRE_BACKUP_POWER2)))
- A.regainBackupPower()
- A.shock(usr, 50)
+ A.regainBackupPower()
+ A.shock(usr, 50)
if(AIRLOCK_WIRE_DOOR_BOLTS)
@@ -95,16 +94,14 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
A.aiControlDisabled = -1
if(AIRLOCK_WIRE_ELECTRIFY)
-
if(!mended)
//Cutting this wire electrifies the door, so that the next person to touch the door without insulated gloves gets electrocuted.
- if(A.secondsElectrified != -1)
+ if(A.electrified_until != -1)
A.shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])")
add_logs(usr, A, "electrified", null, addition="at [A.x],[A.y],[A.z]")
- A.secondsElectrified = -1
+ A.electrified_until = -1
else
- if(A.secondsElectrified == -1)
- A.secondsElectrified = 0
+ A.electrified_until = 0
return // Don't update the dialog.
if (AIRLOCK_WIRE_SAFETY)
@@ -120,15 +117,14 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
A.lights = mended
A.update_icon()
-
/datum/wires/airlock/UpdatePulsed(var/index)
var/obj/machinery/door/airlock/A = holder
switch(index)
if(AIRLOCK_WIRE_IDSCAN)
- //Sending a pulse through this disables emergency access and flashes the red light on the door (if the door has power).
- if((A.arePowerSystemsOn()) && A.density)
- A.door_animate("deny")
+ //Sending a pulse through flashes the red light on the door (if the door has power).
+ if(A.arePowerSystemsOn() && A.density)
+ A.do_animate("deny")
if(A.emergency)
A.emergency = 0
A.update_icon()
@@ -140,13 +136,11 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
//raises them if they are down (only if power's on)
if(!A.locked)
A.locked = 1
- for(var/mob/M in range(1, A))
- M << "You hear a click from the bottom of the door."
+ A.audible_message("You hear a click from the bottom of the door.", null, 1)
else
if(A.arePowerSystemsOn()) //only can raise bolts if power's on
A.locked = 0
- for(var/mob/M in range(1, A))
- M << "You hear a click from the bottom of the door."
+ A.audible_message("You hear a click from the bottom of the door.", null, 1)
A.update_icon()
if(AIRLOCK_WIRE_BACKUP_POWER1 || AIRLOCK_WIRE_BACKUP_POWER2)
@@ -167,22 +161,15 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
if(AIRLOCK_WIRE_ELECTRIFY)
//one wire for electrifying the door. Sending a pulse through this electrifies the door for 30 seconds.
- if(A.secondsElectrified==0)
+ if(A.electrified_until >= 0)
A.shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])")
add_logs(usr, A, "electrified", null, addition="at [A.x],[A.y],[A.z]")
- A.secondsElectrified = 30
- spawn(10)
- if(A)
- //TODO: Move this into process() and make pulsing reset secondsElectrified to 30
- while (A.secondsElectrified>0)
- A.secondsElectrified-=1
- if(A.secondsElectrified<0)
- A.secondsElectrified = 0
- sleep(10)
+ A.electrified_until = world.time + SecondsToTicks(30)
return
if(AIRLOCK_WIRE_OPEN_DOOR)
//tries to open the door without ID
- //will succeed only if the ID wire is cut or the door requires no access
+ //will succeed only if the ID wire is cut or the door requires no access and it's not emagged
+ if(A.emagged) return
if(!A.requiresID() || A.check_access(null))
if(A.density) A.open()
else A.close()
@@ -196,4 +183,4 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
if(AIRLOCK_WIRE_LIGHT)
A.lights = !A.lights
- A.update_icon()
+ A.update_icon()
\ No newline at end of file
diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm
index 9814b182fc6..cf9d5a04eab 100644
--- a/code/game/gamemodes/malfunction/Malf_Modules.dm
+++ b/code/game/gamemodes/malfunction/Malf_Modules.dm
@@ -109,7 +109,7 @@ rcd light flash thingy on matter drain
AL.close()
AL.locked = 1 //Bolt it!
AL.lights = 0 //Stealth bolt for a classic AI door trap.
- AL.secondsElectrified = -1 //Shock it!
+ AL.electrified_until = -1 //Shock it!
else if(!D.stat) //So that only powered doors are closed.
D.close() //Close ALL the doors!
@@ -140,7 +140,7 @@ rcd light flash thingy on matter drain
AL = D
if(AL.canAIControl() && !AL.stat) //Must be powered and have working AI wire.
AL.locked = 0
- AL.secondsElectrified = 0
+ AL.electrified_until = 0
AL.open()
AL.safe = 1
AL.lights = 1 //Essentially reset the airlock to normal.
diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm
index 070b99571ce..68c47360599 100644
--- a/code/game/machinery/Freezer.dm
+++ b/code/game/machinery/Freezer.dm
@@ -117,7 +117,7 @@
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
- ui = new(user, src, ui_key, "freezer.tmpl", "Gas Cooling System", 520, 300)
+ ui = new(user, src, ui_key, "freezer.tmpl", "Gas Cooling System", 540, 300)
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window
@@ -272,7 +272,7 @@
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
- ui = new(user, src, ui_key, "freezer.tmpl", "Gas Heating System", 520, 300)
+ ui = new(user, src, ui_key, "freezer.tmpl", "Gas Heating System", 540, 300)
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window
diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm
index 50d6eb49a0f..da5a81b7fcb 100644
--- a/code/game/machinery/door_control.dm
+++ b/code/game/machinery/door_control.dm
@@ -98,7 +98,7 @@
if(specialfunctions & BOLTS)
D.lock()
if(specialfunctions & SHOCK)
- D.secondsElectrified = -1
+ D.electrified_until = -1
if(specialfunctions & SAFE)
D.safe = 0
else
@@ -108,7 +108,7 @@
if(!D.isWireCut(4) && D.arePowerSystemsOn())
D.unlock()
if(specialfunctions & SHOCK)
- D.secondsElectrified = 0
+ D.electrified_until = 0
if(specialfunctions & SAFE)
D.safe = 1
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 1582c0cd6a7..44dc0fc8542 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -28,14 +28,13 @@
explosion_resistance = 15
var/aiControlDisabled = 0 //If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in.
var/hackProof = 0 // if 1, this door can't be hacked by the AI
- var/secondsMainPowerLost = 0 //The number of seconds until power is restored.
- var/secondsBackupPowerLost = 0 //The number of seconds until power is restored.
+ var/main_power_lost_until = 0 //World time when main power is restored.
+ var/backup_power_lost_until = -1 //World time when backup power is restored.
var/spawnPowerRestoreRunning = 0
var/welded = null
var/locked = 0
var/lights = 1 // bolt lights show by default
var/datum/wires/airlock/wires = null
- secondsElectrified = 0 //How many seconds remain until the door is no longer electrified. -1 if it is permanently electrified until someone fixes it.
var/aiDisabledIdScanner = 0
var/aiHacking = 0
var/obj/machinery/door/airlock/closeOther = null
@@ -208,6 +207,25 @@
icon = 'icons/obj/doors/Dooruranium.dmi'
mineral = "uranium"
var/last_event = 0
+
+/obj/machinery/door/airlock/process()
+ // Deliberate no call to parent
+ if(src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1) || src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2))
+ main_power_lost_until = -1
+ else if(main_power_lost_until > 0 && world.time > main_power_lost_until)
+ regainMainPower()
+
+ if(src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1) || src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2))
+ backup_power_lost_until = -1
+ if(backup_power_lost_until > 0&& world.time > backup_power_lost_until)
+ regainBackupPower()
+
+ if(electrified_until && !arePowerSystemsOn())
+ electrified_until = 0
+ else if(isWireCut(AIRLOCK_WIRE_ELECTRIFY))
+ electrified_until = -1
+ else if(electrified_until > 0 && world.time > electrified_until)
+ electrified_until = 0
/obj/machinery/door/airlock/uranium/process()
if(world.time > last_event+20)
@@ -308,6 +326,8 @@
else
user << "You do not know how to operate this airlock's mechanism."
return
+
+
/*
About the new airlock wires panel:
@@ -347,7 +367,7 @@ About the new airlock wires panel:
..(user)
/obj/machinery/door/airlock/proc/isElectrified()
- if(src.secondsElectrified != 0)
+ if(src.electrified_until != 0)
return 1
return 0
@@ -364,7 +384,7 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/proc/arePowerSystemsOn()
if (stat & (NOPOWER|BROKEN))
return 0
- return (src.secondsMainPowerLost==0 || src.secondsBackupPowerLost==0)
+ return (src.main_power_lost_until==0 || src.backup_power_lost_until==0)
/obj/machinery/door/airlock/requiresID()
return !(src.isWireCut(AIRLOCK_WIRE_IDSCAN) || aiDisabledIdScanner)
@@ -377,43 +397,25 @@ About the new airlock wires panel:
return 1
return 0
-/obj/machinery/door/airlock/proc/regainMainPower()
- if(src.secondsMainPowerLost > 0)
- src.secondsMainPowerLost = 0
-
/obj/machinery/door/airlock/proc/loseMainPower()
- if(src.secondsMainPowerLost <= 0)
- src.secondsMainPowerLost = 60
- if(src.secondsBackupPowerLost < 10)
- src.secondsBackupPowerLost = 10
- if(!src.spawnPowerRestoreRunning)
- src.spawnPowerRestoreRunning = 1
- spawn(0)
- var/cont = 1
- while (cont)
- sleep(10)
- cont = 0
- if(src.secondsMainPowerLost>0)
- if((!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2)))
- src.secondsMainPowerLost -= 1
- src.updateDialog()
- cont = 1
-
- if(src.secondsBackupPowerLost>0)
- if((!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2)))
- src.secondsBackupPowerLost -= 1
- src.updateDialog()
- cont = 1
- src.spawnPowerRestoreRunning = 0
- src.updateDialog()
+ // process() will handle the case of cut power cables
+ main_power_lost_until = world.time + SecondsToTicks(60)
+ backup_power_lost_until = max(backup_power_lost_until, world.time + SecondsToTicks(10))
/obj/machinery/door/airlock/proc/loseBackupPower()
- if(src.secondsBackupPowerLost < 60)
- src.secondsBackupPowerLost = 60
+ // process() will handle the case of cut power cables
+ backup_power_lost_until = world.time + SecondsToTicks(60)
+
+/obj/machinery/door/airlock/proc/regainMainPower()
+ if(!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1) && !src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2))
+ main_power_lost_until = 0
+ backup_power_lost_until = -1
+ update_icon()
/obj/machinery/door/airlock/proc/regainBackupPower()
- if(src.secondsBackupPowerLost > 0)
- src.secondsBackupPowerLost = 0
+ if(!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1) && !src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2))
+ backup_power_lost_until = 0
+ update_icon()
// shock user with probability prb (if all connections & power are working)
// returns 1 if shocked, 0 otherwise
@@ -440,7 +442,8 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/update_icon()
if(overlays) overlays.Cut()
overlays = list()
- if(emergency) overlays += image('icons/obj/doors/doorint.dmi', "elights")
+ if(emergency && arePowerSystemsOn())
+ overlays += image('icons/obj/doors/doorint.dmi', "elights")
if(density)
if(locked && lights)
icon_state = "door_locked"
@@ -458,144 +461,64 @@ About the new airlock wires panel:
icon_state = "door_open"
return
+
-/obj/machinery/door/airlock/door_animate(animation)
+/obj/machinery/door/airlock/do_animate(animation)
switch(animation)
if("opening")
if(overlays) overlays.Cut()
if(p_open)
spawn(2) // The only work around that works. Downside is that the door will be gone for a millisecond.
flick("o_door_opening", src) //can not use flick due to BYOND bug updating overlays right before flicking
+ update_icon()
else
- flick("door_opening", src)
+ flick("door_opening", src)//[stat ? "_stat":]
+ update_icon()
if("closing")
if(overlays) overlays.Cut()
if(p_open)
- flick("o_door_closing", src)
+ spawn(2)
+ flick("o_door_closing", src)
+ update_icon()
else
flick("door_closing", src)
+ update_icon()
if("spark")
- flick("door_spark", src)
+ if(density)
+ flick("door_spark", src)
if("deny")
if(density && src.arePowerSystemsOn())
flick("door_deny", src)
return
/obj/machinery/door/airlock/attack_ai(mob/user as mob)
- if (!check_synth_access(user))
- return
+ ui_interact(user)
- //Separate interface for the AI.
- user.set_machine(src)
- var/t1 = text("Airlock Control
\n")
- if(src.secondsMainPowerLost > 0)
- if((!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2)))
- t1 += text("Main power is offline for [] seconds.
\n", src.secondsMainPowerLost)
- else
- t1 += text("Main power is offline indefinitely.
\n")
- else
- t1 += text("Main power is online.")
+/obj/machinery/door/airlock/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
+ var/data[0]
- if(src.secondsBackupPowerLost > 0)
- if((!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2)))
- t1 += text("Backup power is offline for [] seconds.
\n", src.secondsBackupPowerLost)
- else
- t1 += text("Backup power is offline indefinitely.
\n")
- else if(src.secondsMainPowerLost > 0)
- t1 += text("Backup power is online.")
- else
- t1 += text("Backup power is offline, but will turn on if main power fails.")
- t1 += "
\n"
+ data["main_power_loss"] = round(main_power_lost_until > 0 ? max(main_power_lost_until - world.time, 0) / 10 : main_power_lost_until, 1)
+ data["backup_power_loss"] = round(backup_power_lost_until > 0 ? max(backup_power_lost_until - world.time, 0) / 10 : backup_power_lost_until, 1)
+ data["electrified"] = round(electrified_until > 0 ? max(electrified_until - world.time, 0) / 10 : electrified_until, 1)
+ data["open"] = !density
- if(src.isWireCut(AIRLOCK_WIRE_IDSCAN))
- t1 += text("IdScan wire is cut.
\n")
- else if(src.aiDisabledIdScanner)
- t1 += text("IdScan disabled. Enable?
\n", src)
- else
- t1 += text("IdScan enabled. Disable?
\n", src)
+ var/commands[0]
+ commands[++commands.len] = list("name" = "IdScan", "command"= "idscan", "active" = !aiDisabledIdScanner, "enabled" = "Enabled", "disabled" = "Disable", "danger" = 0, "act" = 1)
+ commands[++commands.len] = list("name" = "Bolts", "command"= "bolts", "active" = !locked, "enabled" = "Raised ", "disabled" = "Dropped", "danger" = 0, "act" = 0)
+ commands[++commands.len] = list("name" = "Bolt Lights", "command"= "lights", "active" = lights, "enabled" = "Enabled", "disabled" = "Disable", "danger" = 0, "act" = 1)
+ commands[++commands.len] = list("name" = "Safeties", "command"= "safeties", "active" = safe, "enabled" = "Nominal", "disabled" = "Overridden", "danger" = 1, "act" = 0)
+ commands[++commands.len] = list("name" = "Timing", "command"= "timing", "active" = normalspeed, "enabled" = "Nominal", "disabled" = "Overridden", "danger" = 1, "act" = 0)
+ commands[++commands.len] = list("name" = "Door State", "command"= "open", "active" = density, "enabled" = "Closed", "disabled" = "Opened", "danger" = 0, "act" = 0)
+ commands[++commands.len] = list("name" = "Emergency Access", "command"= "emergency", "active" = emergency, "enabled" = "Enabled", "disabled" = "Disabled", "danger" = 0, "act" = 0)
- if(src.emergency)
- t1 += text("Emergency Access Override is enabled. Disable?
\n", src)
- else
- t1 += text("Emergency Access Override is disabled. Enable?
\n", src)
-
- if(src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1))
- t1 += text("Main Power Input wire is cut.
\n")
- if(src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2))
- t1 += text("Main Power Output wire is cut.
\n")
- if(src.secondsMainPowerLost == 0)
- t1 += text("Temporarily disrupt main power?.
\n", src)
- if(src.secondsBackupPowerLost == 0)
- t1 += text("Temporarily disrupt backup power?.
\n", src)
-
- if(src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1))
- t1 += text("Backup Power Input wire is cut.
\n")
- if(src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2))
- t1 += text("Backup Power Output wire is cut.
\n")
-
- if(src.isWireCut(AIRLOCK_WIRE_DOOR_BOLTS))
- t1 += text("Door bolt control wire is cut.
\n")
- else if(!src.locked)
- t1 += text("Door bolts are up. Drop them?
\n", src)
- else
- t1 += text("Door bolts are down.")
- if(src.arePowerSystemsOn())
- t1 += text(" Raise?
\n", src)
- else
- t1 += text(" Cannot raise door bolts due to power failure.
\n")
-
- if(src.isWireCut(AIRLOCK_WIRE_LIGHT))
- t1 += text("Door bolt lights wire is cut.
\n")
- else if(!src.lights)
- t1 += text("Door lights are off. Enable?
\n", src)
- else
- t1 += text("Door lights are on. Disable?
\n", src)
-
- if(src.isWireCut(AIRLOCK_WIRE_ELECTRIFY))
- t1 += text("Electrification wire is cut.
\n")
- if(src.secondsElectrified==-1)
- t1 += text("Door is electrified indefinitely. Un-electrify it?
\n", src)
- else if(src.secondsElectrified>0)
- t1 += text("Door is electrified temporarily ([] seconds). Un-electrify it?
\n", src.secondsElectrified, src)
- else
- t1 += text("Door is not electrified. Electrify it for 30 seconds? Or, Electrify it indefinitely until someone cancels the electrification?
\n", src, src)
-
- if(src.isWireCut(AIRLOCK_WIRE_SAFETY))
- t1 += text("Door force sensors not responding.
\n")
- else if(src.safe)
- t1 += text("Door safeties operating normally. Override?
\n",src)
- else
- t1 += text("Danger. Door safeties disabled. Restore?
\n",src)
-
- if(src.isWireCut(AIRLOCK_WIRE_SPEED))
- t1 += text("Door timing circuitry not responding.
\n")
- else if(src.normalspeed)
- t1 += text("Door timing circuitry operating normally. Override?
\n",src)
- else
- t1 += text("Warning. Door timing circuitry operating abnormally. Restore?
\n",src)
-
-
-
-
- if(src.welded)
- if(frozen)
- t1 += text("Door appears to have been frozen shut.
\n")
- else
- t1 += text("Door appears to have been welded shut.
\n")
-
- else if(!src.locked)
- if(src.density)
- t1 += text("Open door
\n", src)
- else
- t1 += text("Close door
\n", src)
-
- t1 += text("