diff --git a/code/_helpers/mobs.dm b/code/_helpers/mobs.dm index 9f4ece96f84..8a1df2059bd 100644 --- a/code/_helpers/mobs.dm +++ b/code/_helpers/mobs.dm @@ -119,27 +119,12 @@ proc/age2agedescription(age) if(70 to INFINITY) return "elderly" else return "unknown" -proc/RoundHealth(health) - switch(health) - if(100 to INFINITY) - return "health100" - if(70 to 100) - return "health80" - if(50 to 70) - return "health60" - if(30 to 50) - return "health40" - if(18 to 30) - return "health25" - if(5 to 18) - return "health10" - if(1 to 5) - return "health1" - if(-99 to 0) - return "health0" - else - return "health-100" - return "0" +/proc/RoundHealth(health) + var/list/icon_states = icon_states('icons/mob/hud_med.dmi') + for(var/icon_state in icon_states) + if(health >= text2num(icon_state)) + return icon_state + return icon_states[icon_states.len] // If we had no match, return the last element /* Proc for attack log creation, because really why not diff --git a/code/game/mecha/medical/odysseus.dm b/code/game/mecha/medical/odysseus.dm index 65ed711f2fd..967c03252f3 100644 --- a/code/game/mecha/medical/odysseus.dm +++ b/code/game/mecha/medical/odysseus.dm @@ -91,15 +91,15 @@ break holder = patient.hud_list[HEALTH_HUD] - if(patient.stat == 2) + if(patient.stat == DEAD) holder.icon_state = "hudhealth-100" C.images += holder else - holder.icon_state = "hud[RoundHealth((patient.health-config.health_threshold_crit)/(patient.maxHealth-config.health_threshold_crit)*100)]" + holder.icon_state = RoundHealth((patient.health-config.health_threshold_crit)/(patient.maxHealth-config.health_threshold_crit)*100) C.images += holder holder = patient.hud_list[STATUS_HUD] - if(patient.stat == 2) + if(patient.stat == DEAD) holder.icon_state = "huddead" else if(foundVirus) holder.icon_state = "hudill" diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index e884dbcd5d1..d3c0a5ba604 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -27,7 +27,7 @@ if(mind) mind.name = real_name - hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudhealth100") + hud_list[HEALTH_HUD] = image('icons/mob/hud_med.dmi', src, "100") 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") diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 697ae06cf3d..7a29b140b25 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1495,10 +1495,9 @@ if (BITTEST(hud_updateflag, HEALTH_HUD)) var/image/holder = hud_list[HEALTH_HUD] if(stat == DEAD) - holder.icon_state = "hudhealth-100" // X_X + holder.icon_state = "-100" // X_X else - var/percentage_health = RoundHealth((health-config.health_threshold_crit)/(maxHealth-config.health_threshold_crit)*100) - holder.icon_state = "hud[percentage_health]" + holder.icon_state = RoundHealth((health-config.health_threshold_crit)/(maxHealth-config.health_threshold_crit)*100) hud_list[HEALTH_HUD] = holder if (BITTEST(hud_updateflag, LIFE_HUD)) diff --git a/html/changelogs/PsiOmegaDelta-MedHUD.yml b/html/changelogs/PsiOmegaDelta-MedHUD.yml new file mode 100644 index 00000000000..031abd3084c --- /dev/null +++ b/html/changelogs/PsiOmegaDelta-MedHUD.yml @@ -0,0 +1,4 @@ +author: PsiOmegaDelta +delete-after: True +changes: + - rscadd: "MedHUD overlays now have more stages, both for 'normal' and critical stages of injury, for improved quick-diagnosis." diff --git a/icons/mob/hud.dmi b/icons/mob/hud.dmi index 1d4385103bf..b6d4ba748dc 100644 Binary files a/icons/mob/hud.dmi and b/icons/mob/hud.dmi differ diff --git a/icons/mob/hud_med.dmi b/icons/mob/hud_med.dmi new file mode 100644 index 00000000000..752829fba26 Binary files /dev/null and b/icons/mob/hud_med.dmi differ