mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 18:13:34 +01:00
Can now middle click doors to toggle bolt lights, plus cleanup.
Middle-clicking doors now allows the AI to toggle bolt lights. Attempts to achieve some consistency in door feedback messages. Conflicts: code/game/machinery/camera/tracking.dm code/game/machinery/doors/airlock.dm
This commit is contained in:
+14
-3
@@ -86,6 +86,8 @@
|
||||
A.AICtrlClick(src)
|
||||
/mob/living/silicon/ai/AltClickOn(var/atom/A)
|
||||
A.AIAltClick(src)
|
||||
/mob/living/silicon/ai/MiddleClickOn(var/atom/A)
|
||||
A.AIMiddleClick(src)
|
||||
|
||||
/*
|
||||
The following criminally helpful code is just the previous code cleaned up;
|
||||
@@ -102,7 +104,6 @@
|
||||
Topic("aiDisable=7", list("aiDisable"="7"), 1)
|
||||
return
|
||||
|
||||
|
||||
/atom/proc/AICtrlClick()
|
||||
return
|
||||
|
||||
@@ -126,16 +127,26 @@
|
||||
if(emagged)
|
||||
return
|
||||
if(!secondsElectrified)
|
||||
// permenant shock
|
||||
// permanent shock
|
||||
Topic("aiEnable=6", list("aiEnable"="6"), 1) // 1 meaning no window (consistency!)
|
||||
else
|
||||
// disable/6 is not in Topic; disable/5 disables both temporary and permenant shock
|
||||
// disable/6 is not in Topic; disable/5 disables both temporary and permanent shock
|
||||
Topic("aiDisable=5", list("aiDisable"="5"), 1)
|
||||
return
|
||||
|
||||
/obj/machinery/turretid/AIAltClick() //toggles lethal on turrets
|
||||
src.lethal = !src.lethal
|
||||
src.updateTurrets()
|
||||
|
||||
/atom/proc/AIMiddleClick()
|
||||
return
|
||||
|
||||
/obj/machinery/door/airlock/AIMiddleClick() // Toggles door bolt lights.
|
||||
if(!src.lights)
|
||||
Topic("aiEnable=10", list("aiEnable"="10"), 1) // 1 meaning no window (consistency!)
|
||||
else
|
||||
Topic("aiDisable=10", list("aiDisable"="10"), 1)
|
||||
return
|
||||
|
||||
//
|
||||
// Override AdjacentQuick for AltClicking
|
||||
|
||||
@@ -241,4 +241,4 @@
|
||||
else
|
||||
if (sorttext(a.c_tag, b.c_tag) < 0)
|
||||
L.Swap(j, j + 1)
|
||||
return L
|
||||
return L
|
||||
|
||||
@@ -894,10 +894,11 @@ About the new airlock wires panel:
|
||||
if(1)
|
||||
//disable idscan
|
||||
if(src.isWireCut(AIRLOCK_WIRE_IDSCAN))
|
||||
usr << "The IdScan wire has been cut - So, you can't disable it, but it is already disabled anyway."
|
||||
usr << "The IdScan wire has been cut - The IdScan feature is already disabled."
|
||||
else if(src.aiDisabledIdScanner)
|
||||
usr << "You've already disabled the IdScan feature."
|
||||
usr << "The IdScan feature is already disabled."
|
||||
else
|
||||
usr << "The IdScan feature has been disabled."
|
||||
src.aiDisabledIdScanner = 1
|
||||
if(2)
|
||||
//disrupt main power
|
||||
@@ -914,36 +915,19 @@ About the new airlock wires panel:
|
||||
if(4)
|
||||
//drop door bolts
|
||||
if(src.isWireCut(AIRLOCK_WIRE_DOOR_BOLTS))
|
||||
usr << "You can't drop the door bolts - The door bolt dropping wire has been cut."
|
||||
else if(src.locked!=1)
|
||||
src.locked = 1
|
||||
update_icon()
|
||||
usr << "The door bolt control wire has been cut - The door bolts are already dropped."
|
||||
else if(src.locked)
|
||||
usr << "The door bolts are already dropped."
|
||||
else
|
||||
src.lock()
|
||||
usr << "The door bolts have been dropped."
|
||||
if(5)
|
||||
//un-electrify door
|
||||
if(src.isWireCut(AIRLOCK_WIRE_ELECTRIFY))
|
||||
usr << text("Can't un-electrify the airlock - The electrification wire is cut.")
|
||||
else if(src.secondsElectrified==-1 || src.secondsElectrified>0)
|
||||
usr << text("The electrification wire is cut - Cannot un-electrify the door.")
|
||||
else if(secondsElectrified != 0)
|
||||
usr << "The door is now un-electrified."
|
||||
src.secondsElectrified = 0
|
||||
|
||||
if(8)
|
||||
// Safeties! We don't need no stinking safeties!
|
||||
if (src.isWireCut(AIRLOCK_WIRE_SAFETY))
|
||||
usr << text("Control to door sensors is disabled.")
|
||||
else if (src.safe)
|
||||
safe = 0
|
||||
else
|
||||
usr << text("Firmware reports safeties already overriden.")
|
||||
|
||||
if(9)
|
||||
// Door speed control
|
||||
if(src.isWireCut(AIRLOCK_WIRE_SPEED))
|
||||
usr << text("Control to door timing circuitry has been severed.")
|
||||
else if (src.normalspeed)
|
||||
normalspeed = 0
|
||||
else
|
||||
usr << text("Door timing circurity already accellerated.")
|
||||
|
||||
if(7)
|
||||
//close door
|
||||
if(src.welded)
|
||||
@@ -954,15 +938,31 @@ About the new airlock wires panel:
|
||||
close()
|
||||
else
|
||||
open()
|
||||
|
||||
if(8)
|
||||
// Safeties! We don't need no stinking safeties!
|
||||
if (src.isWireCut(AIRLOCK_WIRE_SAFETY))
|
||||
usr << text("Control to door sensors is disabled.")
|
||||
else if (src.safe)
|
||||
safe = 0
|
||||
else
|
||||
usr << text("Firmware reports safeties already overridden.")
|
||||
if(9)
|
||||
// Door speed control
|
||||
if(src.isWireCut(AIRLOCK_WIRE_SPEED))
|
||||
usr << text("Control to door timing circuitry has been severed.")
|
||||
else if (src.normalspeed)
|
||||
normalspeed = 0
|
||||
else
|
||||
usr << text("Door timing circuity already accelerated.")
|
||||
if(10)
|
||||
// Bolt lights
|
||||
if(src.isWireCut(AIRLOCK_WIRE_LIGHT))
|
||||
usr << text("Control to door bolt lights has been severed.</a>")
|
||||
usr << "The bolt lights wire has been cut - The door bolt lights are already disabled."
|
||||
else if (src.lights)
|
||||
lights = 0
|
||||
usr << "The door bolt lights have been disabled."
|
||||
else
|
||||
usr << text("Door bolt lights are already disabled!")
|
||||
usr << "The door bolt lights are already disabled!"
|
||||
|
||||
else if(href_list["aiEnable"])
|
||||
var/code = text2num(href_list["aiEnable"])
|
||||
@@ -970,20 +970,23 @@ About the new airlock wires panel:
|
||||
if(1)
|
||||
//enable idscan
|
||||
if(src.isWireCut(AIRLOCK_WIRE_IDSCAN))
|
||||
usr << "You can't enable IdScan - The IdScan wire has been cut."
|
||||
usr << "The IdScan wire has been cut - The IdScan feature cannot be enabled."
|
||||
else if(src.aiDisabledIdScanner)
|
||||
usr << "The IdScan feature has been enabled."
|
||||
src.aiDisabledIdScanner = 0
|
||||
else
|
||||
usr << "The IdScan feature is not disabled."
|
||||
usr << "The IdScan feature is already enabled."
|
||||
if(4)
|
||||
//raise door bolts
|
||||
if(src.isWireCut(AIRLOCK_WIRE_DOOR_BOLTS))
|
||||
usr << text("The door bolt control wire is cut - you can't raise the door bolts.<br>\n")
|
||||
usr << "The door bolt control wire has been cut - The door bolts cannot be raised."
|
||||
else if(!src.locked)
|
||||
usr << text("The door bolts are already up.<br>\n")
|
||||
usr << "The door bolts are already raised."
|
||||
else
|
||||
src.unlock()
|
||||
|
||||
if(src.unlock())
|
||||
usr << "The door bolts have been raised."
|
||||
else
|
||||
usr << "Unable to raise door bolts."
|
||||
if(5)
|
||||
//electrify door for 30 seconds
|
||||
if(src.isWireCut(AIRLOCK_WIRE_ELECTRIFY))
|
||||
@@ -991,7 +994,7 @@ About the new airlock wires panel:
|
||||
else if(src.secondsElectrified==-1)
|
||||
usr << text("The door is already indefinitely electrified. You'd have to un-electrify it before you can re-electrify it with a non-forever duration.<br>\n")
|
||||
else if(src.secondsElectrified!=0)
|
||||
usr << text("The door is already electrified. You can't re-electrify it while it's already electrified.<br>\n")
|
||||
usr << text("The door is already electrified. Cannot re-electrify it while it's already electrified.<br>\n")
|
||||
else
|
||||
shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])")
|
||||
usr.attack_log += text("\[[time_stamp()]\] <font color='red'>Electrified the [name] at [x] [y] [z]</font>")
|
||||
@@ -1002,7 +1005,6 @@ About the new airlock wires panel:
|
||||
src.secondsElectrified-=1
|
||||
if(src.secondsElectrified<0)
|
||||
src.secondsElectrified = 0
|
||||
src.updateUsrDialog()
|
||||
sleep(10)
|
||||
if(6)
|
||||
//electrify door indefinitely
|
||||
@@ -1017,27 +1019,6 @@ About the new airlock wires panel:
|
||||
usr.attack_log += text("\[[time_stamp()]\] <font color='red'>Electrified the [name] at [x] [y] [z]</font>")
|
||||
usr << "The door is now electrified."
|
||||
src.secondsElectrified = -1
|
||||
|
||||
if (8) // Not in order >.>
|
||||
// Safeties! Maybe we do need some stinking safeties!
|
||||
if (src.isWireCut(AIRLOCK_WIRE_SAFETY))
|
||||
usr << text("Control to door sensors is disabled.")
|
||||
else if (!src.safe)
|
||||
safe = 1
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
usr << text("Firmware reports safeties already in place.")
|
||||
|
||||
if(9)
|
||||
// Door speed control
|
||||
if(src.isWireCut(AIRLOCK_WIRE_SPEED))
|
||||
usr << text("Control to door timing circuitry has been severed.")
|
||||
else if (!src.normalspeed)
|
||||
normalspeed = 1
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
usr << text("Door timing circurity currently operating normally.")
|
||||
|
||||
if(7)
|
||||
//open door
|
||||
if(src.welded)
|
||||
@@ -1048,16 +1029,31 @@ About the new airlock wires panel:
|
||||
open()
|
||||
else
|
||||
close()
|
||||
|
||||
if (8)
|
||||
// Safeties! Maybe we do need some stinking safeties!
|
||||
if (src.isWireCut(AIRLOCK_WIRE_SAFETY))
|
||||
usr << text("Control to door sensors is disabled.")
|
||||
else if (!src.safe)
|
||||
safe = 1
|
||||
else
|
||||
usr << text("Firmware reports safeties already in place.")
|
||||
if(9)
|
||||
// Door speed control
|
||||
if(src.isWireCut(AIRLOCK_WIRE_SPEED))
|
||||
usr << text("Control to door timing circuitry has been severed.")
|
||||
else if (!src.normalspeed)
|
||||
normalspeed = 1
|
||||
else
|
||||
usr << text("Door timing circuity currently operating normally.")
|
||||
if(10)
|
||||
// Bolt lights
|
||||
if(src.isWireCut(AIRLOCK_WIRE_LIGHT))
|
||||
usr << text("Control to door bolt lights has been severed.</a>")
|
||||
usr << "The bolt lights wire has been cut - The door bolt lights cannot be enabled."
|
||||
else if (!src.lights)
|
||||
lights = 1
|
||||
src.updateUsrDialog()
|
||||
usr << "The door bolt lights have been enabled"
|
||||
else
|
||||
usr << text("Door bolt lights are already enabled!")
|
||||
usr << "The door bolt lights are already enabled!"
|
||||
|
||||
add_fingerprint(usr)
|
||||
update_icon()
|
||||
@@ -1263,13 +1259,15 @@ About the new airlock wires panel:
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/door/airlock/proc/unlock(var/forced=0)
|
||||
if (!src.locked) return
|
||||
if (!src.locked) return 0
|
||||
|
||||
if(forced || src.arePowerSystemsOn()) //only can raise bolts if power's on
|
||||
src.locked = 0
|
||||
for(var/mob/M in range(1,src))
|
||||
M.show_message("You hear a click from the bottom of the door.", 2)
|
||||
update_icon()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/door/airlock/New()
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user