diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm
index 48c9a443..5a84c284 100644
--- a/code/game/machinery/doors/brigdoors.dm
+++ b/code/game/machinery/doors/brigdoors.dm
@@ -26,7 +26,10 @@
var/timing = 1 // boolean, true/1 timer is on, false/0 means it's not timing
var/picture_state // icon_state of alert picture, if not displaying text/numbers
var/list/obj/machinery/targets = list()
+ var/list/obj/item/clothing/under/color/orange/uniforms = list()
var/timetoset = 0 // Used to set releasetime upon starting the timer
+ var/spamcheck = 0
+ var/alerted = 0
maptext_height = 26
maptext_width = 32
@@ -47,6 +50,10 @@
if(C.id == src.id)
targets += C
+ for(var/obj/item/clothing/under/color/orange/D in world)
+ if(D.id == id)
+ uniforms += D
+
if(targets.len==0)
stat |= BROKEN
update_icon()
@@ -68,6 +75,8 @@
if(timeleft > 1e5)
src.releasetime = 0
+ if(timeleft < 30 && !alerted)
+ alertuniforms()
if(world.timeofday > src.releasetime)
src.timer_end() // open doors, reset timer, clear status screen
@@ -109,6 +118,9 @@
if(C.opened && !C.close()) continue
C.locked = 1
C.icon_state = C.icon_locked
+
+ alerted = 0
+
return 1
@@ -148,6 +160,34 @@
return
+// Alert the uniform wearers that their timer is about to end up
+/obj/machinery/door_timer/proc/alertuniforms()
+ if(!uniforms.len)
+ alerted = 1
+ return
+
+ for(var/obj/item/clothing/under/color/orange/D in uniforms)
+ if(!ishuman(D.loc)) continue
+ D.loc << "A speaker in the collar of your suit pings:\n\blue Your cell timer will expire in 30 seconds or less. Please go to your cell to speed up processing."
+
+ alerted = 1
+
+ return
+
+// Alert the uniform wearers that they are needed at their cell
+/obj/machinery/door_timer/proc/summonuniforms()
+ if(spamcheck) return
+ if(!uniforms.len) return
+ for(var/obj/item/clothing/under/color/orange/D in uniforms)
+ if(!ishuman(D.loc)) continue
+ D.loc << "A speaker in the collar of your suit pings:\n\red You have been summoned to your cell!"
+
+ spamcheck = 1
+ spawn(30)
+ spamcheck = 0
+
+ return
+
//Allows AIs to use door_timer, see human attack_hand function below
/obj/machinery/door_timer/attack_ai(var/mob/user as mob)
return src.attack_hand(user)
@@ -203,6 +243,14 @@
else
dat += "
Activate Flash"
+ if(uniforms.len)
+ if(!spamcheck)
+ dat +="
Summon prisoner"
+ else
+ dat +="
Anti-spam measure activated. Please wait."
+ else
+ dat +="
No unfiroms linked"
+
dat += "
Close"
dat += "