Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force players to play Sec - If not enough sec, no roundstart antags #365

Merged
merged 11 commits into from
Jul 24, 2024
17 changes: 17 additions & 0 deletions code/controllers/subsystem/dynamic/dynamic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ SUBSYSTEM_DEF(dynamic)
//To new_player and such, and we want the datums to just free when the roundstart work is done
var/list/roundstart_rules = init_rulesets(/datum/dynamic_ruleset/roundstart)

var/security // BANDASTATION EDIT - Force players to play Sec
larentoun marked this conversation as resolved.
Show resolved Hide resolved

SSjob.DivideOccupations(pure = TRUE, allow_all = TRUE)
for(var/i in GLOB.new_player_list)
var/mob/dead/new_player/player = i
Expand All @@ -545,12 +547,26 @@ SUBSYSTEM_DEF(dynamic)
else
roundstart_pop_ready++
candidates.Add(player)
// BANDASTATION EDIT START - Force players to play Sec
if(player.mind?.assigned_role?.departments_list?.Find(/datum/job_department/security))
security++
// BANDASTATION EDIT END
SSjob.ResetOccupations()
log_dynamic("Listing [roundstart_rules.len] round start rulesets, and [candidates.len] players ready.")
if (candidates.len <= 0)
log_dynamic("[candidates.len] candidates.")
return TRUE

// BANDASTATION EDIT START - Force players to play Sec
if(security < 5)
var/roundstart_budget_low_sec = security / 5 * round_start_budget
var/transfer_to_midround = round_start_budget - roundstart_budget_low_sec
mid_round_budget += transfer_to_midround
round_start_budget = roundstart_budget_low_sec
initial_round_start_budget = roundstart_budget_low_sec
log_dynamic("Not enough security; forcing roundstart budget to [roundstart_budget_low_sec]")
// BANDASTATION EDIT END

if(GLOB.dynamic_forced_roundstart_ruleset.len > 0)
rigged_roundstart()
else
Expand Down Expand Up @@ -699,6 +715,7 @@ SUBSYSTEM_DEF(dynamic)
if (GLOB.dynamic_forced_extended)
log_dynamic("Starting a round of forced extended.")
return TRUE

var/list/drafted_rules = list()
for (var/datum/dynamic_ruleset/roundstart/rule in roundstart_rules)
if (!rule.weight)
Expand Down
Loading