mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 13:38:41 +01:00
# Conflicts: # _maps/RandomRuins/SpaceRuins/derelict_sulaco.dmm # _maps/RandomRuins/SpaceRuins/garbagetruck2.dmm # _maps/map_files/CatwalkStation/CatwalkStation_2023.dmm # _maps/map_files/tramstation/tramstation.dmm # code/_onclick/hud/new_player.dm # code/datums/components/squashable.dm # code/datums/diseases/advance/symptoms/heal.dm # code/datums/diseases/chronic_illness.dm # code/datums/status_effects/buffs.dm # code/datums/status_effects/debuffs/drunk.dm # code/datums/status_effects/debuffs/stamcrit.dm # code/game/machinery/computer/crew.dm # code/game/objects/items/devices/scanners/health_analyzer.dm # code/game/objects/items/wall_mounted.dm # code/game/turfs/closed/indestructible.dm # code/modules/admin/view_variables/filterrific.dm # code/modules/antagonists/heretic/influences.dm # code/modules/cargo/orderconsole.dm # code/modules/client/preferences.dm # code/modules/events/space_vines/vine_mutations.dm # code/modules/mob/dead/new_player/new_player.dm # code/modules/mob/living/carbon/human/death.dm # code/modules/mob/living/carbon/human/species_types/jellypeople.dm # code/modules/mob/living/damage_procs.dm # code/modules/mob/living/living.dm # code/modules/mob_spawn/ghost_roles/mining_roles.dm # code/modules/mob_spawn/mob_spawn.dm # code/modules/projectiles/ammunition/energy/laser.dm # code/modules/projectiles/guns/ballistic/launchers.dm # code/modules/projectiles/guns/energy/laser.dm # code/modules/reagents/chemistry/machinery/chem_dispenser.dm # code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm # code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm # code/modules/reagents/chemistry/reagents/medicine_reagents.dm # code/modules/surgery/healing.dm # code/modules/unit_tests/designs.dm # icons/mob/inhands/items_lefthand.dmi # icons/mob/inhands/items_righthand.dmi # tgui/packages/tgui/interfaces/ChemDispenser.tsx
130 lines
4.0 KiB
Plaintext
130 lines
4.0 KiB
Plaintext
/*
|
|
* Trimmed and modified copy of ".../machinery/computer/crew.dm"
|
|
* for the sake of modularity. (Blueshield Monitor Console soon?)
|
|
*/
|
|
GLOBAL_DATUM_INIT(blueshield_crewmonitor, /datum/crewmonitor/blueshield, new)
|
|
|
|
//list of all Command/CC jobs
|
|
/datum/crewmonitor/blueshield
|
|
var/list/jobs_command = list(
|
|
JOB_CAPTAIN = 00,
|
|
JOB_HEAD_OF_SECURITY = 10,
|
|
JOB_CHIEF_MEDICAL_OFFICER = 20,
|
|
JOB_RESEARCH_DIRECTOR = 30,
|
|
JOB_CHIEF_ENGINEER = 40,
|
|
JOB_QUARTERMASTER = 50,
|
|
JOB_HEAD_OF_PERSONNEL = 60,
|
|
JOB_CENTCOM_ADMIRAL = 200,
|
|
JOB_CENTCOM = 201,
|
|
JOB_CENTCOM_OFFICIAL = 210,
|
|
JOB_CENTCOM_COMMANDER = 211,
|
|
JOB_CENTCOM_BARTENDER = 212,
|
|
JOB_CENTCOM_CUSTODIAN = 213,
|
|
JOB_CENTCOM_MEDICAL_DOCTOR = 214,
|
|
JOB_CENTCOM_RESEARCH_OFFICER = 215,
|
|
JOB_ERT_COMMANDER = 220,
|
|
JOB_ERT_OFFICER = 221,
|
|
JOB_ERT_ENGINEER = 222,
|
|
JOB_ERT_MEDICAL_DOCTOR = 223,
|
|
JOB_ERT_CLOWN = 224,
|
|
JOB_ERT_CHAPLAIN = 225,
|
|
JOB_ERT_JANITOR = 226,
|
|
JOB_ERT_DEATHSQUAD = 227,
|
|
JOB_NT_REP = 230,
|
|
JOB_BLUESHIELD = 231,
|
|
JOB_BRIDGE_ASSISTANT = 232,
|
|
)
|
|
|
|
/datum/crewmonitor/blueshield/ui_interact(mob/user, datum/tgui/ui)
|
|
ui = SStgui.try_update_ui(user, src, ui)
|
|
if (!ui)
|
|
ui = new(user, src, "CrewConsoleSkyratBlueshield")
|
|
ui.open()
|
|
|
|
/*
|
|
* Override of crewmonitor/update_data(z)
|
|
* - "trim_assignment" is now iterated for command-only jobs
|
|
* - "if (id_card)" now encapsulates all the remaining checks to avoid showing unknowns
|
|
*/
|
|
/datum/crewmonitor/blueshield/update_data(z)
|
|
if(data_by_z["[z]"] && last_update["[z]"] && world.time <= last_update["[z]"] + SENSORS_UPDATE_PERIOD)
|
|
return data_by_z["[z]"]
|
|
|
|
var/list/results = list()
|
|
for(var/tracked_mob in GLOB.suit_sensors_list)
|
|
if(!tracked_mob)
|
|
stack_trace("Null entry in suit sensors list.")
|
|
continue
|
|
|
|
var/mob/living/tracked_living_mob = tracked_mob
|
|
|
|
var/turf/pos = get_turf(tracked_living_mob)
|
|
|
|
if(!pos)
|
|
stack_trace("Tracked mob has no loc and is likely in nullspace: [tracked_living_mob] ([tracked_living_mob.type])")
|
|
continue
|
|
|
|
if(pos.z != z && (!is_station_level(pos.z) || !is_station_level(z)) && !HAS_TRAIT(tracked_living_mob, TRAIT_MULTIZ_SUIT_SENSORS))
|
|
continue
|
|
|
|
var/mob/living/carbon/human/tracked_human = tracked_living_mob
|
|
|
|
if(!ishuman(tracked_human))
|
|
stack_trace("Non-human mob is in suit_sensors_list: [tracked_living_mob] ([tracked_living_mob.type])")
|
|
continue
|
|
|
|
var/obj/item/clothing/under/uniform = tracked_human.w_uniform
|
|
if (!istype(uniform))
|
|
stack_trace("Human without a suit sensors compatible uniform is in suit_sensors_list: [tracked_human] ([tracked_human.type]) ([uniform?.type])")
|
|
continue
|
|
|
|
if((uniform.has_sensor <= NO_SENSORS) || !uniform.sensor_mode)
|
|
stack_trace("Human without active suit sensors is in suit_sensors_list: [tracked_human] ([tracked_human.type]) ([uniform.type])")
|
|
continue
|
|
|
|
var/sensor_mode = uniform.sensor_mode
|
|
var/list/entry = list()
|
|
|
|
var/obj/item/card/id/id_card = tracked_living_mob.get_idcard(hand_first = FALSE)
|
|
if (id_card)
|
|
|
|
entry["name"] = id_card.registered_name
|
|
entry["assignment"] = id_card.assignment
|
|
var/trim_assignment = id_card.get_trim_assignment()
|
|
|
|
//Check if they are command
|
|
if (jobs_command[trim_assignment] != null)
|
|
entry["ijob"] = jobs_command[trim_assignment]
|
|
else
|
|
continue
|
|
|
|
if (issynthetic(tracked_human))
|
|
entry["is_robot"] = TRUE
|
|
|
|
if (sensor_mode >= SENSOR_LIVING)
|
|
entry["life_status"] = (tracked_living_mob.stat != DEAD)
|
|
|
|
if (sensor_mode >= SENSOR_VITALS)
|
|
entry += list(
|
|
"oxydam" = round(tracked_living_mob.get_oxy_loss(), 1),
|
|
"toxdam" = round(tracked_living_mob.get_tox_loss(), 1),
|
|
"burndam" = round(tracked_living_mob.get_fire_loss(), 1),
|
|
"brutedam" = round(tracked_living_mob.get_brute_loss(), 1),
|
|
"health" = round(tracked_living_mob.health, 1),
|
|
)
|
|
|
|
if (sensor_mode >= SENSOR_COORDS)
|
|
entry["area"] = get_area_name(tracked_living_mob, format_text = TRUE)
|
|
|
|
entry["can_track"] = tracked_living_mob.can_track()
|
|
|
|
else
|
|
continue
|
|
|
|
results[++results.len] = entry
|
|
|
|
data_by_z["[z]"] = results
|
|
last_update["[z]"] = world.time
|
|
|
|
return results
|