From 235deac64a7a7959f5a32fb20a698a53171e7be2 Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Sun, 4 Feb 2018 20:17:09 -0500 Subject: [PATCH 1/3] medhud fixes --- code/game/gamemodes/miniantags/borer/borer.dm | 1 + code/game/gamemodes/miniantags/revenant/revenant.dm | 2 ++ code/game/gamemodes/miniantags/slaughter/slaughter.dm | 1 + .../modules/mob/living/simple_animal/simple_animal.dm | 11 +---------- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/code/game/gamemodes/miniantags/borer/borer.dm b/code/game/gamemodes/miniantags/borer/borer.dm index 54bdaf1b9cf..ba7f91e2c37 100644 --- a/code/game/gamemodes/miniantags/borer/borer.dm +++ b/code/game/gamemodes/miniantags/borer/borer.dm @@ -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 = "(Click to enter)", source = src, action = NOTIFY_ATTACK) diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm index 338484a5ebc..caec78f3594 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant.dm @@ -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) diff --git a/code/game/gamemodes/miniantags/slaughter/slaughter.dm b/code/game/gamemodes/miniantags/slaughter/slaughter.dm index 25ebd7bc379..416610dd1c2 100644 --- a/code/game/gamemodes/miniantags/slaughter/slaughter.dm +++ b/code/game/gamemodes/miniantags/slaughter/slaughter.dm @@ -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() diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 9d9f0ed0c11..7ec69fc9b0d 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -110,16 +110,7 @@ /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" + RoundHealth(health / maxHealth * 30) /mob/living/simple_animal/proc/process_ai() handle_automated_movement() From ddfde7c6fd1bef0894ce5ab0315971c84aacadef Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Sun, 4 Feb 2018 21:01:21 -0500 Subject: [PATCH 2/3] urgh still not working --- code/modules/mob/living/simple_animal/simple_animal.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 7ec69fc9b0d..b2bcb69cd89 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -110,7 +110,7 @@ /mob/living/simple_animal/handle_hud_icons_health() ..() - RoundHealth(health / maxHealth * 30) + RoundHealth(health / maxHealth * 100) /mob/living/simple_animal/proc/process_ai() handle_automated_movement() From 2921d3503770cc864d7224c9affd17f43e424349 Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Sun, 4 Feb 2018 21:19:22 -0500 Subject: [PATCH 3/3] fixed it. --- code/game/data_huds.dm | 13 ++++++++++--- .../mob/living/simple_animal/simple_animal.dm | 3 --- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index b458b95d8dc..7b6ada9364b 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -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 diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index b2bcb69cd89..461b5193b69 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -108,9 +108,6 @@ health = Clamp(health, 0, maxHealth) med_hud_set_status() -/mob/living/simple_animal/handle_hud_icons_health() - ..() - RoundHealth(health / maxHealth * 100) /mob/living/simple_animal/proc/process_ai() handle_automated_movement()