diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2025-01-13 16:53:38 +0000 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2025-01-13 16:53:38 +0000 |
commit | dcbb09f0278e06eaf7fd5d2f31356a08ed8f2a76 (patch) | |
tree | ad49031cd09535069fbe1d8b67ed7cdfc0c33c8a /rules.js | |
parent | d7d9f6890eaf1af9d3a1da2bac6e9f977daa7cc6 (diff) | |
download | 1989-dawn-of-freedom-dcbb09f0278e06eaf7fd5d2f31356a08ed8f2a76.tar.gz |
Reset valid_cards after cards recovered from discard
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -3619,6 +3619,12 @@ function end_round() { // Check for duplicate card entries let card_check + console.log('game.strategy_deck', game.strategy_deck) + console.log('game.strategy_discard', game.strategy_discard) + console.log('game.strategy_removed', game.strategy_removed) + console.log('game.persistent_events', game.persistent_events) + console.log('game.communist_hand', game.communist_hand) + console.log('game.democrat_hand', game.democrat_hand) if (game.samizdat_card > 0) { card_check = [...game.strategy_deck, ...game.strategy_discard, ...game.strategy_removed, ...game.persistent_events, ...game.communist_hand, ... game.democrat_hand, game.samizdat_card] } else { @@ -3643,6 +3649,8 @@ function end_round() { } } else if (game.turn <= 7) { if (card_check.length !== 81) { + console.log('card_check.length', card_check.length) + console.log('cards in game', card_check ) throw new Error(`Wrong number of cards: ${card_check.length}`) } } else if (card_check.length !== 110) { @@ -5346,6 +5354,7 @@ function vm_inflationary_currency_discard() { } } } + log(`${game.active}:`) game.state = 'vm_inflationary_currency_discard' } @@ -6595,7 +6604,10 @@ states.vm_play_event_from_discard = { }, card(card) { push_undo() - log(`Chose C${card}.`) + if (game.active === game.round_player) + log(`Chose C${card}.`) + else + log(`${game.active} chose C${card}.`) game.vm_event = card game.vm_available_ops = cards[card].ops game.discard = false @@ -6604,6 +6616,7 @@ states.vm_play_event_from_discard = { } if (!scoring_cards.includes(card)) log_event(card) + game.valid_cards = [] goto_vm(card) }, pass() { @@ -6613,6 +6626,7 @@ states.vm_play_event_from_discard = { } else { log('Did not choose a card.') } + game.valid_cards = [] vm_next() }, } |