diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index c1bb029840f..952cfd803fb 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -101,6 +101,8 @@ var/datum/global_hud/global_hud = new() var/obj/screen/blobpwrdisplay var/obj/screen/blobhealthdisplay + var/obj/screen/guardian/healthdisplay + var/obj/screen/alien_plasma_display var/obj/screen/deity_health_display diff --git a/code/modules/mob/living/simple_animal/guardian/guardian.dm b/code/modules/mob/living/simple_animal/guardian/guardian.dm index 7dcc3c46060..485d853d11e 100644 --- a/code/modules/mob/living/simple_animal/guardian/guardian.dm +++ b/code/modules/mob/living/simple_animal/guardian/guardian.dm @@ -37,6 +37,7 @@ /mob/living/simple_animal/hostile/guardian/Life() //Dies if the summoner dies ..() + updatehudhealth() if(summoner) if(summoner.stat == DEAD) src << "Your summoner has died!" @@ -61,17 +62,19 @@ visible_message("The [src] jumps back to its user.") PoolOrNew(/obj/effect/overlay/temp/guardian/phase/out, get_turf(src)) forceMove(get_turf(summoner)) + PoolOrNew(/obj/effect/overlay/temp/guardian/phase, get_turf(src)) /mob/living/simple_animal/hostile/guardian/Move() //Returns to summoner if they move out of range ..() if(summoner) - if (get_dist(get_turf(summoner),get_turf(src)) <= range) + if(get_dist(get_turf(summoner),get_turf(src)) <= range) return else src << "You moved out of range, and were pulled back! You can only move [range] meters from [summoner.real_name]" visible_message("The [src] jumps back to its user.") PoolOrNew(/obj/effect/overlay/temp/guardian/phase/out, get_turf(src)) forceMove(get_turf(summoner)) + PoolOrNew(/obj/effect/overlay/temp/guardian/phase, get_turf(src)) /mob/living/simple_animal/hostile/guardian/canSuicide() return 0 @@ -89,6 +92,15 @@ summoner << "Your [name] died somehow!" summoner.death() +/mob/living/simple_animal/hostile/guardian/proc/updatehudhealth() + if(summoner) + var/resulthealth + if(iscarbon(summoner)) + resulthealth = round((summoner.health / abs(config.health_threshold_dead - summoner.maxHealth)) * 100) + else + resulthealth = round((summoner.health / summoner.maxHealth) * 100) + hud_used.healthdisplay.maptext = "