diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-01-24 16:04:42 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 13:02:39 +0100 |
commit | f0571073f874a5f7e10f4a7797f9d61c201802f4 (patch) | |
tree | a6e7fb410a0c8fa1ea2a21b11bd09452923cfa6c /rules.js | |
parent | 95d14a958d55996f6762f24204e1373f11c1edf7 (diff) | |
download | nevsky-f0571073f874a5f7e10f4a7797f9d61c201802f4.tar.gz |
Only show "Capability" button if there are capabilities available.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -3427,7 +3427,8 @@ states.levy_muster_lord = { view.actions.take_sled = 1 // Add Capability - view.actions.capability = 1 + if (can_muster_capability()) + view.actions.capability = 1 } view.actions.done = 1 @@ -3623,6 +3624,24 @@ function discard_lord_capability(lord, c) { throw new Error("capability not found") } +function can_muster_capability() { + let deck = list_deck() + for (let c of deck) { + if (is_no_event_card(c)) + continue + if (!data.cards[c].lords || set_has(data.cards[c].lords, game.who)) { + if (data.cards[c].this_lord) { + if (!lord_already_has_capability(game.who, c)) + return true + } else { + if (can_deploy_global_capability(c)) + return true + } + } + } + return false +} + states.muster_capability = { inactive: "Levy", prompt() { |