From e1d113b970f2fb58568e6641821844ed3bed52f9 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Sun, 10 May 2020 12:35:20 -0700 Subject: [PATCH] Config for antag forcing (#12171) --- .../configuration/entries/game_options.dm | 7 +++++++ code/game/gamemodes/game_mode.dm | 2 +- config/game_options.txt | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index 2c317ade2a..2eefb82f97 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -35,6 +35,13 @@ /datum/config_entry/keyed_list/midround_antag/ValidateListEntry(key_name, key_value) return key_name in config.modes +/datum/config_entry/keyed_list/force_antag_count + key_mode = KEY_MODE_TEXT + value_mode = VALUE_MODE_FLAG + +/datum/config_entry/keyed_list/force_antag_count/ValidateListEntry(key_name, key_value) + return key_name in config.modes + /datum/config_entry/keyed_list/policy key_mode = KEY_MODE_TEXT value_mode = VALUE_MODE_TEXT diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index e2c549d911..a7ccada9f2 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -417,7 +417,7 @@ if(player.assigned_role == job) candidates -= player - if(candidates.len < recommended_enemies) + if(candidates.len < recommended_enemies && CONFIG_GET(keyed_list/force_antag_count)[config_tag]) for(var/mob/dead/new_player/player in players) if(player.client && player.ready == PLAYER_READY_TO_PLAY) if(!(role in player.client.prefs.be_special)) // We don't have enough people who want to be antagonist, make a separate list of people who don't want to be one diff --git a/config/game_options.txt b/config/game_options.txt index 4751e96d18..d81653b840 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -139,6 +139,20 @@ MIDROUND_ANTAG CHANGELING MIDROUND_ANTAG WIZARD #MIDROUND_ANTAG MONKEY +## Toggles for whether this mode should force antags even if not enough players have it enabled. +## If it's off, it just won't roll as many antags. +#FORCE_ANTAG_COUNT TRAITOR +#FORCE_ANTAG_COUNT TRAITORBRO +#FORCE_ANTAG_COUNT TRAITORCHAN +#FORCE_ANTAG_COUNT INTERNAL_AFFAIRS +FORCE_ANTAG_COUNT NUCLEAR +FORCE_ANTAG_COUNT REVOLUTION +FORCE_ANTAG_COUNT CULT +FORCE_ANTAG_COUNT CLOCKWORK_CULT +#FORCE_ANTAG_COUNT CHANGELING +#FORCE_ANTAG_COUNT WIZARD +#FORCE_ANTAG_COUNT MONKEY + ## Uncomment these for overrides of the minimum / maximum number of players in a round type. ## If you set any of these occasionally check to see if you still need them as the modes ## will still be actively rebalanced around the SUGGESTED populations, not your overrides.