converts aicontroldisabled into a define, also mochi suggestions

This commit is contained in:
Kyep
2020-07-27 01:24:59 -07:00
parent 1a10357ae0
commit 2c0ebf2728
3 changed files with 35 additions and 34 deletions
+17 -17
View File
@@ -71,7 +71,7 @@
. += "The door bolts [A.locked ? "have fallen!" : "look up."]"
. += "The door bolt lights are [(A.lights && haspower) ? "on." : "off!"]"
. += "The test light is [haspower ? "on." : "off!"]"
. += "The 'AI control allowed' light is [(A.aiControlDisabled == 0 && !A.emagged && haspower) ? "on" : "off"]."
. += "The 'AI control allowed' light is [(A.aiControlDisabled == AICONTROLDISABLED_OFF && !A.emagged && haspower) ? "on" : "off"]."
. += "The 'Check Wiring' light is [(A.safe == 0 && haspower) ? "on" : "off"]."
. += "The 'Check Timing Mechanism' light is [(A.normalspeed == 0 && haspower) ? "on" : "off"]."
. += "The emergency lights are [(A.emergency && haspower) ? "on" : "off"]."
@@ -114,15 +114,15 @@
if(!mended)
//one wire for AI control. Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all.
//aiControlDisabled: 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.
if(A.aiControlDisabled == 0)
A.aiControlDisabled = 1
else if(A.aiControlDisabled == -1)
A.aiControlDisabled = 2
if(A.aiControlDisabled == AICONTROLDISABLED_OFF)
A.aiControlDisabled = AICONTROLDISABLED_ON
else if(A.aiControlDisabled == AICONTROLDISABLED_PERMA)
A.aiControlDisabled = AICONTROLDISABLED_BYPASS
else
if(A.aiControlDisabled == 1)
A.aiControlDisabled = 0
else if(A.aiControlDisabled == 2)
A.aiControlDisabled = -1
if(A.aiControlDisabled == AICONTROLDISABLED_ON)
A.aiControlDisabled = AICONTROLDISABLED_OFF
else if(A.aiControlDisabled == AICONTROLDISABLED_BYPASS)
A.aiControlDisabled = AICONTROLDISABLED_PERMA
if(AIRLOCK_WIRE_ELECTRIFY)
if(!mended)
@@ -174,17 +174,17 @@
//two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter).
A.loseBackupPower()
if(AIRLOCK_WIRE_AI_CONTROL)
if(A.aiControlDisabled == 0)
A.aiControlDisabled = 1
else if(A.aiControlDisabled == -1)
A.aiControlDisabled = 2
if(A.aiControlDisabled == AICONTROLDISABLED_OFF)
A.aiControlDisabled = AICONTROLDISABLED_ON
else if(A.aiControlDisabled == AICONTROLDISABLED_PERMA)
A.aiControlDisabled = AICONTROLDISABLED_BYPASS
spawn(10)
if(A)
if(A.aiControlDisabled == 1)
A.aiControlDisabled = 0
else if(A.aiControlDisabled == 2)
A.aiControlDisabled = -1
if(A.aiControlDisabled == AICONTROLDISABLED_ON)
A.aiControlDisabled = AICONTROLDISABLED_OFF
else if(A.aiControlDisabled == AICONTROLDISABLED_BYPASS)
A.aiControlDisabled = AICONTROLDISABLED_PERMA
if(AIRLOCK_WIRE_ELECTRIFY)
//one wire for electrifying the door. Sending a pulse through this electrifies the door for 30 seconds.