summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-09-24 13:58:30 +0100
committeriainp5 <iain.pearce.ip@gmail.com>2024-09-24 13:58:30 +0100
commita61971dc826fb451e5b72d52d345a048166b3e52 (patch)
treec523d907fc210d45581b83a1474c6d710deeabf4 /rules.js
parent35521c5cf5b70a5ddfa9d420ab0d3235e6fd566d (diff)
download1989-dawn-of-freedom-a61971dc826fb451e5b72d52d345a048166b3e52.tar.gz
Fix prudence
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js33
1 files changed, 20 insertions, 13 deletions
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) {