Adds a crew monitor for observers (#24118)

* wheee

* ignoring sensors now actually gets all health info

* a

* this wasn't supposed to go here

* delete observer menu on mob del

* erm

* global on my datum

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Luc
2024-03-23 22:51:55 +00:00
committed by GitHub
co-authored by github-actions
parent 9efaed6397
commit 6100c36987
5 changed files with 109 additions and 81 deletions
+7 -6
View File
@@ -7,7 +7,7 @@ GLOBAL_DATUM_INIT(crew_repository, /datum/repository/crew, new())
cache_data = list()
..()
/datum/repository/crew/proc/health_data(z)
/datum/repository/crew/proc/health_data(z, ignore_sensors = FALSE)
var/list/crewmembers = list()
if(!z)
return crewmembers
@@ -31,7 +31,7 @@ GLOBAL_DATUM_INIT(crew_repository, /datum/repository/crew, new())
for(var/thing in GLOB.human_list)
var/mob/living/carbon/human/H = thing
var/obj/item/clothing/under/C = H.w_uniform
if(!C || C.sensor_mode == SUIT_SENSOR_OFF || !C.has_sensor)
if(!ignore_sensors && (!C || C.sensor_mode == SUIT_SENSOR_OFF || !C.has_sensor))
continue
var/turf/pos = get_turf(C)
if(!istype(pos) || pos.z != z)
@@ -39,15 +39,16 @@ GLOBAL_DATUM_INIT(crew_repository, /datum/repository/crew, new())
var/list/crewmemberData = list("dead"=0, "oxy"=-1, "tox"=-1, "fire"=-1, "brute"=-1, "area"="", "x"=-1, "y"=-1, "ref" = "\ref[H]")
crewmemberData["sensor_type"] = C.sensor_mode
crewmemberData["name"] = H.get_authentification_name(if_no_id="Unknown")
// ignoring sensors means we also get their true name
crewmemberData["name"] = ignore_sensors ? H.name : H.get_authentification_name(if_no_id="Unknown")
crewmemberData["rank"] = H.get_authentification_rank(if_no_id="Unknown", if_no_job="No Job")
crewmemberData["assignment"] = H.get_assignment(if_no_id="Unknown", if_no_job="No Job")
crewmemberData["is_command"] = (crewmemberData["assignment"] in bold_jobs)
if(C.sensor_mode >= SUIT_SENSOR_BINARY)
if(C.sensor_mode >= SUIT_SENSOR_BINARY || ignore_sensors)
crewmemberData["dead"] = H.stat == DEAD
if(C.sensor_mode >= SUIT_SENSOR_VITAL)
if(C.sensor_mode >= SUIT_SENSOR_VITAL || ignore_sensors)
crewmemberData["stat"] = H.stat
crewmemberData["health"] = H.health
crewmemberData["oxy"] = round(H.getOxyLoss(), 1)
@@ -55,7 +56,7 @@ GLOBAL_DATUM_INIT(crew_repository, /datum/repository/crew, new())
crewmemberData["fire"] = round(H.getFireLoss(), 1)
crewmemberData["brute"] = round(H.getBruteLoss(), 1)
if(C.sensor_mode >= SUIT_SENSOR_TRACKING)
if(C.sensor_mode >= SUIT_SENSOR_TRACKING || ignore_sensors)
var/area/A = get_area(H)
crewmemberData["area"] = sanitize_simple(A.name)
crewmemberData["x"] = pos.x