06-08-2018, 12:22 PM
Posting at ZeWaka's request. Heres some pseudocode for this thing.
Code:
# player_votes is a list of lists.
# player_votes[i] = list of round types the player voted for
# I assume that round types are treated as integers by the game
def select_round_type(player_votes):
distribution = [0.0]*NUM_ROUND_TYPES
if(rand(1,3) == 1):
return old_select_round_type()
else:
for player in player_votes:
vote_weight = 1 / len(player)
for vote in player:
distribution[vote] += vote_weight
round_selector = rand_float(0,len(player_votes))
for i in range(0,NUM_ROUND_TYPES):
if(round_selector <= distribution[i]):
return i
return 0