From a61971dc826fb451e5b72d52d345a048166b3e52 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 24 Sep 2024 13:58:30 +0100 Subject: Fix prudence --- rules.js | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 051167e..b50ecad 100644 --- a/rules.js +++ b/rules.js @@ -456,6 +456,7 @@ states.choose_card = { game.available_ops ++ } + console.log('prudence:', game.persistent_events['prudence']) if ((game.active === DEM && game.persistent_events['prudence'].DEM !== 0)) { if (game.available_ops > 1) { log(`${pluralize(game.persistent_events['prudence'].DEM,' op')} from C8`) @@ -468,7 +469,7 @@ states.choose_card = { if (game.active === COM && game.persistent_events['prudence'].COM !== 0) { if (game.available_ops > 1) { - log(`${pluralize(game.persistent_events['prudence'].DEM,' op')} from C8`) + log(`${pluralize(game.persistent_events['prudence'].COM,' op')} from C8`) game.available_ops += game.persistent_events['prudence'].COM if (game.available_ops < 1) { game.available_ops = 1 @@ -2197,8 +2198,8 @@ function do_sc(space) { // Check for the Crowd Turns Against Ceausescu else if (game.is_pwr_struggle) { - roll += game.temp - log(`+${game.temp} from Ceausescu`) + roll += game.vm_available_ops + log(`+${game.vm_available_ops} from Ceausescu`) } // Check if in Tiananmen Square Track Award @@ -2208,33 +2209,39 @@ function do_sc(space) { log('+2 from Tiananmen Square Track award') } else { + let modifier = 0 let card_ops = cards[game.played_card].ops + + // Start with base value of card + log(`+${card_ops} from card`) + + //Check for events which modify card ops // Check for Perestoika if (game.active === COM && game.persistent_events['perestroika']) { log(`+1 from C25`) - card_ops++ + modifier++ } // Check for Sinatra Doctrine if (game.active === DEM && game.persistent_events['sinatra_doctrine']) { log(`+1 from C50`) - card_ops++ + modifier++ } // Check for Prudence if (game.active === DEM && game.persistent_events['prudence'].DEM !== 0) { log(`${pluralize(game.persistent_events['prudence'].DEM, ' op')} from C8`) - card_ops += game.persistent_events['prudence'].DEM + modifier += game.persistent_events['prudence'].DEM } if (game.active === COM && game.persistent_events['prudence'].COM !== 0) { log(`${pluralize(game.persistent_events['prudence'].COM, ' op')} from C8`) - card_ops += game.persistent_events['prudence'].COM + modifier += game.persistent_events['prudence'].COM } - - //Check card ops is not less than 1 - if (card_ops < 1) { - card_ops = 1 + let modified_ops = card_ops + modifier + //Check modified card ops is not less than 1 + if ((modified_ops) < 1) { + modified_ops = 1 } - roll += card_ops - log(`+${card_ops} from card ops`) + roll += modified_ops + //log(`+${card_ops} from card ops`) } if (game.support_check_modifier > 0) { -- cgit v1.2.3