From c6928522ceef8da847d005942da4479b340a4851 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 7 Oct 2024 17:18:05 +0100 Subject: Stasi updates --- rules.js | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 870c061..a073d27 100644 --- a/rules.js +++ b/rules.js @@ -264,18 +264,18 @@ exports.view = function(state, player) { // === ACTIONS =========== function gen_action(action, argument) { -console.log('gen_action called with ', action, ' and ', argument) +//console.log('gen_action called with ', action, ' and ', argument) if (argument === undefined) { - console.log('argument undefined') + //console.log('argument undefined') view.actions[action] = 1 } else { if (!(action in view.actions)) { - console.log('push argument') + //console.log('push argument') view.actions[action] = [] } view.actions[action].push(argument) } - console.log('view.actions: ', view.actions, 'view.actions[action]: ', view.actions[action]) + //console.log('view.actions: ', view.actions, 'view.actions[action]: ', view.actions[action]) } function gen_action_infl(space){ @@ -2267,11 +2267,11 @@ states.stasi_play_card = { //Check if Player has Common European Home in hand if (game.active === DEM) { - if (game.democrat_hand.includes(21) && cards[card].side === "C") { + if (game.democrat_hand.includes(21) && cards[card].side === "C" && card !== 21) { gen_action('card_ceh', card) } } else { - if (game.communist_hand.includes(21) && cards[card].side === "D") { + if (game.communist_hand.includes(21) && cards[card].side === "D" && card !== 21) { gen_action('card_ceh', card) } } @@ -2297,15 +2297,17 @@ states.stasi_play_card = { //Continue with normal logic - //Check if it is a card with an event which is always playable + //Check if it is a card with an event which is always playable. May not play Common European Home for event in Stasi - if (cards[card].playable) { + if (cards[card].playable && card !== 21) { + console.log('get events called normally for card', card) get_events(card) } - // Resolve cards with variable events (not Reformer) + // Resolve cards with variable events (not Reformer, not Common European Home in Stasi) - if (card !== 67 && game.playable_cards.includes(card)) { + if (card !== 67 && card !== 21 && game.playable_cards.includes(card)) { + console.log('get events called variable for card', card) get_events(card) } /* if ((game.active === DEM && cards[game.played_card].side === 'D' && game.playable_cards[game.played_card].playable === 1) || (game.active === COM && cards[game.played_card].side === 'C' && game.playable_cards[game.played_card].playable ===1) || (cards[game.played_card].side === 'N'&& game.playable_cards[game.played_card].playable ===1)) { @@ -2848,12 +2850,12 @@ function valid_spaces_sc() { if (game.active === DEM) { infl = game.comInfl[i] - //if (infl !== 0 ) { + if (infl !== 0 ) { valid_spaces_set.add(space.space_id); - //} + } } else { infl = game.demInfl[i] - //if (infl !== 0 ) { + if (infl !== 0 ) { // Check Solidarity Legalised if (game.persistent_events.includes(2) && space.space_id === 14) {continue} @@ -2869,7 +2871,7 @@ function valid_spaces_sc() { valid_spaces_set.add(space.space_id); } - //} + } } } @@ -3758,6 +3760,7 @@ function end_round() { next_player() } else { log_h3('Democratic Action Round') + log_h3('C13') } if (game.democrat_hand.includes(game.stasi_card)) { game.state = 'stasi_play_card' -- cgit v1.2.3