summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-08 17:26:46 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-08 16:36:47 +0100
commita1a893152ecc1fe0264e3210f89956c6dc7af306 (patch)
tree6a3c3224632a239e25fded5f9faaec93612ed56b
parentb1e1daaa1945ee428aa113e85b2170007da398db (diff)
downloadtable-battles-a1a893152ecc1fe0264e3210f89956c6dc7af306.tar.gz
no place at cube limit
-rw-r--r--rules.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index fbd3c74..5ef9a10 100644
--- a/rules.js
+++ b/rules.js
@@ -557,6 +557,18 @@ function can_place_dice(c) {
if (!pred)
throw Error("bad pattern definition: " + pattern)
+ // At per card limit?
+ if (place_dice_once[pattern]) {
+ if (map_has(game.placed, c))
+ return false
+ }
+
+ // At cube limit?
+ if (data.cards[c].special)
+ if (map_get(game.cubes, c, 0) >= data.cards[c].special)
+ return false
+
+ // At per wing limit?
let wing = data.cards[c].wing
let n_wing = 0
for (let i = 0; i < game.placed.length; i += 2) {
@@ -572,11 +584,6 @@ function can_place_dice(c) {
// TODO: 91A Jackson - may only place dice if D.H. Hill has dice
- if (place_dice_once[pattern]) {
- if (map_has(game.placed, c))
- return false
- }
-
return pred(c)
}