diff options
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -2540,7 +2540,27 @@ function end_re_enter_train() { function goto_winter_turn() { - // TODO: winter scoring + // record winter scores + for (let pow of all_major_powers) + game.score[pow].push(count_vp_markers_in_pool(pow)) + + if (game.turn === 16) { + log("Winter Scores") + let best_score = 1000 + let best_power = -1 + for (let pow of all_major_powers) { + log(">" + power_name[pow] + " " + game.score[pow].join(", ")) + let total = 0 + for (let n of game.score[pow]) + total += n + if (total <= best_score) { + best_score = total + best_power = pow + } + } + goto_game_over(player_from_power(best_power), power_name[best] + " won!") + return + } game.stage = 0 goto_winter_stage() @@ -4857,6 +4877,7 @@ exports.setup = function (seed, _scenario, _options) { turn: 0, stage: 0, + score: [ [], [], [], [] ], // winter scores vp: [ 0, 0, 0, 0, 0, 0 ], // battle victory points, set-aside VP saxony: 2, // political track russia: 6, // political track |