Linked uniforms

Initial addition of the labelled prisoner jumpsuits and cell control
functionality for the introduction of the communal brig. One note to
review (namely, if id = null for cell spawning, that may cause a runtime
error).
This commit is contained in:
skull132
2015-06-10 02:08:42 +03:00
parent 9d1d24b4c8
commit f7bd2b41e1
4 changed files with 93 additions and 5 deletions
+50
View File
@@ -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 += "<br/><A href='?src=\ref[src];fc=1'>Activate Flash</A>"
if(uniforms.len)
if(!spamcheck)
dat +="<br><a href='?src=\ref[src];summon=1'>Summon prisoner</a>"
else
dat +="<br><font color=red>Anti-spam measure activated. Please wait.</font>"
else
dat +="<br>No unfiroms linked"
dat += "<br/><br/><a href='?src=\ref[user];mach_close=computer'>Close</a>"
dat += "</TT></BODY></HTML>"
@@ -249,6 +297,8 @@
if(href_list["change"])
src.timer_start()
if(href_list["summon"])
summonuniforms()
src.add_fingerprint(usr)
src.updateUsrDialog()
@@ -320,8 +320,23 @@
New()
..()
new /obj/item/clothing/under/color/orange( src )
new /obj/item/clothing/shoes/orange( src )
switch(id)
if("Cell 1")
new /obj/item/clothing/under/color/orange/cell1(src)
new /obj/item/clothing/shoes/orange(src)
if("Cell 2")
new /obj/item/clothing/under/color/orange/cell2(src)
new /obj/item/clothing/shoes/orange(src)
if("Cell 3")
new /obj/item/clothing/under/color/orange/cell3(src)
new /obj/item/clothing/shoes/orange(src)
if("Cell 4")
new /obj/item/clothing/under/color/orange/cell4(src)
new /obj/item/clothing/shoes/orange(src)
else
new /obj/item/clothing/under/color/orange(src)
new /obj/item/clothing/shoes/orange(src)
return
+17
View File
@@ -42,6 +42,23 @@
has_sensor = 2
sensor_mode = 3
flags = FPRINT | TABLEPASS
var/id
/obj/item/clothing/under/color/orange/cell1
desc = "It's standardised Nanotrasen prisoner-wear. Its suit sensors are stuck in the \"Fully On\" position.\nThis one has \"Cell 1\" marked on it."
id = "Cell 1"
/obj/item/clothing/under/color/orange/cell2
desc = "It's standardised Nanotrasen prisoner-wear. Its suit sensors are stuck in the \"Fully On\" position.\nThis one has \"Cell 2\" marked on it."
id = "Cell 2"
/obj/item/clothing/under/color/orange/cell3
desc = "It's standardised Nanotrasen prisoner-wear. Its suit sensors are stuck in the \"Fully On\" position.\nThis one has \"Cell 3\" marked on it."
id = "Cell 3"
/obj/item/clothing/under/color/orange/cell4
desc = "It's standardised Nanotrasen prisoner-wear. Its suit sensors are stuck in the \"Fully On\" position.\nThis one has \"Cell 4\" marked on it."
id = "Cell 4"
/obj/item/clothing/under/color/pink
name = "pink jumpsuit"
@@ -66,6 +66,7 @@
//Ties
var/tie_msg
var/aband_msg
var/cell_msg
if(istype(w_uniform,/obj/item/clothing/under))
var/obj/item/clothing/under/U = w_uniform
if(U.hastie && U.aband)
@@ -81,12 +82,17 @@
else
aband_msg += " with \icon[U.webbing] \a [U.webbing]"
if(istype(w_uniform,/obj/item/clothing/under/color/orange))
var/obj/item/clothing/under/color/orange/V = w_uniform
if(V.id)
cell_msg = " It has a marker for \"[V.id]\" painted on the front and back."
if(w_uniform.blood_DNA)
msg += "<span class='warning'>[t_He] [t_is] wearing \icon[w_uniform] [w_uniform.gender==PLURAL?"some":"a"] blood-stained [w_uniform.name][tie_msg][aband_msg]!</span>\n"
msg += "<span class='warning'>[t_He] [t_is] wearing \icon[w_uniform] [w_uniform.gender==PLURAL?"some":"a"] blood-stained [w_uniform.name][tie_msg][aband_msg]![cell_msg]</span>\n"
else if(w_uniform.wasbloody == 2)
msg += "<span class='warning'>[t_He] [t_is] wearing \icon[w_uniform] [w_uniform.gender==PLURAL?"some":"a"] luminol-covered [w_uniform.name][tie_msg][aband_msg]!</span>\n"
msg += "<span class='warning'>[t_He] [t_is] wearing \icon[w_uniform] [w_uniform.gender==PLURAL?"some":"a"] luminol-covered [w_uniform.name][tie_msg][aband_msg]![cell_msg]</span>\n"
else
msg += "[t_He] [t_is] wearing \icon[w_uniform] \a [w_uniform][tie_msg][aband_msg].\n"
msg += "[t_He] [t_is] wearing \icon[w_uniform] \a [w_uniform][tie_msg][aband_msg].[cell_msg]\n"
//head
if(head)