From 82fe5f04553509b72b968ba4d45b1b241ad6923a Mon Sep 17 00:00:00 2001 From: Putnam Date: Sat, 25 Apr 2020 16:28:58 -0700 Subject: [PATCH 1/7] Allow rigged dynamic roundstarts (whoops) --- code/controllers/subsystem/vote.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index a202afd905..005c066331 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -352,7 +352,6 @@ SUBSYSTEM_DEF(vote) if("dynamic") if(SSticker.current_state > GAME_STATE_PREGAME)//Don't change the mode if the round already started. return message_admins("A vote has tried to change the gamemode, but the game has already started. Aborting.") - GLOB.master_mode = "dynamic" var/list/runnable_storytellers = config.get_runnable_storytellers() var/datum/dynamic_storyteller/picked for(var/T in runnable_storytellers) @@ -489,6 +488,7 @@ SUBSYSTEM_DEF(vote) modes_to_add -= "traitor" // makes it so that traitor is always available choices.Add(modes_to_add) if("dynamic") + GLOB.master_mode = "dynamic" var/list/probabilities = CONFIG_GET(keyed_list/storyteller_weight) for(var/T in config.storyteller_cache) var/datum/dynamic_storyteller/S = T From b9e88f85bb5991714d1c0f63351bd72105fdd322 Mon Sep 17 00:00:00 2001 From: Putnam Date: Sat, 25 Apr 2020 17:15:17 -0700 Subject: [PATCH 2/7] 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 From 77a378b1313f0e4ba0ba37702c9f35afcf724bc7 Mon Sep 17 00:00:00 2001 From: Putnam Date: Sat, 25 Apr 2020 17:16:31 -0700 Subject: [PATCH 3/7] wow that's the wrong thing to do --- code/modules/admin/admin.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index c98341612a..d84d3eb16b 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -432,7 +432,7 @@ dat += "(Force Storyteller)
" if (GLOB.dynamic_forced_storyteller) var/datum/dynamic_storyteller/S = GLOB.dynamic_forced_storyteller - dat += "-> [initial(S.name)] <-
" + dat += "-> [initial(S.name)] <-
" dat += "(Dynamic mode options)
" else if (SSticker.IsRoundInProgress()) dat += "(Force Next Latejoin Ruleset)
" From d7c0834794bfe0a2c8da8fe6f6122c8d668426aa Mon Sep 17 00:00:00 2001 From: Putnam Date: Sat, 25 Apr 2020 17:22:12 -0700 Subject: [PATCH 4/7] A couple important comments. --- code/game/gamemodes/dynamic/dynamic.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/gamemodes/dynamic/dynamic.dm b/code/game/gamemodes/dynamic/dynamic.dm index 039452af46..42a60afe66 100644 --- a/code/game/gamemodes/dynamic/dynamic.dm +++ b/code/game/gamemodes/dynamic/dynamic.dm @@ -40,10 +40,10 @@ GLOBAL_VAR_INIT(dynamic_stacking_limit, 90) GLOBAL_LIST_EMPTY(dynamic_forced_roundstart_ruleset) // Forced threat level, setting this to zero or higher forces the roundstart threat to the value. GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1) - +// Storyteller picked by the voting. GLOBAL_VAR_INIT(dynamic_storyteller_type, /datum/dynamic_storyteller/classic) - -GLOBAL_VAR_INIT(dynamic_forced_storyteller, 0) +// Storyteller forced by admins during voting--will be used instead of above. +GLOBAL_VAR_INIT(dynamic_forced_storyteller, null) /datum/game_mode/dynamic name = "dynamic mode" From 3da4701dff6f92ebab219114b6aab637ce5dc854 Mon Sep 17 00:00:00 2001 From: Putnam Date: Sat, 25 Apr 2020 23:06:15 -0700 Subject: [PATCH 5/7] Switch roundstart thing to initial. --- code/game/gamemodes/dynamic/dynamic.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/gamemodes/dynamic/dynamic.dm b/code/game/gamemodes/dynamic/dynamic.dm index 42a60afe66..09d5672a1b 100644 --- a/code/game/gamemodes/dynamic/dynamic.dm +++ b/code/game/gamemodes/dynamic/dynamic.dm @@ -253,7 +253,7 @@ GLOBAL_VAR_INIT(dynamic_forced_storyteller, null) /datum/game_mode/dynamic/send_intercept() . = "Central Command Status Summary
" - switch(round(threat_level)) + switch(round(initial_threat_level)) if(0 to 20) . += "Peaceful Waypoint
" . += "Your station orbits deep within controlled, core-sector systems and serves as a waypoint for routine traffic through Nanotrasen's trade empire. Due to the combination of high security, interstellar traffic, and low strategic value, it makes any direct threat of violence unlikely. Your primary enemies will be incompetence and bored crewmen: try to organize team-building events to keep staffers interested and productive. However, even deep in our territory there may be subversive elements, especially for such a high-value target as your station. Keep an eye out, but don't expect much trouble." From 00c2ddce8f75799adede01d4e88d4d357289b255 Mon Sep 17 00:00:00 2001 From: Putnam Date: Sat, 25 Apr 2020 23:18:37 -0700 Subject: [PATCH 6/7] Actually this is better --- code/game/gamemodes/dynamic/dynamic.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/gamemodes/dynamic/dynamic.dm b/code/game/gamemodes/dynamic/dynamic.dm index 09d5672a1b..e6e10941c4 100644 --- a/code/game/gamemodes/dynamic/dynamic.dm +++ b/code/game/gamemodes/dynamic/dynamic.dm @@ -253,8 +253,8 @@ GLOBAL_VAR_INIT(dynamic_forced_storyteller, null) /datum/game_mode/dynamic/send_intercept() . = "Central Command Status Summary
" - switch(round(initial_threat_level)) - if(0 to 20) + switch(round(threat_level)) + if(-INFINITY to 20) . += "Peaceful Waypoint
" . += "Your station orbits deep within controlled, core-sector systems and serves as a waypoint for routine traffic through Nanotrasen's trade empire. Due to the combination of high security, interstellar traffic, and low strategic value, it makes any direct threat of violence unlikely. Your primary enemies will be incompetence and bored crewmen: try to organize team-building events to keep staffers interested and productive. However, even deep in our territory there may be subversive elements, especially for such a high-value target as your station. Keep an eye out, but don't expect much trouble." set_security_level(SEC_LEVEL_GREEN) @@ -286,7 +286,7 @@ GLOBAL_VAR_INIT(dynamic_forced_storyteller, null) . += "Black Orbit
" . += "As part of a mandatory security protocol, we are required to inform you that as a result of your orbital pattern directly behind an astrological body (oriented from our nearest observatory), your station will be under decreased monitoring and support. It is anticipated that your extreme location and decreased surveillance could pose security risks. Avoid unnecessary risks and attempt to keep your station in one piece." set_security_level(SEC_LEVEL_AMBER) - if(96 to 100) + if(96 to INFINITY) . += "Impending Doom
" . += "Your station is somehow in the middle of hostile territory, in clear view of any enemy of the corporation. Your likelihood to survive is low, and station destruction is expected and almost inevitable. Secure any sensitive material and neutralize any enemy you will come across. It is important that you at least try to maintain the station.
" . += "Good luck." From 51c638722405e3c77dd816be827ff83cb418bb86 Mon Sep 17 00:00:00 2001 From: Putnam Date: Sun, 26 Apr 2020 13:44:04 -0700 Subject: [PATCH 7/7] now --- code/modules/admin/admin.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index d84d3eb16b..a2e2b3c122 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -694,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 between dynamic storytellers.") + to_chat(world, "Vote is now 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.")