Merge pull request #11776 from Arkatos1/SlimeHUD

SlimeHUD
This commit is contained in:
variableundefined
2019-08-15 10:37:12 +08:00
committed by GitHub
7 changed files with 106 additions and 3 deletions
@@ -146,6 +146,44 @@
stat(null,"Power Level: [powerlevel]")
/mob/living/carbon/slime/updatehealth(reason)
. = ..()
update_health_hud()
/mob/living/carbon/slime/proc/update_health_hud()
if(hud_used)
var/severity = 0
var/healthpercent = (health/maxHealth) * 100
if(stat != DEAD)
switch(healthpercent)
if(100 to INFINITY)
healths.icon_state = "slime_health0"
if(80 to 100)
healths.icon_state = "slime_health1"
severity = 1
if(60 to 80)
healths.icon_state = "slime_health2"
severity = 2
if(40 to 60)
healths.icon_state = "slime_health3"
severity = 3
if(20 to 40)
healths.icon_state = "slime_health4"
severity = 4
if(0 to 20)
healths.icon_state = "slime_health5"
severity = 5
if(-199 to 0)
healths.icon_state = "slime_health6"
severity = 6
else
healths.icon_state = "slime_health7"
severity = 6
if(severity > 0)
overlay_fullscreen("brute", /obj/screen/fullscreen/brute, severity)
else
clear_fullscreen("brute")
/mob/living/carbon/slime/adjustFireLoss(amount)
..(-abs(amount)) // Heals them
return
@@ -12,8 +12,8 @@
response_disarm = "shoos"
response_harm = "stomps on"
emote_see = list("jiggles", "bounces in place")
var/colour = "grey"
pass_flags = PASSTABLE
var/colour = "grey"
/mob/living/simple_animal/slime/adult
health = 200
@@ -24,3 +24,37 @@
/mob/living/simple_animal/slime/New()
..()
overlays += "aslime-:33"
/mob/living/simple_animal/slime/updatehealth(reason)
. = ..()
update_health_hud()
/mob/living/simple_animal/slime/proc/update_health_hud()
if(hud_used)
var/severity = 0
var/healthpercent = (health/maxHealth) * 100
switch(healthpercent)
if(100 to INFINITY)
healths.icon_state = "slime_health0"
if(80 to 100)
healths.icon_state = "slime_health1"
severity = 1
if(60 to 80)
healths.icon_state = "slime_health2"
severity = 2
if(40 to 60)
healths.icon_state = "slime_health3"
severity = 3
if(20 to 40)
healths.icon_state = "slime_health4"
severity = 4
if(1 to 20)
healths.icon_state = "slime_health5"
severity = 5
else
healths.icon_state = "slime_health7"
severity = 6
if(severity > 0)
overlay_fullscreen("brute", /obj/screen/fullscreen/brute, severity)
else
clear_fullscreen("brute")