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
16 changes: 16 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 = 0 // BANDASTATION EDIT - Force players to play Sec

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 < CONFIG_GET(number/roundstart_security_for_threat))
var/roundstart_budget_low_sec = security / CONFIG_GET(number/roundstart_security_for_threat) * 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
5 changes: 5 additions & 0 deletions config/bandastation/bandastation_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
#TTS_API_URL_SILERO

#WHITELIST220

## A minimum amount of security required on roundstart
## If there is less security than this value, a percent of roundstart threat will be pushed to midround
## Example: with value of 5, if there is 2 security members out of 5, then 3/5 of roundstart threat will be moved to midround
#ROUNDSTART_SECURITY_FOR_THREAT 5
1 change: 1 addition & 0 deletions modular_bandastation/balance/_balance.dme
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "_balance.dm"

#include "code/balance_riding.dm"
#include "code/dynamic.dm"
#include "code/events.dm"
#include "code/station_traits.dm"
#include "code/supply_packs.dm"
3 changes: 3 additions & 0 deletions modular_bandastation/balance/code/dynamic.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/datum/config_entry/number/roundstart_security_for_threat
default = 5
min_val = 0
Loading