summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-01-04 16:50:23 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-08 16:36:48 +0100
commit3953c85dc7d7eb4d4cc0d29cb7c0e7355ed8f56f (patch)
tree98df77c2c6912f298cee0ccae0408927c7cc0e54 /rules.js
parentef78c9bf5a40b8be033a4479a60261da743feeec (diff)
downloadtable-battles-3953c85dc7d7eb4d4cc0d29cb7c0e7355ed8f56f.tar.gz
Fix S41 Prince Eugene stick shifting check.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/rules.js b/rules.js
index 01270f3..a5ab23f 100644
--- a/rules.js
+++ b/rules.js
@@ -1832,6 +1832,15 @@ function side_get_wild_die_card(p) {
return -1
}
+function has_any_red_normal_cards() {
+ for (let c of game.front[0])
+ if (data.cards[c].wing === RED && !data.cards[c].special)
+ return true
+ for (let c of game.front[1])
+ if (data.cards[c].wing === RED && !data.cards[c].special)
+ return true
+}
+
function side_has_wild_die(p) {
return side_get_wild_die_card(p) >= 0
}
@@ -2065,7 +2074,7 @@ function can_take_any_action() {
if (game.scenario === S41_BLENHEIM_SCENARIO) {
if (player_index() === 0) {
- if (has_any_dice_on_card(S41_PRINCE_EUGENE))
+ if (has_any_dice_on_card(S41_PRINCE_EUGENE) && has_any_red_normal_cards())
return true
}
}
@@ -2229,7 +2238,7 @@ states.action = {
if (game.scenario === S41_BLENHEIM_SCENARIO) {
if (player_index() === 0) {
- if (has_any_dice_on_card(S41_PRINCE_EUGENE))
+ if (has_any_dice_on_card(S41_PRINCE_EUGENE) && has_any_red_normal_cards())
gen_action_card(S41_PRINCE_EUGENE)
}
}