From 98be5cbce892e51eb2f154bc47ba3a13e42d5aa3 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Mon, 2 Mar 2015 12:59:46 +0100 Subject: [PATCH] Synth medical sensors now report dead/alive status. Synths with medical augmentation sensors enabled will now see the dead/alive status of crew members with suit sensors set to at least binary level. --- code/defines/procs/hud.dm | 11 +++++++---- code/modules/mob/living/carbon/human/death.dm | 1 + code/modules/mob/living/carbon/human/human.dm | 3 ++- code/modules/mob/living/carbon/human/life.dm | 7 +++++++ code/modules/mob/living/living.dm | 2 ++ code/modules/mob/living/silicon/ai/ai.dm | 1 + code/modules/mob/living/silicon/robot/robot.dm | 1 + code/modules/mob/living/silicon/silicon.dm | 2 +- code/modules/mob/mob_helpers.dm | 7 +++++++ code/setup.dm | 1 + 10 files changed, 30 insertions(+), 6 deletions(-) diff --git a/code/defines/procs/hud.dm b/code/defines/procs/hud.dm index be678b8397..e572176ef9 100644 --- a/code/defines/procs/hud.dm +++ b/code/defines/procs/hud.dm @@ -12,12 +12,15 @@ proc/process_med_hud(var/mob/M, var/local_scanner, var/mob/Alt) if(P.Mob.see_invisible < patient.invisibility) continue - if(!(local_scanner || hassensorlevel(patient, SUIT_SENSOR_VITAL))) - continue - - P.Client.images += patient.hud_list[HEALTH_HUD] if(local_scanner) + P.Client.images += patient.hud_list[HEALTH_HUD] P.Client.images += patient.hud_list[STATUS_HUD] + else + var/sensor_level = getsensorlevel(patient) + if(sensor_level >= SUIT_SENSOR_VITAL) + P.Client.images += patient.hud_list[HEALTH_HUD] + if(sensor_level >= SUIT_SENSOR_BINARY) + P.Client.images += patient.hud_list[LIFE_HUD] //Security HUDs. Pass a value for the second argument to enable implant viewing or other special features. proc/process_sec_hud(var/mob/M, var/advanced_mode, var/mob/Alt) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 9571a789a8..41140f2d3c 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -30,6 +30,7 @@ BITSET(hud_updateflag, HEALTH_HUD) BITSET(hud_updateflag, STATUS_HUD) + BITSET(hud_updateflag, LIFE_HUD) handle_hud_list() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 5c047cd9dd..b95fbaf15c 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -5,7 +5,7 @@ icon = 'icons/mob/human.dmi' icon_state = "body_m_s" - var/list/hud_list[9] + var/list/hud_list[10] var/embedded_flag //To check if we've need to roll for damage on movement while an item is imbedded in us. /mob/living/carbon/human/New(var/new_loc, var/new_species = null) @@ -26,6 +26,7 @@ hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudhealth100") hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudhealthy") + hud_list[LIFE_HUD] = image('icons/mob/hud.dmi', src, "hudhealthy") hud_list[ID_HUD] = image('icons/mob/hud.dmi', src, "hudunknown") hud_list[WANTED_HUD] = image('icons/mob/hud.dmi', src, "hudblank") hud_list[IMPLOYAL_HUD] = image('icons/mob/hud.dmi', src, "hudblank") diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 21657fce41..bf53542aec 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1576,6 +1576,13 @@ var/percentage_health = RoundHealth((health-config.health_threshold_crit)/(maxHealth-config.health_threshold_crit)*100) holder.icon_state = "hud[percentage_health]" hud_list[HEALTH_HUD] = holder + + if (BITTEST(hud_updateflag, LIFE_HUD)) + var/image/holder = hud_list[STATUS_HUD] + if(stat == DEAD) + holder.icon_state = "huddead" + else + holder.icon_state = "hudhealthy" if (BITTEST(hud_updateflag, STATUS_HUD)) var/foundVirus = 0 diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 8995183db9..419532d4b2 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -280,6 +280,7 @@ C.legcuffed = initial(C.legcuffed) BITSET(hud_updateflag, HEALTH_HUD) BITSET(hud_updateflag, STATUS_HUD) + BITSET(hud_updateflag, LIFE_HUD) ExtinguishMob() fire_stacks = 0 @@ -332,6 +333,7 @@ BITSET(hud_updateflag, HEALTH_HUD) BITSET(hud_updateflag, STATUS_HUD) + BITSET(hud_updateflag, LIFE_HUD) return /mob/living/proc/UpdateDamageIcon() diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index a0781d7073..3dca3c7a00 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -157,6 +157,7 @@ var/list/ai_verbs_default = list( hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudblank") hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudblank") + hud_list[LIFE_HUD] = image('icons/mob/hud.dmi', src, "hudblank") hud_list[ID_HUD] = image('icons/mob/hud.dmi', src, "hudblank") hud_list[WANTED_HUD] = image('icons/mob/hud.dmi', src, "hudblank") hud_list[IMPLOYAL_HUD] = image('icons/mob/hud.dmi', src, "hudblank") diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 3539e683af..9d438df08d 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -153,6 +153,7 @@ var/list/robot_verbs_default = list( hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudblank") hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudhealth100") + hud_list[LIFE_HUD] = image('icons/mob/hud.dmi', src, "hudhealth100") hud_list[ID_HUD] = image('icons/mob/hud.dmi', src, "hudblank") hud_list[WANTED_HUD] = image('icons/mob/hud.dmi', src, "hudblank") hud_list[IMPLOYAL_HUD] = image('icons/mob/hud.dmi', src, "hudblank") diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 466e984350..f6cc24de05 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -11,7 +11,7 @@ var/ioncheck[1] var/obj/item/device/radio/common_radio - var/list/hud_list[9] + var/list/hud_list[10] var/list/speech_synthesizer_langs = list() //which languages can be vocalized by the speech synthesizer //Used in say.dm. diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index e8339965c9..18aefb2dc7 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -149,6 +149,13 @@ proc/hassensorlevel(A, var/level) var/obj/item/clothing/under/U = H.w_uniform return U.sensor_mode >= level return 0 + +proc/getsensorlevel(A) + var/mob/living/carbon/human/H = A + if(istype(H) && istype(H.w_uniform, /obj/item/clothing/under)) + var/obj/item/clothing/under/U = H.w_uniform + return U.sensor_mode + return SUIT_SENSOR_OFF /proc/hsl2rgb(h, s, l) return //TODO: Implement diff --git a/code/setup.dm b/code/setup.dm index 17888978ee..045f6b2df0 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -593,6 +593,7 @@ var/list/be_special_flags = list( #define IMPTRACK_HUD 7 // Tracking implant. #define SPECIALROLE_HUD 8 // AntagHUD image. #define STATUS_HUD_OOC 9 // STATUS_HUD without virus DB check for someone being ill. +#define LIFE_HUD 10 // STATUS_HUD that only reports dead or alive // Pulse levels, very simplified. #define PULSE_NONE 0 // So !M.pulse checks would be possible.