mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-20 19:43:13 +01:00
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:
@@ -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"
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user