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 = "
[resulthealth]%
" + /mob/living/simple_animal/hostile/guardian/adjustHealth(amount) //The spirit is invincible, but passes on damage to the summoner . = ..() if(summoner) @@ -101,6 +113,7 @@ if(summoner.stat == UNCONSCIOUS) summoner << "Your body can't take the strain of sustaining [src] in this condition, it begins to fall apart!" summoner.adjustCloneLoss(amount*0.5) //dying hosts take 50% bonus damage as cloneloss + updatehudhealth() /mob/living/simple_animal/hostile/guardian/ex_act(severity, target) switch(severity) @@ -126,6 +139,7 @@ return if(loc == summoner) forceMove(get_turf(summoner)) + PoolOrNew(/obj/effect/overlay/temp/guardian/phase, get_turf(src)) cooldown = world.time + 30 /mob/living/simple_animal/hostile/guardian/proc/Recall() @@ -133,7 +147,7 @@ return PoolOrNew(/obj/effect/overlay/temp/guardian/phase/out, get_turf(src)) unbuckle_mob(force=1) - loc = summoner + forceMove(summoner) cooldown = world.time + 30 /mob/living/simple_animal/hostile/guardian/proc/Communicate() @@ -735,6 +749,12 @@ var/obj/screen/using + healthdisplay = new /obj/screen/guardian() + healthdisplay.name = "summoner health" + healthdisplay.screen_loc = ui_health + healthdisplay.mouse_opacity = 0 + adding += healthdisplay + using = new /obj/screen/guardian/Manifest() using.screen_loc = ui_rhand adding += using @@ -764,6 +784,7 @@ /obj/screen/guardian icon = 'icons/mob/guardian.dmi' + icon_state = "base" /obj/screen/guardian/Manifest icon_state = "manifest" diff --git a/icons/mob/guardian.dmi b/icons/mob/guardian.dmi index 2b9e0957b68..a84ccec28ad 100644 Binary files a/icons/mob/guardian.dmi and b/icons/mob/guardian.dmi differ