From 081df302f54a31d0e6bab5b0eece86ab8a960b42 Mon Sep 17 00:00:00 2001 From: Incoming Date: Tue, 24 Feb 2015 18:17:07 -0500 Subject: [PATCH] Makes the "are too many people dead for this to be fun?" check more indicative of people who are actually playing Adds a new toggle: Midround_antagonist that allows players to opt out of gaining antagonist through this system if they'd prefer. It defaults to on but is newbie safe because without any antagonist flags (which default to off), it won't place players into antagonist slots. --- code/__DEFINES/preferences.dm | 5 +++-- code/game/gamemodes/game_mode.dm | 9 +++++---- code/modules/client/preferences.dm | 6 +++++- code/modules/client/preferences_toggles.dm | 9 +++++++++ html/changelogs/Incoming5643 - muliganrounds.yml | 3 ++- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm index a8b240c4743..7b121f3f458 100644 --- a/code/__DEFINES/preferences.dm +++ b/code/__DEFINES/preferences.dm @@ -14,8 +14,9 @@ #define CHAT_PULLR 2048 #define INTENT_STYLE 4096 #define CHAT_GHOSTWHISPER 8192 +#define MIDROUND_ANTAG 16384 -#define TOGGLES_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|MEMBER_PUBLIC|CHAT_PULLR|INTENT_STYLE|CHAT_GHOSTWHISPER) +#define TOGGLES_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|MEMBER_PUBLIC|CHAT_PULLR|INTENT_STYLE|CHAT_GHOSTWHISPER|MIDROUND_ANTAG) #define BE_TRAITOR 1 #define BE_OPERATIVE 2 @@ -29,4 +30,4 @@ #define BE_BLOB 512 #define BE_NINJA 1024 #define BE_MONKEY 2048 -#define BE_GANG 4096 +#define BE_GANG 4096 diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index e088c12f6b2..9a33b85fc8e 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -110,16 +110,17 @@ var/list/living_crew = list() - for(var/mob in player_list) - if(mob in living_mob_list) + for(var/mob/mob in player_list) + if(mob in living_mob_list && mob.ckey in joined_player_list) living_crew += mob - if(living_crew.len / player_list.len <= 0.7) //If a lot of the player base died, we start fresh + if(living_crew.len / joined_player_list.len <= 0.7) //If a lot of the player base died, we start fresh return 0 var/list/antag_canadates = list() for(var/mob/living/carbon/human/H in living_crew) - antag_canadates += H + if(H.client && H.client.prefs.allow_midround_antag) + antag_canadates += H if(!antag_canadates) return 1 diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index f22870a8cf8..88939f458f1 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -39,6 +39,7 @@ datum/preferences var/UI_style = "Midnight" var/toggles = TOGGLES_DEFAULT var/ghost_form = "ghost" + var/allow_midround_antag = 1 //character preferences var/real_name //our character's name @@ -226,7 +227,7 @@ datum/preferences dat += "Ghost sight: [(toggles & CHAT_GHOSTSIGHT) ? "Nearest Creatures" : "All Emotes"]
" dat += "Ghost whispers: [(toggles & CHAT_GHOSTWHISPER) ? "Nearest Creatures" : "All Speech"]
" dat += "Pull requests: [(toggles & CHAT_PULLR) ? "Yes" : "No"]
" - + dat += "Midround Antagonist: [(toggles & MIDROUND_ANTAG) ? "Yes" : "No"]
" if(config.allow_Metadata) dat += "OOC Notes: Edit
" @@ -785,6 +786,9 @@ datum/preferences if("pull_requests") toggles ^= CHAT_PULLR + if("allow_midround_antag") + toggles ^= MIDROUND_ANTAG + if("save") save_preferences() save_character() diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index 3f35026c7be..fbcdf5d6f66 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -73,6 +73,15 @@ src << "You will [(prefs.toggles & CHAT_PULLR) ? "now" : "no longer"] see new pull request announcements." feedback_add_details("admin_verb","TPullR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +/client/verb/togglemidroundantag() + set name = "Toggle Midround Antagonist" + set category = "Preferences" + set desc = "Toggles whether or not you will be considered for antagonist status given during a round." + prefs.toggles ^= MIDROUND_ANTAG + prefs.save_preferences() + src << "You will [(prefs.toggles & MIDROUND_ANTAG) ? "now" : "no longer"] be considered for midround antagonist positions." + feedback_add_details("admin_verb","TMidroundA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + /client/verb/toggletitlemusic() set name = "Hear/Silence LobbyMusic" set category = "Preferences" diff --git a/html/changelogs/Incoming5643 - muliganrounds.yml b/html/changelogs/Incoming5643 - muliganrounds.yml index d0c811df898..7e0056e3420 100644 --- a/html/changelogs/Incoming5643 - muliganrounds.yml +++ b/html/changelogs/Incoming5643 - muliganrounds.yml @@ -3,4 +3,5 @@ delete-after: True changes: - - rscadd: "On servers where malfunction, wizard, and blob rounds do not end with the death of the primary antagonist, new antagonists from traitor and changeling derivative modes will now sometimes spawn. This depends on the state of the station, the state of the crew, and the server's gamemode probabilities. Server owners should consider revising their configuration choices" \ No newline at end of file + - rscadd: "On servers where malfunction, wizard, and blob rounds do not end with the death of the primary antagonist, new antagonists from traitor and changeling derivative modes will now sometimes spawn. This depends on the state of the station, the state of the crew, and the server's gamemode probabilities. Server owners should consider revising their configuration choices" + - rscdel: "If you would like to opt out of this midround chance, a new toggle to disable it can be found in your preferences" \ No newline at end of file