mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 18:02:57 +00:00
Merge pull request #8869 from Ghommie/Ghommie-cit129
Ports "Show codewords on round end screen"
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -358,8 +358,14 @@
|
||||
return result.Join("<br>")
|
||||
|
||||
/datum/antagonist/traitor/roundend_report_footer()
|
||||
return "<br><b>The code phrases were:</b> <span class='codephrase'>[GLOB.syndicate_code_phrase]</span><br>\
|
||||
<b>The code responses were:</b> <span class='codephrase'>[GLOB.syndicate_code_response]</span><br>"
|
||||
var/phrases = jointext(GLOB.syndicate_code_phrase, ", ")
|
||||
var/responses = jointext(GLOB.syndicate_code_response, ", ")
|
||||
|
||||
var message = "<br><b>The code phrases were:</b> <span class='bluetext'>[phrases]</span><br>\
|
||||
<b>The code responses were:</b> <span class='redtext'>[responses]</span><br>"
|
||||
|
||||
return message
|
||||
|
||||
|
||||
/datum/antagonist/traitor/is_gamemode_hero()
|
||||
return SSticker.mode.name == "traitor"
|
||||
|
||||
@@ -28,12 +28,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, "<span class='blue'>$1</span>")
|
||||
|
||||
for (var/codeword in GLOB.syndicate_code_response)
|
||||
var/regex/codeword_match = new("([codeword])", "ig")
|
||||
message = codeword_match.Replace(message, "<span class='red'>$1</span>")
|
||||
message = GLOB.syndicate_code_phrase_regex.Replace(message, "<span class='blue'>$1</span>")
|
||||
message = GLOB.syndicate_code_response_regex.Replace(message, "<span class='red'>$1</span>")
|
||||
|
||||
return message
|
||||
|
||||
Reference in New Issue
Block a user