diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 89b96aa24bf..cc77f20c337 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -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" diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 8d7dfac05ef..264eed39159 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -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)) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index ad5a53b27fa..3e0b89d2a53 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -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) diff --git a/html/changelogs/Nanako-PR-413.yml b/html/changelogs/Nanako-PR-413.yml new file mode 100644 index 00000000000..58fef228dda --- /dev/null +++ b/html/changelogs/Nanako-PR-413.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Nanako + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - 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" + diff --git a/icons/mob/hud.dmi b/icons/mob/hud.dmi index ec64d22c32c..186104dd864 100644 Binary files a/icons/mob/hud.dmi and b/icons/mob/hud.dmi differ