Merge pull request #8648 from Aurorablade/FUCKAGAIN

medhud fixes
This commit is contained in:
tigercat2000
2018-02-05 17:37:06 -08:00
committed by GitHub
5 changed files with 14 additions and 15 deletions
+10 -3
View File
@@ -76,8 +76,15 @@
return 0
//helper for getting the appropriate health status UPDATED BY PUCKABOO2 TO INCLUDE NEGATIVES.
/proc/RoundHealth(health)
switch(health)
/proc/RoundHealth(mob/living/M)
if(M.stat == DEAD || (M.status_flags & FAKEDEATH))
return "health-100" //what's our health? it doesn't matter, we're dead, or faking
var/maxi_health = M.maxHealth
if(iscarbon(M) && M.health < 0)
maxi_health = 100 //so crit shows up right for aliens and other high-health carbon mobs; noncarbons don't have crit.
var/resulthealth = (M.health / maxi_health) * 100
switch(resulthealth)
if(100 to INFINITY)
return "health100"
if(95 to 100)
@@ -138,7 +145,7 @@
//called when a living mob changes health
/mob/living/proc/med_hud_set_health()
var/image/holder = hud_list[HEALTH_HUD]
holder.icon_state = "hud[RoundHealth(health)]"
holder.icon_state = "hud[RoundHealth(src)]"
//called when a carbon changes stat, virus or XENO_HOST
@@ -115,6 +115,7 @@
/mob/living/simple_animal/borer/New(atom/newloc, var/gen=1)
..(newloc)
remove_from_all_data_huds()
generation = gen
add_language("Cortical Link")
notify_ghosts("A cortical borer has been created in [get_area(src)]!", enter_link = "<a href=?src=[UID()];ghostjoin=1>(Click to enter)</a>", source = src, action = NOTIFY_ATTACK)
@@ -53,6 +53,7 @@
var/perfectsouls = 0 //How many perfect, regen-cap increasing souls the revenant has.
var/image/ghostimage = null //Visible to ghost with darkness off
/mob/living/simple_animal/revenant/Life()
..()
if(revealed && essence <= 0)
@@ -117,6 +118,7 @@
ghostimage = image(src.icon,src,src.icon_state)
ghost_darkness_images |= ghostimage
updateallghostimages()
remove_from_all_data_huds()
spawn(5)
if(src.mind)
@@ -57,6 +57,7 @@
/mob/living/simple_animal/slaughter/New()
..()
remove_from_all_data_huds()
var/obj/effect/proc_holder/spell/bloodcrawl/bloodspell = new
AddSpell(bloodspell)
whisper_action = new()
@@ -108,18 +108,6 @@
health = Clamp(health, 0, maxHealth)
med_hud_set_status()
/mob/living/simple_animal/handle_hud_icons_health()
..()
if(healths && maxHealth > 0)
switch(health / maxHealth * 30)
if(30 to INFINITY) healths.icon_state = "health0"
if(26 to 29) healths.icon_state = "health1"
if(21 to 25) healths.icon_state = "health2"
if(16 to 20) healths.icon_state = "health3"
if(11 to 15) healths.icon_state = "health4"
if(6 to 10) healths.icon_state = "health5"
if(1 to 5) healths.icon_state = "health6"
if(0) healths.icon_state = "health7"
/mob/living/simple_animal/proc/process_ai()
handle_automated_movement()