[MIRROR] brings back greenshifts [MDB IGNORE] (#11281)

* brings back greenshifts

* Update code/game/gamemodes/game_mode.dm

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-02-05 18:58:52 +01:00
committed by GitHub
parent 2e5cde5a3f
commit 37e295b04a
2 changed files with 17 additions and 6 deletions
+14 -3
View File
@@ -288,13 +288,24 @@ 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.<BR>"
. += "Good luck."
var/min_threat = 100
for(var/datum/dynamic_ruleset/ruleset as anything in init_rulesets(/datum/dynamic_ruleset))
if(ruleset.weight <= 0 || ruleset.cost <= 0)
continue
min_threat = min(ruleset.cost, min_threat)
var/greenshift = GLOB.dynamic_forced_extended || (threat_level < min_threat && shown_threat < min_threat) //if both shown and real threat are below any ruleset, its extended time
generate_station_goals(greenshift)
. += 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)
if(SSsecurity_level.current_level < SEC_LEVEL_BLUE)
set_security_level(SEC_LEVEL_BLUE)
if(greenshift)
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())
else
priority_announce("A summary has been copied and printed to all communications consoles.", "Security level elevated.", ANNOUNCER_INTERCEPT)
if(SSsecurity_level.current_level < SEC_LEVEL_BLUE)
set_security_level(SEC_LEVEL_BLUE)
/datum/game_mode/dynamic/proc/show_threatlog(mob/admin)
if(!SSticker.HasRoundStarted())
+3 -3
View File
@@ -49,7 +49,6 @@
)
query_round_game_mode.Execute()
qdel(query_round_game_mode)
//generate_station_goals() SKYRAT EDIT REMOVAL
return TRUE
@@ -183,10 +182,11 @@
for (var/C in GLOB.admins)
to_chat(C, msg.Join())
/datum/game_mode/proc/generate_station_goals()
/datum/game_mode/proc/generate_station_goals(greenshift)
var/goal_budget = greenshift ? INFINITY : CONFIG_GET(number/station_goal_budget)
var/list/possible = subtypesof(/datum/station_goal)
var/goal_weights = 0
while(possible.len && goal_weights < CONFIG_GET(number/station_goal_budget))
while(possible.len && goal_weights < goal_budget)
var/datum/station_goal/picked = pick_n_take(possible)
goal_weights += initial(picked.weight)
GLOB.station_goals += new picked