Add support for up to 6 players.
This commit is contained in:
+9
-2
@@ -247,11 +247,18 @@ func immediateWeight(v *game.View) float64 {
|
||||
if v.MaxRounds > 1 {
|
||||
w += 0.60 * float64(v.Round-1) / float64(v.MaxRounds-1)
|
||||
}
|
||||
me := v.Players[v.YouSeat]
|
||||
// How far behind the field the bot is. The yardstick is whoever is leading,
|
||||
// not the sum of everyone — at a six-player table the title is a race
|
||||
// against the front-runner, and summing would swamp the round term.
|
||||
me := v.PlayerView(v.YouSeat)
|
||||
best := 0
|
||||
for _, p := range v.Players {
|
||||
if p.Seat != v.YouSeat {
|
||||
w += 0.08 * float64(p.Trophies-me.Trophies)
|
||||
best = max(best, p.Trophies)
|
||||
}
|
||||
}
|
||||
if me != nil {
|
||||
w += 0.08 * float64(best-me.Trophies)
|
||||
}
|
||||
return min(max(w, 0.25), 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user