Merge pull request #1491 from Hubblenaut/morgue

Morgue Trays interface with occupant minds
This commit is contained in:
Datraen
2016-04-27 20:49:15 -04:00
4 changed files with 41 additions and 1 deletions
+11
View File
@@ -86,6 +86,17 @@
qdel(src)
return
/obj/structure/closet/body_bag/proc/get_occupants()
var/list/occupants = list()
for(var/mob/living/carbon/human/H in contents)
occupants += H
return occupants
/obj/structure/closet/body_bag/proc/update(var/broadcast=0)
if(istype(loc, /obj/structure/morgue))
var/obj/structure/morgue/M = loc
M.update(broadcast)
/obj/structure/closet/body_bag/update_icon()
if(opened)
icon_state = icon_opened
+18 -1
View File
@@ -18,6 +18,7 @@
dir = EAST
density = 1
var/obj/structure/m_tray/connected = null
var/list/occupants = list()
anchored = 1.0
/obj/structure/morgue/Destroy()
@@ -26,12 +27,28 @@
connected = null
return ..()
/obj/structure/morgue/proc/update()
/obj/structure/morgue/proc/get_occupants()
occupants.Cut()
for(var/mob/living/carbon/human/H in contents)
occupants += H
for(var/obj/structure/closet/body_bag/B in contents)
occupants += B.get_occupants()
/obj/structure/morgue/proc/update(var/broadcast=0)
if (src.connected)
src.icon_state = "morgue0"
else
if (src.contents.len)
src.icon_state = "morgue2"
get_occupants()
for (var/mob/living/carbon/human/H in occupants)
if(H.isSynthetic() || H.suiciding || !H.ckey || !H.client || (NOCLONE in H.mutations) || (H.species && H.species.flags & NO_SCAN))
src.icon_state = "morgue2"
break
else
src.icon_state = "morgue3"
if(broadcast)
broadcast_medical_hud_message("[src] was able to establish a mental interface with occupant.", src)
else
src.icon_state = "morgue1"
return