mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 11:36:24 +01:00
Ranked Choice Voting (#4166)
## About The Pull Request Implements ranked choice voting for storyteller and map vote ## Why It's Good For The Game I can close the secret storyteller PR ## Changelog 🆑 LT3 qol: Ranked choice voting is now available for storyteller and map votes /🆑
This commit is contained in:
@@ -28,7 +28,7 @@ SUBSYSTEM_DEF(map_vote)
|
||||
/datum/controller/subsystem/map_vote/Initialize()
|
||||
if(rustg_file_exists(MAP_VOTE_CACHE_LOCATION))
|
||||
map_vote_cache = json_decode(file2text(MAP_VOTE_CACHE_LOCATION))
|
||||
var/carryover = CONFIG_GET(number/map_vote_tally_carryover_percentage)
|
||||
var/carryover = 0 // BUBBER EDIT CHANGE - Ranked Choice Voting - Original: CONFIG_GET(number/map_vote_tally_carryover_percentage)
|
||||
for(var/map_id in map_vote_cache)
|
||||
map_vote_cache[map_id] = round(map_vote_cache[map_id] * (carryover / 100))
|
||||
sanitize_cache()
|
||||
|
||||
@@ -168,12 +168,12 @@ SUBSYSTEM_DEF(vote)
|
||||
else
|
||||
voted += voter.ckey
|
||||
|
||||
if(current_vote.choices_by_ckey[voter.ckey + their_vote] == 1)
|
||||
current_vote.choices_by_ckey[voter.ckey + their_vote] = 0
|
||||
if(current_vote.choices_by_ckey["[voter.ckey]_[their_vote]"] == 1) // BUBBER EDIT CHANGE - Original: [voter.ckey + their_vote]
|
||||
current_vote.choices_by_ckey["[voter.ckey]_[their_vote]"] = 0 // BUBBER EDIT CHANGE - Original: [voter.ckey + their_vote]
|
||||
current_vote.choices[their_vote]--
|
||||
|
||||
else
|
||||
current_vote.choices_by_ckey[voter.ckey + their_vote] = 1
|
||||
current_vote.choices_by_ckey["[voter.ckey]_[their_vote]"] = 1 // BUBBER EDIT CHANGE - Original: [voter.ckey + their_vote]
|
||||
current_vote.choices[their_vote]++
|
||||
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user