From b283e3c47b5235dd99291612600014c72f35032e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 6 Oct 2024 11:52:46 +0100 Subject: Fix scoring card played through General Strike --- rules.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index b9f1610..6ded040 100644 --- a/rules.js +++ b/rules.js @@ -1894,9 +1894,10 @@ states.general_strike = { game.communist_hand.splice(find_card, 1) game.available_ops = get_card_ops(card) if (scoring_cards.includes(card)) { + game.vm_event = card log(`Played C${card} for the event`) game.return_state = 'general_strike' - goto_vm(card) + goto_vm(game.vm_event) } else { log(`Discarded C${cards[card].number}`) } @@ -3678,7 +3679,7 @@ function draw_deck(deck) { function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_hand_limit) { //console.log('game.valid_cards at start of draw cards: ', game.valid_cards) let turn = 'communist'; // Start with the communist player - console.log('game.strategy_deck', game.strategy_deck) + //console.log('game.strategy_deck', game.strategy_deck) console.log('deck', deck, 'democrat_hand', democrat_hand, 'communist_hand', communist_hand, 'dem_hand_limit', dem_hand_limit, 'com_hand_limit', com_hand_limit) while (democrat_hand.length < dem_hand_limit || communist_hand.length < com_hand_limit) { //console.log('deck.length: ', deck.length) @@ -3714,7 +3715,7 @@ function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_han function draw_card(deck) { //console.log('draw card called with:', deck) - console.log('game.strategy_deck before', game.strategy_deck) + //console.log('game.strategy_deck before', game.strategy_deck) if (deck.length === 0) { log_h3('--- Reshuffle ---') @@ -3723,7 +3724,7 @@ function draw_card(deck) { } const randomIndex = Math.floor(Math.random() * deck.length) //console.log('card chosen:', randomIndex) - console.log('game.strategy_deck after', game.strategy_deck) + //console.log('game.strategy_deck after', game.strategy_deck) return deck.splice(randomIndex, 1)[0]; } -- cgit v1.2.3