Medical HUD useability improvements (#413)

- bugfix: "Medical huds will now properly update as wounds heal
passively, or when bandaged"
- rscadd: "Added a new Medical HUD state between 70 and 100%, to better
recognise very small amounts of damage"
- rscadd: "Medical huds will no longer show the healthbar on crewmembers
who are at full health"
- rscadd: "Added a healthbar fadeout effect for when someone heals up to
100% while you're watching"
- tweak: "Medical huds now update more frequently"
This commit is contained in:
NanakoAC
2016-06-23 02:16:06 +03:00
committed by skull132
parent 8a4bf1d738
commit 6d0f8388a7
5 changed files with 62 additions and 4 deletions
+3 -1
View File
@@ -90,7 +90,9 @@ proc/RoundHealth(health)
switch(health)
if(100 to INFINITY)
return "health100"
if(70 to 100)
if(90 to 100)
return "health95"
if(70 to 90)
return "health80"
if(50 to 70)
return "health60"
+11 -2
View File
@@ -55,12 +55,13 @@
//TODO: seperate this out
// update the current life tick, can be used to e.g. only do something every 4 ticks
life_tick++
var/datum/gas_mixture/environment = loc.return_air()
in_stasis = istype(loc, /obj/structure/closet/body_bag/cryobag) && loc:opened == 0
if(in_stasis) loc:used++
if(life_tick%30==15)
if(life_tick%30==5)//Makes huds update every 10 seconds instead of every 30 seconds
hud_updateflag = 1022
voice = GetVoice()
@@ -1613,7 +1614,15 @@
holder.icon_state = "hudhealth-100" // X_X
else
var/percentage_health = RoundHealth((health-config.health_threshold_crit)/(maxHealth-config.health_threshold_crit)*100)
holder.icon_state = "hud[percentage_health]"
if (percentage_health == "health100" && holder.icon_state && holder.icon_state != "hudhealth100" && holder.icon_state != "hudhealth100a")
holder.icon_state = "hudhealth100a"
spawn(30)//just to prevent any issues with the animation, we'll set it to the normal state after 3 seconds
percentage_health = RoundHealth((health-config.health_threshold_crit)/(maxHealth-config.health_threshold_crit)*100)
if (percentage_health == "health100")
holder.icon_state = "hudhealth100"
else
holder.icon_state = "hud[percentage_health]"
hud_list[HEALTH_HUD] = holder
if (BITTEST(hud_updateflag, LIFE_HUD))
+7 -1
View File
@@ -559,7 +559,7 @@ Note that amputating the affected organ does in fact remove the infection from t
if((status & ORGAN_ROBOT) || (status & ORGAN_ADV_ROBOT)) //Robotic limbs don't heal or get worse.
return
var/updatehud
for(var/datum/wound/W in wounds)
// wounds can disappear after 10 minutes at the earliest
if(W.damage <= 0 && W.created + 10 * 10 * 60 <= world.time)
@@ -567,6 +567,9 @@ Note that amputating the affected organ does in fact remove the infection from t
continue
// let the GC handle the deletion of the wound
if (W.damage > 0)
updatehud = 1//If there are any wounds with damage to heal, then we'll update health huds
// Internal wounds get worse over time. Low temperatures (cryo) stop them.
if(W.internal && owner.bodytemperature >= 170)
var/bicardose = owner.reagents.get_reagent_amount("bicaridine")
@@ -604,6 +607,9 @@ Note that amputating the affected organ does in fact remove the infection from t
// sync the organ's damage with its wounds
src.update_damages()
if (updatehud)
owner.hud_updateflag = 1022
if (update_icon())
owner.UpdateDamageIcon(1)