diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index 0b9aeec9fb2..4f393ef1f21 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -86,6 +86,8 @@ return TRUE if(undergoing_cardiac_arrest()) return TRUE + if(ismachineperson(src) && health < 0) + return TRUE return FALSE /// Whether a virus worthy displaying on the HUD is present. @@ -167,9 +169,10 @@ //called when a living mob changes health /mob/living/proc/med_hud_set_health() var/image/holder = hud_list[HEALTH_HUD] + if(ismachineperson(src)) + holder = hud_list[DIAG_HUD] holder.icon_state = "hud[RoundHealth(src)]" - //called when a carbon changes stat, virus or XENO_HOST /mob/living/proc/med_hud_set_status() var/image/holder = hud_list[STATUS_HUD] @@ -181,12 +184,16 @@ //called when a carbon changes stat, virus or XENO_HOST /mob/living/carbon/med_hud_set_status() var/image/holder = hud_list[STATUS_HUD] + if(ismachineperson(src)) + holder = hud_list[DIAG_STAT_HUD] var/mob/living/simple_animal/borer/B = has_brain_worms() // To the right of health bar if(stat == DEAD || HAS_TRAIT(src, TRAIT_FAKEDEATH)) var/revivable if(!ghost_can_reenter()) // DNR or AntagHUD revivable = FALSE + else if(ismachineperson(src)) + revivable = TRUE else if(timeofdeath && (round(world.time - timeofdeath) < DEFIB_TIME_LIMIT)) revivable = TRUE diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 6134cd93555..f70deb5ab42 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -1,6 +1,10 @@ /mob/living/carbon/human - hud_possible = list(HEALTH_HUD,STATUS_HUD,ID_HUD,WANTED_HUD,IMPMINDSHIELD_HUD,IMPCHEM_HUD,IMPTRACK_HUD,SPECIALROLE_HUD,GLAND_HUD) + hud_possible = list( + HEALTH_HUD, STATUS_HUD, SPECIALROLE_HUD, // from /mob/living + ID_HUD, WANTED_HUD, IMPMINDSHIELD_HUD, IMPCHEM_HUD, IMPTRACK_HUD, GLAND_HUD, + DIAG_STAT_HUD, DIAG_HUD // for IPCs + ) pressure_resistance = 25 mob_biotypes = MOB_ORGANIC | MOB_HUMANOID blocks_emissive = EMISSIVE_BLOCK_UNIQUE diff --git a/code/modules/mob/living/carbon/human/species/machine.dm b/code/modules/mob/living/carbon/human/species/machine.dm index 171d8c033f1..f26d8a5aef1 100644 --- a/code/modules/mob/living/carbon/human/species/machine.dm +++ b/code/modules/mob/living/carbon/human/species/machine.dm @@ -83,11 +83,23 @@ ..() monitor = new() monitor.Grant(H) + for(var/datum/atom_hud/data/human/medical/medhud in GLOB.huds) + medhud.remove_from_hud(H) + for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds) + diag_hud.add_to_hud(H) + H.med_hud_set_health() + H.med_hud_set_status() /datum/species/machine/on_species_loss(mob/living/carbon/human/H) ..() if(monitor) monitor.Remove(H) + for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds) + diag_hud.remove_from_hud(H) + for(var/datum/atom_hud/data/human/medical/medhud in GLOB.huds) + medhud.add_to_hud(H) + H.med_hud_set_health() + H.med_hud_set_status() /datum/species/machine/handle_death(gibbed, mob/living/carbon/human/H) var/obj/item/organ/external/head/head_organ = H.get_organ("head") diff --git a/code/modules/mob/living/carbon/update_status.dm b/code/modules/mob/living/carbon/update_status.dm index 4f211d7b66c..28e3646f178 100644 --- a/code/modules/mob/living/carbon/update_status.dm +++ b/code/modules/mob/living/carbon/update_status.dm @@ -16,6 +16,7 @@ create_debug_log("woke up, trigger reason: [reason]") update_damage_hud() update_health_hud() + med_hud_set_health() med_hud_set_status() /mob/living/carbon/update_stamina()