diff --git a/code/__HELPERS/names.dm b/code/__HELPERS/names.dm
index 09e0aa95b9..db2eba2422 100644
--- a/code/__HELPERS/names.dm
+++ b/code/__HELPERS/names.dm
@@ -151,6 +151,10 @@ GLOBAL_VAR(command_name)
GLOBAL_VAR(syndicate_code_phrase) //Code phrase for traitors.
GLOBAL_VAR(syndicate_code_response) //Code response for traitors.
+//Cached regex search - for checking if codewords are used.
+GLOBAL_DATUM(syndicate_code_phrase_regex, /regex)
+GLOBAL_DATUM(syndicate_code_response_regex, /regex)
+
/*
Should be expanded.
How this works:
diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm
index 74f9ad0382..436ed73b6b 100755
--- a/code/controllers/subsystem/ticker.dm
+++ b/code/controllers/subsystem/ticker.dm
@@ -127,9 +127,20 @@ SUBSYSTEM_DEF(ticker)
if(!GLOB.syndicate_code_phrase)
GLOB.syndicate_code_phrase = generate_code_phrase(return_list=TRUE)
+
+ var/codewords = jointext(GLOB.syndicate_code_phrase, "|")
+ var/regex/codeword_match = new("([codewords])", "ig")
+
+ GLOB.syndicate_code_phrase_regex = codeword_match
+
if(!GLOB.syndicate_code_response)
GLOB.syndicate_code_response = generate_code_phrase(return_list=TRUE)
+ var/codewords = jointext(GLOB.syndicate_code_response, "|")
+ var/regex/codeword_match = new("([codewords])", "ig")
+
+ GLOB.syndicate_code_response_regex = codeword_match
+
start_at = world.time + (CONFIG_GET(number/lobby_countdown) * 10)
if(CONFIG_GET(flag/randomize_shift_time))
gametime_offset = rand(0, 23) HOURS
diff --git a/code/modules/mob/living/carbon/say.dm b/code/modules/mob/living/carbon/say.dm
index c52b827964..916ce2cca7 100644
--- a/code/modules/mob/living/carbon/say.dm
+++ b/code/modules/mob/living/carbon/say.dm
@@ -48,12 +48,7 @@
message = trauma.on_hear(message, speaker, message_language, raw_message, radio_freq)
if (src.mind.has_antag_datum(/datum/antagonist/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")
+ message = GLOB.syndicate_code_phrase_regex.Replace(message, "$1")
+ message = GLOB.syndicate_code_response_regex.Replace(message, "$1")
return message
diff --git a/html/browser/roundend.css b/html/browser/roundend.css
index 865b42999e..e69635e888 100644
--- a/html/browser/roundend.css
+++ b/html/browser/roundend.css
@@ -10,6 +10,10 @@
color: #ef2f3c;
font-weight: bold;
}
+.bluetext {
+ color: #517fff;
+ font-weight: bold;
+}
.neutraltext {
font-weight: bold; /* If you feel these should have some color feel free to change */
}