summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-06-05 23:12:32 +0200
committerTor Andersson <tor@ccxvii.net>2024-06-05 23:12:54 +0200
commitbf604c0ad20aa4e158e744a15a321efe7cc78552 (patch)
treea782c30d7af7d079d6416dd29dec7ec0b9b16118
parenteddf155524f44b5437a7028cbf33695a0d449f2c (diff)
downloadfriedrich-bf604c0ad20aa4e158e744a15a321efe7cc78552.tar.gz
prepare obfuscating cards
-rw-r--r--rules.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/rules.js b/rules.js
index 0012843..7036bd1 100644
--- a/rules.js
+++ b/rules.js
@@ -4450,10 +4450,14 @@ function mask_troops(player) {
function mask_hand(player) {
let view_hand = []
for (let pow of all_powers) {
- if (player_from_power(pow) === player)
+ if (player_from_power(pow) === player) {
view_hand[pow] = game.hand[pow]
- else
+ } else {
view_hand[pow] = game.hand[pow].map(c => c & ~127)
+ // TODO: obfuscate number of cards in hand
+ // view_hand[pow] = Math.ceil(game.hand[pow].length / 3) * 3
+ // view_hand[pow] = Math.ceil(game.hand[pow].length / 5)
+ }
}
return view_hand
}