From 408517fb1d02c5c374d3bd4659b388dcaa10cf46 Mon Sep 17 00:00:00 2001 From: keronshb Date: Thu, 16 Sep 2021 20:53:46 -0400 Subject: [PATCH] SHOULD? FIX? --- code/_globalvars/game_modes.dm | 4 +- .../configuration/configuration.dm | 2 +- code/controllers/subsystem/ticker.dm | 42 +++++-------------- code/game/gamemodes/dynamic/dynamic.dm | 1 + config/entries/gamemodes.txt | 1 + 5 files changed, 15 insertions(+), 35 deletions(-) diff --git a/code/_globalvars/game_modes.dm b/code/_globalvars/game_modes.dm index 960e1f8d59..7553c82502 100644 --- a/code/_globalvars/game_modes.dm +++ b/code/_globalvars/game_modes.dm @@ -1,5 +1,5 @@ -GLOBAL_VAR_INIT(master_mode, "traitor") //"extended" -GLOBAL_VAR_INIT(secret_force_mode, "secret") // if this is anything but "secret", the secret rotation will forceably choose this mode +GLOBAL_VAR_INIT(master_mode, "dynamic") //"extended" +GLOBAL_VAR_INIT(secret_force_mode, "dynamic") // if this is anything but "secret", the secret rotation will forceably choose this mode GLOBAL_VAR(common_report) //Contains common part of roundend report GLOBAL_VAR(survivor_report) //Contains shared survivor report for roundend report (part of personal report) diff --git a/code/controllers/configuration/configuration.dm b/code/controllers/configuration/configuration.dm index b5b7caa37b..bf89be1b51 100644 --- a/code/controllers/configuration/configuration.dm +++ b/code/controllers/configuration/configuration.dm @@ -265,7 +265,7 @@ if(M.votable) votable_modes += M.config_tag qdel(M) - votable_modes += "secret" + votable_modes += "dynamic" /datum/controller/configuration/proc/LoadMOTD() motd = file2text("[directory]/motd.txt") diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index dfee659080..a1628e49da 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -227,36 +227,14 @@ SUBSYSTEM_DEF(ticker) /datum/controller/subsystem/ticker/proc/setup() to_chat(world, "Starting game...") var/init_start = world.timeofday - //Create and announce mode - var/list/datum/game_mode/runnable_modes - if(GLOB.master_mode == "random" || GLOB.master_mode == "secret") - runnable_modes = config.get_runnable_modes() - - if(GLOB.master_mode == "secret") - hide_mode = 1 - if(GLOB.secret_force_mode != "secret") - var/datum/game_mode/smode = config.pick_mode(GLOB.secret_force_mode) - if(!smode.can_start()) - message_admins("Unable to force secret [GLOB.secret_force_mode]. [smode.required_players] players and [smode.required_enemies] eligible antagonists needed.") - else - mode = smode - - if(!mode) - if(!runnable_modes.len) - to_chat(world, "Unable to choose playable game mode. Reverting to pre-game lobby.") - return 0 - mode = pickweight(runnable_modes) - if(!mode) //too few roundtypes all run too recently - mode = pick(runnable_modes) - - else - mode = config.pick_mode(GLOB.master_mode) - if(!mode.can_start()) - to_chat(world, "Unable to start [mode.name]. Not enough players, [mode.required_players] players and [mode.required_enemies] eligible antagonists needed. Reverting to pre-game lobby.") - qdel(mode) - mode = null - SSjob.ResetOccupations() - return 0 + GLOB.master_mode = "dynamic" + mode = config.pick_mode(GLOB.master_mode) + if(!mode.can_start()) + to_chat(world, "Unable to start [mode.name]. Not enough players, [mode.required_players] players and [mode.required_enemies] eligible antagonists needed. Reverting to pre-game lobby.") + qdel(mode) + mode = null + SSjob.ResetOccupations() + return 0 CHECK_TICK //Configure mode and assign player to special mode stuff @@ -640,9 +618,9 @@ SUBSYSTEM_DEF(ticker) /datum/controller/subsystem/ticker/proc/load_mode() var/mode = trim(file2text("data/mode.txt")) if(mode) - GLOB.master_mode = mode + GLOB.master_mode = "dynamic" else - GLOB.master_mode = "extended" + GLOB.master_mode = "dynamic" log_game("Saved mode is '[GLOB.master_mode]'") /datum/controller/subsystem/ticker/proc/save_mode(the_mode) diff --git a/code/game/gamemodes/dynamic/dynamic.dm b/code/game/gamemodes/dynamic/dynamic.dm index 36932dd651..1b03a1e3f7 100644 --- a/code/game/gamemodes/dynamic/dynamic.dm +++ b/code/game/gamemodes/dynamic/dynamic.dm @@ -17,6 +17,7 @@ GLOBAL_LIST_EMPTY(dynamic_forced_roundstart_ruleset) GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1) /datum/game_mode/dynamic + config_tag = "dynamic" // Threat logging vars /// The "threat cap", threat shouldn't normally go above this and is used in ruleset calculations var/threat_level = 0 diff --git a/config/entries/gamemodes.txt b/config/entries/gamemodes.txt index f78c3743aa..7193bef584 100644 --- a/config/entries/gamemodes.txt +++ b/config/entries/gamemodes.txt @@ -51,6 +51,7 @@ CONTINUOUS WIZARD #CONTINUOUS MONKEY CONTINUOUS BLOODSUCKER CONTINUOUS HERESY +CONTINUOUS DYNAMIC ##Note: do not toggle continuous off for these modes, as they have no antagonists and would thus end immediately!