summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index f5d8a2d..ca3a5f5 100644
--- a/rules.js
+++ b/rules.js
@@ -555,7 +555,7 @@ function is_routed(c) {
function card_has_attack_with_valid_target(c) {
for (let a of data.cards[c].actions) {
if (a.type === "Attack") {
- let attack_reserve = card_has_rule("attack_reserve")
+ let attack_reserve = card_has_rule(c, "attack_reserve")
for (let t of a.target_list) {
if (is_card_in_play(t))
return true
@@ -1450,6 +1450,13 @@ function check_dice_requirement(c, req, wild) {
}
}
+function card_has_any_actions(c) {
+ for (let a of data.cards[c].actions)
+ if (is_action(c, a))
+ return true
+ return false
+}
+
function is_action(c, a) {
return (a.type === "Bombard" || a.type === "Attack" || a.type === "Command")
}
@@ -1506,10 +1513,12 @@ function can_take_action(c, a) {
function can_take_any_action() {
let p = player_index()
for (let c of game.front[p]) {
- if (has_any_dice_on_card(c))
- return true
- if (has_any_cubes_on_card(c)) // TODO: check requirements!
- return true
+ if (card_has_any_actions(c)) {
+ if (has_any_dice_on_card(c))
+ return true
+ if (has_any_cubes_on_card(c)) // TODO: check requirements!
+ return true
+ }
}
return false
}