mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 18:22:14 +00:00
Holoparasites have a health hud display for the summoner's health, as a percentage.
Adds glows when holoparasites force-recall to their summoner
This commit is contained in:
@@ -101,6 +101,8 @@ var/datum/global_hud/global_hud = new()
|
|||||||
var/obj/screen/blobpwrdisplay
|
var/obj/screen/blobpwrdisplay
|
||||||
var/obj/screen/blobhealthdisplay
|
var/obj/screen/blobhealthdisplay
|
||||||
|
|
||||||
|
var/obj/screen/guardian/healthdisplay
|
||||||
|
|
||||||
var/obj/screen/alien_plasma_display
|
var/obj/screen/alien_plasma_display
|
||||||
|
|
||||||
var/obj/screen/deity_health_display
|
var/obj/screen/deity_health_display
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
/mob/living/simple_animal/hostile/guardian/Life() //Dies if the summoner dies
|
/mob/living/simple_animal/hostile/guardian/Life() //Dies if the summoner dies
|
||||||
..()
|
..()
|
||||||
|
updatehudhealth()
|
||||||
if(summoner)
|
if(summoner)
|
||||||
if(summoner.stat == DEAD)
|
if(summoner.stat == DEAD)
|
||||||
src << "<span class='danger'>Your summoner has died!</span>"
|
src << "<span class='danger'>Your summoner has died!</span>"
|
||||||
@@ -61,17 +62,19 @@
|
|||||||
visible_message("<span class='danger'>The [src] jumps back to its user.</span>")
|
visible_message("<span class='danger'>The [src] jumps back to its user.</span>")
|
||||||
PoolOrNew(/obj/effect/overlay/temp/guardian/phase/out, get_turf(src))
|
PoolOrNew(/obj/effect/overlay/temp/guardian/phase/out, get_turf(src))
|
||||||
forceMove(get_turf(summoner))
|
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
|
/mob/living/simple_animal/hostile/guardian/Move() //Returns to summoner if they move out of range
|
||||||
..()
|
..()
|
||||||
if(summoner)
|
if(summoner)
|
||||||
if (get_dist(get_turf(summoner),get_turf(src)) <= range)
|
if(get_dist(get_turf(summoner),get_turf(src)) <= range)
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
src << "You moved out of range, and were pulled back! You can only move [range] meters from [summoner.real_name]"
|
src << "You moved out of range, and were pulled back! You can only move [range] meters from [summoner.real_name]"
|
||||||
visible_message("<span class='danger'>The [src] jumps back to its user.</span>")
|
visible_message("<span class='danger'>The [src] jumps back to its user.</span>")
|
||||||
PoolOrNew(/obj/effect/overlay/temp/guardian/phase/out, get_turf(src))
|
PoolOrNew(/obj/effect/overlay/temp/guardian/phase/out, get_turf(src))
|
||||||
forceMove(get_turf(summoner))
|
forceMove(get_turf(summoner))
|
||||||
|
PoolOrNew(/obj/effect/overlay/temp/guardian/phase, get_turf(src))
|
||||||
|
|
||||||
/mob/living/simple_animal/hostile/guardian/canSuicide()
|
/mob/living/simple_animal/hostile/guardian/canSuicide()
|
||||||
return 0
|
return 0
|
||||||
@@ -89,6 +92,15 @@
|
|||||||
summoner << "<span class='danger'><B>Your [name] died somehow!</span></B>"
|
summoner << "<span class='danger'><B>Your [name] died somehow!</span></B>"
|
||||||
summoner.death()
|
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 = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#efeeef'>[resulthealth]%</font></div>"
|
||||||
|
|
||||||
/mob/living/simple_animal/hostile/guardian/adjustHealth(amount) //The spirit is invincible, but passes on damage to the summoner
|
/mob/living/simple_animal/hostile/guardian/adjustHealth(amount) //The spirit is invincible, but passes on damage to the summoner
|
||||||
. = ..()
|
. = ..()
|
||||||
if(summoner)
|
if(summoner)
|
||||||
@@ -101,6 +113,7 @@
|
|||||||
if(summoner.stat == UNCONSCIOUS)
|
if(summoner.stat == UNCONSCIOUS)
|
||||||
summoner << "<span class='danger'><B>Your body can't take the strain of sustaining [src] in this condition, it begins to fall apart!</span></B>"
|
summoner << "<span class='danger'><B>Your body can't take the strain of sustaining [src] in this condition, it begins to fall apart!</span></B>"
|
||||||
summoner.adjustCloneLoss(amount*0.5) //dying hosts take 50% bonus damage as cloneloss
|
summoner.adjustCloneLoss(amount*0.5) //dying hosts take 50% bonus damage as cloneloss
|
||||||
|
updatehudhealth()
|
||||||
|
|
||||||
/mob/living/simple_animal/hostile/guardian/ex_act(severity, target)
|
/mob/living/simple_animal/hostile/guardian/ex_act(severity, target)
|
||||||
switch(severity)
|
switch(severity)
|
||||||
@@ -126,6 +139,7 @@
|
|||||||
return
|
return
|
||||||
if(loc == summoner)
|
if(loc == summoner)
|
||||||
forceMove(get_turf(summoner))
|
forceMove(get_turf(summoner))
|
||||||
|
PoolOrNew(/obj/effect/overlay/temp/guardian/phase, get_turf(src))
|
||||||
cooldown = world.time + 30
|
cooldown = world.time + 30
|
||||||
|
|
||||||
/mob/living/simple_animal/hostile/guardian/proc/Recall()
|
/mob/living/simple_animal/hostile/guardian/proc/Recall()
|
||||||
@@ -133,7 +147,7 @@
|
|||||||
return
|
return
|
||||||
PoolOrNew(/obj/effect/overlay/temp/guardian/phase/out, get_turf(src))
|
PoolOrNew(/obj/effect/overlay/temp/guardian/phase/out, get_turf(src))
|
||||||
unbuckle_mob(force=1)
|
unbuckle_mob(force=1)
|
||||||
loc = summoner
|
forceMove(summoner)
|
||||||
cooldown = world.time + 30
|
cooldown = world.time + 30
|
||||||
|
|
||||||
/mob/living/simple_animal/hostile/guardian/proc/Communicate()
|
/mob/living/simple_animal/hostile/guardian/proc/Communicate()
|
||||||
@@ -735,6 +749,12 @@
|
|||||||
|
|
||||||
var/obj/screen/using
|
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 = new /obj/screen/guardian/Manifest()
|
||||||
using.screen_loc = ui_rhand
|
using.screen_loc = ui_rhand
|
||||||
adding += using
|
adding += using
|
||||||
@@ -764,6 +784,7 @@
|
|||||||
|
|
||||||
/obj/screen/guardian
|
/obj/screen/guardian
|
||||||
icon = 'icons/mob/guardian.dmi'
|
icon = 'icons/mob/guardian.dmi'
|
||||||
|
icon_state = "base"
|
||||||
|
|
||||||
/obj/screen/guardian/Manifest
|
/obj/screen/guardian/Manifest
|
||||||
icon_state = "manifest"
|
icon_state = "manifest"
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Reference in New Issue
Block a user