From d05c2426a813993a5df913a3527ff71cac1c415c Mon Sep 17 00:00:00 2001 From: Putnam Date: Thu, 6 Feb 2020 15:47:04 -0800 Subject: [PATCH] Added a config for map voting types. --- code/controllers/configuration/entries/general.dm | 3 +++ code/controllers/subsystem/ticker.dm | 10 +++++++++- config/config.txt | 9 +++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index c3ae90cc1b..2e5b8a1852 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -267,6 +267,9 @@ /datum/config_entry/flag/tgstyle_maprotation +/datum/config_entry/string/map_vote_type + config_entry_value = "SCORE" + /datum/config_entry/number/maprotatechancedelta config_entry_value = 0.75 min_val = 0 diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index ceb003210e..f0c9e3499c 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -477,7 +477,15 @@ SUBSYSTEM_DEF(ticker) if(CONFIG_GET(flag/tgstyle_maprotation)) INVOKE_ASYNC(SSmapping, /datum/controller/subsystem/mapping/.proc/maprotate) else - SSvote.initiate_vote("map","server",TRUE) + switch(CONFIG_GET(string/map_vote_type)) + if("PLURALITY") + SSvote.initiate_vote("map","server",TRUE) + else if("APPROVAL") + SSvote.initiate_vote("map","server",TRUE,votesystem = APPROVAL_VOTING) + else if("IRV") + SSvote.initiate_vote("map","server",TRUE,votesystem = INSTANT_RUNOFF_VOTING) + else if("SCORE") + SSvote.initiate_vote("map","server",TRUE,votesystem = MAJORITY_JUDGEMENT_VOTING) /datum/controller/subsystem/ticker/proc/HasRoundStarted() return current_state >= GAME_STATE_PLAYING diff --git a/config/config.txt b/config/config.txt index 6d302a5512..4d8dcfb00c 100644 --- a/config/config.txt +++ b/config/config.txt @@ -384,6 +384,15 @@ MAPROTATION ## When it's set to zero, the map will be randomly picked each round ALLOW_MAP_VOTING 1 +## Map voting type +## Determines what kind of vote the map vote is +## Options are: +## PLURALITY (default, only vote for one option) +## APPROVAL (can vote for as many as you want), I +## IRV (vote by ranked choice, winner determined by instant runoff algorithm) +## SCORE (give individual rankings of each choice, winner determined by majority judgement algorithm) +MAP_VOTE_TYPE SCORE + ## Map rotate chance delta ## This is the chance of map rotation factored to the round length. ## A value of 1 would mean the map rotation chance is the round length in minutes (hour long round == 60% rotation chance)