mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 13:38:41 +01:00
513 health bars for simplemobs! (#48954)
* cleanup required * removes bad stuff, makes linter happy * megafauna still get SOME health doll, cleanup again * whoop * UNLINT
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user