diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-25 13:14:16 +0100 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-25 13:14:16 +0100 |
commit | a8874fde796f8fa563a8a80aa429f3a7c40eec44 (patch) | |
tree | e37331f91de4a6d43a0236afa121e2d38435d702 | |
parent | 7b2084f413b19f3d2bcea32261d29a766ff49b70 (diff) | |
download | 1989-dawn-of-freedom-a8874fde796f8fa563a8a80aa429f3a7c40eec44.tar.gz |
Added power_card action
-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=[] |