Merge pull request #6840 from Neerti/qol_notification_sounds

QoL: Various Notifications
This commit is contained in:
Atermonera
2020-03-20 12:08:04 -07:00
committed by VirgoBot
parent e3e31b12ff
commit d397c2c1fe
31 changed files with 131 additions and 17 deletions

View File

@@ -85,6 +85,7 @@
"ED-209" = "ed209",
"Beepsky" = "secbot"
)
var/last_revive_notification = null // world.time of last notification, used to avoid spamming players from defibs or cloners.
/mob/observer/dead/New(mob/body)
sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
@@ -137,6 +138,9 @@
var/mob/target = locate(href_list["track"]) in mob_list
if(target)
ManualFollow(target)
if(href_list["reenter"])
reenter_corpse()
return
/mob/observer/dead/attackby(obj/item/W, mob/user)
if(istype(W,/obj/item/weapon/book/tome))
@@ -811,3 +815,18 @@ mob/observer/dead/MayRespawn(var/feedback = 0)
/mob/observer/dead/speech_bubble_appearance()
return "ghost"
// Lets a ghost know someone's trying to bring them back, and for them to get into their body.
// Mostly the same as TG's sans the hud element, since we don't have TG huds.
/mob/observer/dead/proc/notify_revive(var/message, var/sound, flashwindow = TRUE)
if((last_revive_notification + 2 MINUTES) > world.time)
return
last_revive_notification = world.time
if(flashwindow)
window_flash(client)
if(message)
to_chat(src, "<span class='ghostalert'><font size=4>[message]</font></span>")
to_chat(src, "<span class='ghostalert'><a href=?src=[REF(src)];reenter=1>(Click to re-enter)</a></span>")
if(sound)
SEND_SOUND(src, sound(sound))