diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-12-22 14:19:06 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-16 19:12:55 +0100 |
commit | d1751348db8c1ac84ff8a5a40be33f5ee1903cb1 (patch) | |
tree | 500d503a1e97f447dd6c8311e996bd2828012a71 /rules.js | |
parent | 5bb07871bd206a461a9be2c4b7744a5ef4026a63 (diff) | |
download | richard-iii-d1751348db8c1ac84ff8a5a40be33f5ee1903cb1.tar.gz |
Show card backs when observing the block games.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -3413,6 +3413,13 @@ exports.resign = function (state, current) { return state; } +function observer_hand() { + let hand = []; + hand.length = Math.max(game.l_hand.length, game.y_hand.length); + hand.fill(0); + return hand; +} + exports.view = function(state, current) { game = state; @@ -3424,7 +3431,7 @@ exports.view = function(state, current) { pretender: game.pretender, l_card: (game.show_cards || current === LANCASTER) ? game.l_card : 0, y_card: (game.show_cards || current === YORK) ? game.y_card : 0, - hand: (current === LANCASTER) ? game.l_hand : (current === YORK) ? game.y_hand : [], + hand: (current === LANCASTER) ? game.l_hand : (current === YORK) ? game.y_hand : observer_hand(), who: (game.active === current) ? game.who : null, where: game.where, known: {}, |