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:
LT3
2025-07-02 16:14:40 -07:00
committed by GitHub
parent efc69c608a
commit 30bd96e37e
18 changed files with 550 additions and 27 deletions
+1 -1
View File
@@ -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()
+3 -3
View File
@@ -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