diff options
author | Frans Bongers <fransbongers@franss-mbp.home> | 2025-01-24 21:34:47 +0100 |
---|---|---|
committer | Frans Bongers <fransbongers@franss-mbp.home> | 2025-01-24 21:34:47 +0100 |
commit | 32c5d3a4b5bd208ba620ea336bc4b35835cf391b (patch) | |
tree | 9a2c8f9a2823f3097a0bf1fb44e1e349ee6d76f2 /rules.ts | |
parent | fe446f34e98f87dfc8e7bdce27b082b50a81a9ff (diff) | |
download | land-and-freedom-32c5d3a4b5bd208ba620ea336bc4b35835cf391b.tar.gz |
Disable button if icon cannot be resolved
Diffstat (limited to 'rules.ts')
-rw-r--r-- | rules.ts | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -749,6 +749,13 @@ function start_turn() { // region STATES +function player_can_resolve_icon(icon: Icon): boolean { + if (icon === 'teamwork_on' && game.bonuses[TEAMWORK_BONUS] === ON) { + return false; + } + return true; +} + states.activate_icon = { inactive: 'activate an icon', prompt() { @@ -757,6 +764,9 @@ states.activate_icon = { const c = cards[game.played_card] as PlayerCard; for (const i of c.icons) { gen_action(i); + if (!player_can_resolve_icon(i)) { + view.actions[i] = 0; + } } }, spend_hp() { |