mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 09:54:52 +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_phrase) //Code phrase for traitors.
|
||||||
GLOBAL_VAR(syndicate_code_response) //Code response 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.
|
Should be expanded.
|
||||||
How this works:
|
How this works:
|
||||||
|
|||||||
@@ -127,9 +127,20 @@ SUBSYSTEM_DEF(ticker)
|
|||||||
|
|
||||||
if(!GLOB.syndicate_code_phrase)
|
if(!GLOB.syndicate_code_phrase)
|
||||||
GLOB.syndicate_code_phrase = generate_code_phrase(return_list=TRUE)
|
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)
|
if(!GLOB.syndicate_code_response)
|
||||||
GLOB.syndicate_code_response = generate_code_phrase(return_list=TRUE)
|
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)
|
start_at = world.time + (CONFIG_GET(number/lobby_countdown) * 10)
|
||||||
if(CONFIG_GET(flag/randomize_shift_time))
|
if(CONFIG_GET(flag/randomize_shift_time))
|
||||||
gametime_offset = rand(0, 23) HOURS
|
gametime_offset = rand(0, 23) HOURS
|
||||||
|
|||||||
@@ -358,8 +358,14 @@
|
|||||||
return result.Join("<br>")
|
return result.Join("<br>")
|
||||||
|
|
||||||
/datum/antagonist/traitor/roundend_report_footer()
|
/datum/antagonist/traitor/roundend_report_footer()
|
||||||
return "<br><b>The code phrases were:</b> <span class='codephrase'>[GLOB.syndicate_code_phrase]</span><br>\
|
var/phrases = jointext(GLOB.syndicate_code_phrase, ", ")
|
||||||
<b>The code responses were:</b> <span class='codephrase'>[GLOB.syndicate_code_response]</span><br>"
|
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()
|
/datum/antagonist/traitor/is_gamemode_hero()
|
||||||
return SSticker.mode.name == "traitor"
|
return SSticker.mode.name == "traitor"
|
||||||
|
|||||||
@@ -28,12 +28,7 @@
|
|||||||
message = trauma.on_hear(message, speaker, message_language, raw_message, radio_freq)
|
message = trauma.on_hear(message, speaker, message_language, raw_message, radio_freq)
|
||||||
|
|
||||||
if (src.mind.has_antag_datum(/datum/antagonist/traitor))
|
if (src.mind.has_antag_datum(/datum/antagonist/traitor))
|
||||||
for (var/codeword in GLOB.syndicate_code_phrase)
|
message = GLOB.syndicate_code_phrase_regex.Replace(message, "<span class='blue'>$1</span>")
|
||||||
var/regex/codeword_match = new("([codeword])", "ig")
|
message = GLOB.syndicate_code_response_regex.Replace(message, "<span class='red'>$1</span>")
|
||||||
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>")
|
|
||||||
|
|
||||||
return message
|
return message
|
||||||
|
|||||||
@@ -10,6 +10,10 @@
|
|||||||
color: #ef2f3c;
|
color: #ef2f3c;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
.bluetext {
|
||||||
|
color: #517fff;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
.neutraltext {
|
.neutraltext {
|
||||||
font-weight: bold; /* If you feel these should have some color feel free to change */
|
font-weight: bold; /* If you feel these should have some color feel free to change */
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user