From 934ef6dcd04e7a5cd2c682caa2abd26228c2527f Mon Sep 17 00:00:00 2001 From: SteelSlayer Date: Wed, 27 May 2020 18:11:40 -0500 Subject: [PATCH 1/2] guardian coms fix --- .../gamemodes/miniantags/guardian/guardian.dm | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/code/game/gamemodes/miniantags/guardian/guardian.dm b/code/game/gamemodes/miniantags/guardian/guardian.dm index 126587a0c97..850c6ef57bd 100644 --- a/code/game/gamemodes/miniantags/guardian/guardian.dm +++ b/code/game/gamemodes/miniantags/guardian/guardian.dm @@ -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, "[src]: [input]") - 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, "Guardian Communication from [src] ([ghost_follow_link(src, ghost=M)]): [input]") + // Show the message to the host and to the guardian. + to_chat(summoner, "[src]: [input]") to_chat(src, "[src]: [input]") + 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, "Guardian Communication from [src] ([ghost_follow_link(src, ghost=M)]): [input]") //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, "[src]: [input]") - 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, "Guardian Communication from [src] ([ghost_follow_link(src, ghost=M)]): [input]") + // Show the message to our guardian and to host. + to_chat(G, "[src]: [input]") to_chat(src, "[src]: [input]") + 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, "Guardian Communication from [src] ([ghost_follow_link(src, ghost=M)]): [input]") /mob/living/proc/guardian_recall() set name = "Recall Guardian" From dd3749f75ceca2ae909d924627f7e4aa44356003 Mon Sep 17 00:00:00 2001 From: SteelSlayer Date: Thu, 28 May 2020 13:34:58 -0500 Subject: [PATCH 2/2] say logs --- code/game/gamemodes/miniantags/guardian/guardian.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/game/gamemodes/miniantags/guardian/guardian.dm b/code/game/gamemodes/miniantags/guardian/guardian.dm index 850c6ef57bd..7c7f7a9f694 100644 --- a/code/game/gamemodes/miniantags/guardian/guardian.dm +++ b/code/game/gamemodes/miniantags/guardian/guardian.dm @@ -189,6 +189,7 @@ to_chat(summoner, "[src]: [input]") to_chat(src, "[src]: [input]") log_say("(GUARDIAN to [key_name(summoner)]) [input]", src) + create_log(SAY_LOG, "GUARDIAN to HOST: [input]", summoner) // Show the message to any ghosts/dead players. for(var/mob/M in GLOB.dead_mob_list) @@ -223,6 +224,7 @@ to_chat(G, "[src]: [input]") to_chat(src, "[src]: [input]") log_say("(GUARDIAN to [key_name(G)]) [input]", src) + create_log(SAY_LOG, "HOST to GUARDIAN: [input]", G) // Show the message to any ghosts/dead players. for(var/mob/M in GLOB.dead_mob_list)