diff options
-rw-r--r-- | play.js | 5 | ||||
-rw-r--r-- | rules.js | 18 |
2 files changed, 16 insertions, 7 deletions
@@ -206,6 +206,11 @@ function on_click_card(evt) { evt.stopPropagation(); } } + if (is_action('power_card', card)) { + if (send_action('power_card', card)) { + evt.stopPropagation(); + } + } } } @@ -290,6 +290,10 @@ function gen_action_card(card){ gen_action("card", card) } +function gen_action_power_card(card){ + gen_action("power_card", card) +} + function gen_action_sc(space){ gen_action("sc", space) } @@ -1280,11 +1284,11 @@ states.raise_stakes_1 = { gen_action('pass') } for (let card of game.valid_cards) { - gen_action_card(card) + gen_action_power_card(card) } } }, - card(card) { + power_card(card) { push_undo() if (numberless_cards.includes(card)) { log(`Discarded: P${card}`) @@ -1343,11 +1347,11 @@ states.raise_stakes_2 = { gen_action('pass') } for (let card of game.valid_cards) { - gen_action_card(card) + gen_action_power_card(card) } } }, - card(card) { + power_card(card) { push_undo() if (numberless_cards.includes(card)) { log(`Discarded: P${card}`) @@ -1401,7 +1405,7 @@ states.power_struggle = { if (game.valid_cards.length > 0) { view.prompt = "Play a card." for (let card of game.valid_cards) { - gen_action_card(card) + gen_action_power_card(card) } } else if ( game.valid_cards.length === 0) { view.prompt = 'No valid cards. You must concede.' @@ -1413,7 +1417,7 @@ states.power_struggle = { view.prompt = `${power_cards[game.played_power_card].name} played. You must match or concede.` gen_action('concede') for (let card of game.valid_cards) { - gen_action_card(card) + gen_action_power_card(card) } } else if (game.valid_cards.length === 0) { view.prompt = `${power_cards[game.played_power_card].name} played. You must concede.` @@ -1432,7 +1436,7 @@ states.power_struggle = { if (game.tactics_fails !== "Petition") {gen_action('petition')} } }, - card(card) { + power_card(card) { push_undo() discard(card) game.valid_cards=[] |