From b9e88f85bb5991714d1c0f63351bd72105fdd322 Mon Sep 17 00:00:00 2001 From: Putnam Date: Sat, 25 Apr 2020 17:15:17 -0700 Subject: [PATCH] Allowed better admeme stuff for dynamic --- code/game/gamemodes/dynamic/dynamic.dm | 4 ++++ code/modules/admin/admin.dm | 6 +++++- code/modules/admin/topic.dm | 26 ++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/code/game/gamemodes/dynamic/dynamic.dm b/code/game/gamemodes/dynamic/dynamic.dm index 32fb4498dd..039452af46 100644 --- a/code/game/gamemodes/dynamic/dynamic.dm +++ b/code/game/gamemodes/dynamic/dynamic.dm @@ -43,6 +43,8 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1) GLOBAL_VAR_INIT(dynamic_storyteller_type, /datum/dynamic_storyteller/classic) +GLOBAL_VAR_INIT(dynamic_forced_storyteller, 0) + /datum/game_mode/dynamic name = "dynamic mode" config_tag = "dynamic" @@ -355,6 +357,8 @@ GLOBAL_VAR_INIT(dynamic_storyteller_type, /datum/dynamic_storyteller/classic) SSblackbox.record_feedback("tally","dynamic_threat",peaceful_percentage,"Percent of same-vote rounds that are more peaceful") /datum/game_mode/dynamic/can_start() + if(GLOB.dynamic_forced_storyteller) + GLOB.dynamic_storyteller_type = GLOB.dynamic_forced_storyteller storyteller = new GLOB.dynamic_storyteller_type // this is where all the initialization happens storyteller.on_start() SSblackbox.record_feedback("text","dynamic_storyteller",1,storyteller.name) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 4a7e818125..c98341612a 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -429,6 +429,10 @@ for(var/datum/dynamic_ruleset/roundstart/rule in GLOB.dynamic_forced_roundstart_ruleset) dat += {"-> [rule.name] <-
"} dat += "(Clear Rulesets)
" + dat += "(Force Storyteller)
" + if (GLOB.dynamic_forced_storyteller) + var/datum/dynamic_storyteller/S = GLOB.dynamic_forced_storyteller + dat += "-> [initial(S.name)] <-
" dat += "(Dynamic mode options)
" else if (SSticker.IsRoundInProgress()) dat += "(Force Next Latejoin Ruleset)
" @@ -690,7 +694,7 @@ var/prev_dynamic_voting = CONFIG_GET(flag/dynamic_voting) CONFIG_SET(flag/dynamic_voting,!prev_dynamic_voting) if (!prev_dynamic_voting) - to_chat(world, "Vote is now a ranked choice of dynamic storytellers.") + to_chat(world, "Vote is between dynamic storytellers.") else to_chat(world, "Vote is now between extended and secret.") log_admin("[key_name(usr)] [prev_dynamic_voting ? "disabled" : "enabled"] dynamic voting.") diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 342f2ca6eb..042a6e0fe9 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1394,6 +1394,32 @@ log_admin("[key_name(usr)] removed [rule] from the forced roundstart rulesets.") message_admins("[key_name(usr)] removed [rule] from the forced roundstart rulesets.", 1) + else if(href_list["f_dynamic_storyteller"]) + if(!check_rights(R_ADMIN)) + return + if(SSticker && SSticker.mode) + return alert(usr, "The game has already started.", null, null, null, null) + if(GLOB.master_mode != "dynamic") + return alert(usr, "The game mode has to be dynamic mode.", null, null, null, null) + var/list/choices = list() + for(var/T in config.storyteller_cache) + var/datum/dynamic_storyteller/S = T + choices[initial(S.name)] = T + var/choice = choices[input("Select storyteller:", "Storyteller", "Classic") as null|anything in choices] + if(choice) + GLOB.dynamic_forced_storyteller = choice + log_admin("[key_name(usr)] forced the storyteller to [GLOB.dynamic_forced_storyteller].") + message_admins("[key_name(usr)] forced the storyteller to [GLOB.dynamic_forced_storyteller].") + Game() + + else if(href_list["f_dynamic_storyteller_clear"]) + if(!check_rights(R_ADMIN)) + return + GLOB.dynamic_forced_storyteller = null + Game() + log_admin("[key_name(usr)] cleared the forced storyteller. The mode will pick one as normal.") + message_admins("[key_name(usr)] cleared the forced storyteller. The mode will pick one as normal.", 1) + else if(href_list["f_dynamic_latejoin"]) if(!check_rights(R_ADMIN)) return