summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-10-06 11:52:46 +0100
committeriainp5 <iain.pearce.ip@gmail.com>2024-10-06 11:52:46 +0100
commitb283e3c47b5235dd99291612600014c72f35032e (patch)
tree77e41b7b4ceba9db7fa5ae85db4279d995b30050 /rules.js
parente4cf9f359261b1fc2ce24c6f2d668d5700650548 (diff)
download1989-dawn-of-freedom-b283e3c47b5235dd99291612600014c72f35032e.tar.gz
Fix scoring card played through General Strike
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js9
1 files 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];
}