From abf5794c115ac17eb302aef66eee7b3853096b43 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 20 May 2022 15:35:08 +0200 Subject: Show deck count and number of dominance checks remaining. --- rules.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rules.js b/rules.js index 601b431..42aed83 100644 --- a/rules.js +++ b/rules.js @@ -2777,6 +2777,18 @@ function assign_vp(points, score, sorted) { } } +function count_dominance_cards() { + let n = 0; + for (let row = 0; row < 2; ++row) + for (let col = 0; col < 6; ++col) + if (is_dominance_check(game.market_cards[row][col])) + ++n; + for (let i = 0; i < game.deck.length; ++i) + if (is_dominance_check(game.deck[i])) + ++n; + return n; +} + function is_final_dominance_check() { for (let row = 0; row < 2; ++row) for (let col = 0; col < 6; ++col) @@ -3076,6 +3088,7 @@ exports.view = function(state, current) { market_coins: game.market_coins, players: game.players, selected: game.selected, + cards: [ game.deck.length, count_dominance_cards() ], open: game.open, }; -- cgit v1.2.3