guardian coms fix

This commit is contained in:
SteelSlayer
2020-05-27 18:11:40 -05:00
parent d746971cc7
commit 934ef6dcd0
@@ -182,15 +182,18 @@
input = stripped_input(src, "Please enter a message to tell your summoner.", "Guardian", "")
else
input = message
if(!input) return
if(!input)
return
for(var/mob/M in GLOB.mob_list)
if(M == summoner)
to_chat(M, "<span class='changeling'><i>[src]:</i> [input]</span>")
log_say("(GUARDIAN to [key_name(M)]) [input]", src)
else if(M in GLOB.dead_mob_list && M.client && M.stat == DEAD && !isnewplayer(M))
to_chat(M, "<span class='changeling'><i>Guardian Communication from <b>[src]</b> ([ghost_follow_link(src, ghost=M)]): [input]</i>")
// Show the message to the host and to the guardian.
to_chat(summoner, "<span class='changeling'><i>[src]:</i> [input]</span>")
to_chat(src, "<span class='changeling'><i>[src]:</i> [input]</span>")
log_say("(GUARDIAN to [key_name(summoner)]) [input]", src)
// Show the message to any ghosts/dead players.
for(var/mob/M in GLOB.dead_mob_list)
if(M && M.client && M.stat == DEAD && !isnewplayer(M))
to_chat(M, "<span class='changeling'><i>Guardian Communication from <b>[src]</b> ([ghost_follow_link(src, ghost=M)]): [input]</i>")
//override set to true if message should be passed through instead of going to host communication
/mob/living/simple_animal/hostile/guardian/say(message, override = FALSE)
@@ -208,18 +211,23 @@
set category = "Guardian"
set desc = "Communicate telepathically with your guardian."
var/input = stripped_input(src, "Please enter a message to tell your guardian.", "Message", "")
if(!input) return
if(!input)
return
for(var/mob/M in GLOB.mob_list)
if(istype(M, /mob/living/simple_animal/hostile/guardian))
var/mob/living/simple_animal/hostile/guardian/G = M
if(G.summoner == src)
to_chat(G, "<span class='changeling'><i>[src]:</i> [input]</span>")
log_say("(GUARDIAN to [key_name(G)]) [input]", src)
// Find the guardian in our host's contents.
var/mob/living/simple_animal/hostile/guardian/G = locate() in contents
if(!G)
return
else if(M in GLOB.dead_mob_list && M.client && M.stat == DEAD && !isnewplayer(M))
to_chat(M, "<span class='changeling'><i>Guardian Communication from <b>[src]</b> ([ghost_follow_link(src, ghost=M)]): [input]</i>")
// Show the message to our guardian and to host.
to_chat(G, "<span class='changeling'><i>[src]:</i> [input]</span>")
to_chat(src, "<span class='changeling'><i>[src]:</i> [input]</span>")
log_say("(GUARDIAN to [key_name(G)]) [input]", src)
// Show the message to any ghosts/dead players.
for(var/mob/M in GLOB.dead_mob_list)
if(M && M.client && M.stat == DEAD && !isnewplayer(M))
to_chat(M, "<span class='changeling'><i>Guardian Communication from <b>[src]</b> ([ghost_follow_link(src, ghost=M)]): [input]</i>")
/mob/living/proc/guardian_recall()
set name = "Recall Guardian"