diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-05-20 15:35:08 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 12:31:29 +0100 |
commit | abf5794c115ac17eb302aef66eee7b3853096b43 (patch) | |
tree | cd16633fe7f3f7f1015bee1980840b5ccc24f540 | |
parent | 896829d0498ee43d24d394b1edc7ec1f1ae606dc (diff) | |
download | pax-pamir-abf5794c115ac17eb302aef66eee7b3853096b43.tar.gz |
Show deck count and number of dominance checks remaining.
-rw-r--r-- | rules.js | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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, }; |