From a8874fde796f8fa563a8a80aa429f3a7c40eec44 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 25 Oct 2024 13:14:16 +0100 Subject: Added power_card action --- rules.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 44bbef6..0d0dcc3 100644 --- a/rules.js +++ b/rules.js @@ -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=[] -- cgit v1.2.3