Skip to content

Commit

Permalink
weighting adjustments
Browse files Browse the repository at this point in the history
multi-tiered new player bonus, delayed streak bonus
  • Loading branch information
Doubleumc committed Aug 10, 2024
1 parent 7cc20bb commit 7377d38
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions code/game/jobs/role_authority.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,18 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou
log_debug("ASSIGNMENT: Building weighted_players list.")
var/list/weighted_players = list()
for(var/mob/new_player/cycled_unassigned in unassigned_players)
//1 base weight + 1 for new players + 1/per missed round
var/weight = 1 + (cycled_unassigned.client.get_total_human_playtime() < 5 HOURS) + get_client_stat(cycled_unassigned.client, PLAYER_STAT_UNASSIGNED_ROUND_STREAK)
weighted_players[cycled_unassigned] = weight
var/base_weight = 1 //baseline weighting

var/new_bonus = 0
switch(cycled_unassigned.client.get_total_human_playtime()) //+1 for new players, +2 for really new players
if(0 to 2 HOURS)
new_bonus = 2
if(2 HOURS to 5 HOURS)
new_bonus = 1

var/streak_bonus = max(get_client_stat(cycled_unassigned.client, PLAYER_STAT_UNASSIGNED_ROUND_STREAK) - 2, 0) //+1 per missed round after 2

weighted_players[cycled_unassigned] = base_weight + new_bonus + streak_bonus

log_debug("ASSIGNMENT: Weighted shuffling unassigned_players list.")
unassigned_players.Cut()
Expand Down

0 comments on commit 7377d38

Please sign in to comment.