From 3970b0c8aa7f2a91bde5c2e1cb93bcc1e077d246 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 30 Nov 2024 08:30:14 +0000 Subject: Split General Strike in two states for prompt --- rules.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/rules.js b/rules.js index b97db43..4a7b883 100644 --- a/rules.js +++ b/rules.js @@ -1891,15 +1891,10 @@ states.game_over = { states.general_strike = { inactive: 'discard a card', prompt() { - if (game.played_card === 0) { - view.prompt = 'General Strike: You must discard a card or play a Scoring Card.' - game.communist_hand - for (let card of game.communist_hand) { - gen_action_card(card) - } - } else if (game.played_card > 0) { - view.prompt = 'General Strike: Roll a die.' - gen_action('roll') + view.prompt = 'General Strike: You must discard a card or play a Scoring Card.' + game.communist_hand + for (let card of game.communist_hand) { + gen_action_card(card) } }, card(card) { @@ -1911,12 +1906,21 @@ states.general_strike = { if (scoring_cards.includes(card)) { game.vm_event = card log(`Played C${card} for the event`) - game.return_state = 'general_strike' + game.return_state = 'end_round' goto_vm(game.vm_event) } else { log(`Discarded C${card}`) + game.state = 'general_strike_roll' } }, +} + +states.general_strike_roll = { + inactive: 'discard a card', + prompt() { + view.prompt = 'General Strike: Roll a die.' + gen_action('roll') + }, roll() { clear_undo() let roll = roll_d6() @@ -1924,7 +1928,6 @@ states.general_strike = { logi(`+${game.available_ops} ops`) let total = roll + game.available_ops log(`Modified roll: ${total}`) - if (total > 5) { log('The strike is over') permanently_remove(C_GENERAL_STRIKE) @@ -1936,6 +1939,7 @@ states.general_strike = { }, } + states.honecker = { inactive: 'resolve Honecker', prompt() { -- cgit v1.2.3