From d42c2c04815fed8432ee367d6f157ead1faf8ed1 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 3 Mar 2021 03:44:32 +0100 Subject: [PATCH] [MIRROR] Announced Extended now sends a report for station traits + minor punctuation cleanup (#3779) * Announced Extended now sends a report for station traits + minor punctuation cleanup * Update dynamic.dm Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Gandalf --- code/datums/station_traits/negative_traits.dm | 2 +- code/datums/station_traits/positive_traits.dm | 2 +- code/game/gamemodes/dynamic/dynamic.dm | 16 +------ code/game/gamemodes/extended/extended.dm | 10 ++++- code/game/gamemodes/game_mode.dm | 43 +++++++++++++------ 5 files changed, 42 insertions(+), 31 deletions(-) diff --git a/code/datums/station_traits/negative_traits.dm b/code/datums/station_traits/negative_traits.dm index ec97e1a8884..ba67d69b26a 100644 --- a/code/datums/station_traits/negative_traits.dm +++ b/code/datums/station_traits/negative_traits.dm @@ -3,7 +3,7 @@ trait_type = STATION_TRAIT_NEGATIVE weight = 5 show_in_report = TRUE - report_message = "Dangerous fauna is present in the area of this station" + report_message = "Dangerous fauna is present in the area of this station." trait_to_give = STATION_TRAIT_CARP_INFESTATION /datum/station_trait/distant_supply_lines diff --git a/code/datums/station_traits/positive_traits.dm b/code/datums/station_traits/positive_traits.dm index 9d9c0faa829..6f78d0be9d6 100644 --- a/code/datums/station_traits/positive_traits.dm +++ b/code/datums/station_traits/positive_traits.dm @@ -117,7 +117,7 @@ trait_type = STATION_TRAIT_POSITIVE weight = 5 show_in_report = TRUE - report_message = "Due to proximity to our supply station, the cargo shuttle will have a quicker flight time to your cargo department/" + report_message = "Due to proximity to our supply station, the cargo shuttle will have a quicker flight time to your cargo department." blacklist = list(/datum/station_trait/slow_shuttle) /datum/station_trait/quick_shuttle/on_round_start() diff --git a/code/game/gamemodes/dynamic/dynamic.dm b/code/game/gamemodes/dynamic/dynamic.dm index 09c90cd7ef2..e340217d258 100644 --- a/code/game/gamemodes/dynamic/dynamic.dm +++ b/code/game/gamemodes/dynamic/dynamic.dm @@ -286,20 +286,8 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1) . += "Your station is somehow in the middle of hostile territory, in clear view of any enemy of the corporation. Your likelihood to survive is low, and station destruction is expected and almost inevitable. Secure any sensitive material and neutralize any enemy you will come across. It is important that you at least try to maintain the station.
" . += "Good luck." - if(station_goals.len) - . += "
Special Orders for [station_name()]:" - for(var/datum/station_goal/G in station_goals) - G.on_report() - . += G.get_report() - - if(SSstation.station_traits.len) - . += "
Identified shift divergencies:
" - for(var/i in SSstation.station_traits) - var/datum/station_trait/station_trait_iterator = i - if(!station_trait_iterator.show_in_report) - return - . += "[station_trait_iterator.get_report()]
" - + . += generate_station_goal_report() + . += generate_station_trait_report() print_command_report(., "Central Command Status Summary", announce=FALSE) priority_announce("A summary has been copied and printed to all communications consoles.", "Security level elevated.", ANNOUNCER_INTERCEPT) diff --git a/code/game/gamemodes/extended/extended.dm b/code/game/gamemodes/extended/extended.dm index b3e198012ae..4d342dbf2dd 100644 --- a/code/game/gamemodes/extended/extended.dm +++ b/code/game/gamemodes/extended/extended.dm @@ -25,5 +25,11 @@ station_goals += G G.on_report() -/datum/game_mode/extended/announced/send_intercept(report = 0) - priority_announce("Thanks to the tireless efforts of our security and intelligence divisions, there are currently no credible threats to [station_name()]. All station construction projects have been authorized. Have a secure shift!", "Security Report", SSstation.announcer.get_rand_report_sound()) +/datum/game_mode/extended/announced/send_intercept() + var/greenshift_message = "Thanks to the tireless efforts of our security and intelligence divisions, there are currently no credible threats to [station_name()]. All station construction projects have been authorized. Have a secure shift!" + . += "Central Command Status Summary
" + . += greenshift_message + . += generate_station_trait_report() + + print_command_report(., "Central Command Status Summary", announce = FALSE) + priority_announce(greenshift_message, "Security Report", SSstation.announcer.get_rand_report_sound()) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index c098380dd9d..4f5dc3f09d3 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -293,25 +293,42 @@ intercepttext += "
" intercepttext += report - if(station_goals.len) - intercepttext += "
Special Orders for [station_name()]:" - for(var/datum/station_goal/G in station_goals) - G.on_report() - intercepttext += G.get_report() - - if(SSstation.station_traits.len) - intercepttext += "
Identified shift divergencies:" - for(var/i in SSstation.station_traits) - var/datum/station_trait/station_trait_iterator = i - if(!station_trait_iterator.show_in_report) - return - intercepttext += station_trait_iterator.get_report() + intercepttext += generate_station_goal_report() + intercepttext += generate_station_trait_report() print_command_report(intercepttext, "Central Command Status Summary", announce=FALSE) priority_announce("A summary has been copied and printed to all communications consoles.", "Enemy communication intercepted. Security level elevated.", ANNOUNCER_INTERCEPT) if(GLOB.security_level < SEC_LEVEL_BLUE) set_security_level(SEC_LEVEL_BLUE) +/* + * Generate a list of station goals available to purchase to report to the crew. + * + * Returns a formatted string all station goals that are available to the station. + */ +/datum/game_mode/proc/generate_station_goal_report() + if(!station_goals.len) + return + . = "
Special Orders for [station_name()]:
" + for(var/datum/station_goal/station_goal in station_goals) + station_goal.on_report() + . += station_goal.get_report() + return + +/* + * Generate a list of active station traits to report to the crew. + * + * Returns a formatted string of all station traits (that are shown) affecting the station. + */ +/datum/game_mode/proc/generate_station_trait_report() + if(!SSstation.station_traits.len) + return + . = "
Identified shift divergencies:
" + for(var/datum/station_trait/station_trait as anything in SSstation.station_traits) + if(!station_trait.show_in_report) + continue + . += "[station_trait.get_report()]
" + return // This is a frequency selection system. You may imagine it like a raffle where each player can have some number of tickets. The more tickets you have the more likely you are to // "win". The default is 100 tickets. If no players use any extra tickets (earned with the antagonist rep system) calling this function should be equivalent to calling the normal