From d87fdaaefaffe66a16b12104eb6ae120441a798d Mon Sep 17 00:00:00 2001 From: Akrilla Date: Fri, 24 May 2019 22:34:46 +0100 Subject: [PATCH] Highlight codewords Phrases in blue, responses in red. --- code/game/say.dm | 14 ++++++++++++++ code/modules/mob/living/say.dm | 2 ++ 2 files changed, 16 insertions(+) diff --git a/code/game/say.dm b/code/game/say.dm index 9553b4eb4c1..ccbd10c0e4a 100644 --- a/code/game/say.dm +++ b/code/game/say.dm @@ -70,6 +70,18 @@ GLOBAL_LIST_INIT(freqtospan, list( return "[spanpart1][spanpart2][freqpart][languageicon][compose_track_href(speaker, namepart)][namepart][compose_job(speaker, message_language, raw_message, radio_freq)][endspanpart][messagepart]" +/atom/movable/proc/augment_heard(message, mob/mob_hearing) + if (mob_hearing.mind.special_role == ROLE_TRAITOR) + for (var/codeword in GLOB.syndicate_code_phrase) + var/regex/codeword_match = new("(" + codeword + ")", "ig") + message = codeword_match.Replace(message, "$1") + + for (var/codeword in GLOB.syndicate_code_response) + var/regex/codeword_match = new("(" + codeword + ")", "ig") + message = codeword_match.Replace(message, "$1") + + return message + /atom/movable/proc/compose_track_href(atom/movable/speaker, message_langs, raw_message, radio_freq) return "" @@ -203,6 +215,8 @@ INITIALIZE_IMMEDIATE(/atom/movable/virtualspeaker) else // Unidentifiable mob job = "Unknown" + + /atom/movable/virtualspeaker/GetJob() return job diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 2215d6d5980..b15437095d3 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -229,6 +229,8 @@ GLOBAL_LIST_INIT(department_radio_keys, list( // Recompose message for AI hrefs, language incomprehension. message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode) message = hear_intercept(message, speaker, message_language, raw_message, radio_freq, spans, message_mode) + message = augment_heard(message, src) + show_message(message, 2, deaf_message, deaf_type) return message