Added a config for map voting types.

This commit is contained in:
Putnam
2020-02-06 15:47:04 -08:00
parent 5123c6b455
commit d05c2426a8
3 changed files with 21 additions and 1 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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)