diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-12-20 08:18:12 +0000 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-12-20 08:18:12 +0000 |
commit | 608e5d9744a2ec9024977895579d81a3581b9b04 (patch) | |
tree | 47dbcd6a991fccf67ee1b9354bae228518b1df7f | |
parent | 569fa9e276b0941e586494fc8bc83487af5e6a81 (diff) | |
download | 1989-dawn-of-freedom-608e5d9744a2ec9024977895579d81a3581b9b04.tar.gz |
Fix General Strike with no cards in hand
-rw-r--r-- | rules.js | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -1933,10 +1933,15 @@ states.game_over = { states.general_strike = { inactive: 'discard a card', prompt() { - 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) + if (game.communist_hand.length === 0) { + view.prompt = 'General Strike: No cards remaining. You must pass.' + gen_action('pass') + } else { + 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) { @@ -1953,6 +1958,10 @@ states.general_strike = { game.state = 'general_strike_roll' } }, + pass() { + log("No cards to discard.") + game.state = 'end_round' + } } states.general_strike_roll = { @@ -1992,11 +2001,12 @@ states.honecker = { extra() { push_undo() game.round++ - log_gap(`Communist chooses to take an extra Action Round due to C${C_HONECKER}`) + log_gap(`Communist chooses to take an extra Action Round due to C${C_HONECKER}.`) log_round() game.round_player = COM permanently_remove(C_HONECKER) if (game.persistent_events.includes(C_GENERAL_STRIKE)) { + log('.cC' + C_GENERAL_STRIKE) game.state = 'general_strike' } else { game.state = 'choose_card' |