diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm index 1e9a9173022..8b8a502d371 100644 --- a/code/_onclick/hud/_defines.dm +++ b/code/_onclick/hud/_defines.dm @@ -110,6 +110,7 @@ //living #define ui_living_pull "EAST-1:28,CENTER-2:15" #define ui_living_health "EAST-1:28,CENTER:15" +#define ui_living_healthdoll "EAST-1:28,CENTER-2:13" //borgs #define ui_borg_health "EAST-1:28,CENTER-1:15" //borgs have the health display where humans have the pressure damage indicator. diff --git a/code/_onclick/hud/living.dm b/code/_onclick/hud/living.dm index 7f9e1ffc493..557aec9555e 100644 --- a/code/_onclick/hud/living.dm +++ b/code/_onclick/hud/living.dm @@ -11,6 +11,7 @@ pull_icon.hud = src static_inventory += pull_icon - healths = new /obj/screen/healths/living() - healths.hud = src - infodisplay += healths + //mob health doll! assumes whatever sprite the mob is + healthdoll = new /obj/screen/healthdoll/living() + healthdoll.hud = src + infodisplay += healthdoll diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index b70d0ac3e96..d605995f489 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -59,7 +59,7 @@ var/mob/M = usr M.swap_hand() return 1 - + /obj/screen/skills name = "skills" icon = 'icons/mob/screen_midnight.dmi' @@ -406,7 +406,7 @@ var/mob/living/user = hud?.mymob if(!istype(user)) return - + if(!user.resting) icon_state = "act_rest" else @@ -549,7 +549,7 @@ if(choice != hud.mymob.zone_selected) hud.mymob.zone_selected = choice update_icon() - + return TRUE /obj/screen/zone_sel/update_overlays() @@ -588,10 +588,6 @@ icon_state = "health0" screen_loc = ui_health -/obj/screen/healths/living - screen_loc = ui_living_health - mouse_opacity = MOUSE_OPACITY_TRANSPARENT - /obj/screen/healths/alien icon = 'icons/mob/screen_alien.dmi' screen_loc = ui_alien_health @@ -641,7 +637,7 @@ icon_state = "slime_health0" screen_loc = ui_slime_health mouse_opacity = MOUSE_OPACITY_TRANSPARENT - + /obj/screen/healths/lavaland_elite icon = 'icons/mob/screen_elite.dmi' icon_state = "elite_health0" @@ -657,6 +653,11 @@ var/mob/living/carbon/human/H = usr H.check_self_for_injuries() +/obj/screen/healthdoll/living + icon_state = "fullhealth0" + screen_loc = ui_living_healthdoll + var/filtered = FALSE //so we don't repeatedly create the mask of the mob every update + /obj/screen/mood name = "mood" icon_state = "mood5" diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 8c85ddcb700..dc9eebf5699 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -496,34 +496,42 @@ update_health_hud() /mob/living/update_health_hud() - if(hud_used?.healths) - var/severity = 0 - var/healthpercent = (health/maxHealth) * 100 + var/severity = 0 + var/healthpercent = (health/maxHealth) * 100 + if(hud_used?.healthdoll) //to really put you in the boots of a simplemob + var/obj/screen/healthdoll/living/livingdoll = hud_used.healthdoll switch(healthpercent) if(100 to INFINITY) - hud_used.healths.icon_state = "health0" + livingdoll.icon_state = "living0" if(80 to 100) - hud_used.healths.icon_state = "health1" + livingdoll.icon_state = "living1" severity = 1 if(60 to 80) - hud_used.healths.icon_state = "health2" + livingdoll.icon_state = "living2" severity = 2 if(40 to 60) - hud_used.healths.icon_state = "health3" + livingdoll.icon_state = "living3" severity = 3 if(20 to 40) - hud_used.healths.icon_state = "health4" + livingdoll.icon_state = "living4" severity = 4 if(1 to 20) - hud_used.healths.icon_state = "health5" + livingdoll.icon_state = "living5" severity = 5 else - hud_used.healths.icon_state = "health7" + livingdoll.icon_state = "living6" severity = 6 - if(severity > 0) - overlay_fullscreen("brute", /obj/screen/fullscreen/brute, severity) - else - clear_fullscreen("brute") + if(!livingdoll.filtered) + livingdoll.filtered = TRUE + var/icon/mob_mask = icon(icon, icon_state) + if(mob_mask.Height() > world.icon_size || mob_mask.Width() > world.icon_size) + mob_mask = icon('icons/mob/screen_gen.dmi', "megasprite") //swap to something that fits if they wont + UNLINT(livingdoll.filters += filter(type="alpha", icon = mob_mask)) + livingdoll.filters += filter(type="drop_shadow", size = -1) + if(severity > 0) + overlay_fullscreen("brute", /obj/screen/fullscreen/brute, severity) + else + clear_fullscreen("brute") //Proc used to resuscitate a mob, for full_heal see fully_heal() /mob/living/proc/revive(full_heal = FALSE, admin_revive = FALSE) diff --git a/icons/mob/screen_gen.dmi b/icons/mob/screen_gen.dmi index bc1dba8ec86..798d9ad7730 100644 Binary files a/icons/mob/screen_gen.dmi and b/icons/mob/screen_gen.dmi differ