summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-10-07 20:01:52 +0100
committeriainp5 <iain.pearce.ip@gmail.com>2024-10-07 20:01:52 +0100
commit9e7c1420da9c57f5af27e24ef8a84e7c3cc13116 (patch)
tree5eb5dacc5242504c5b966e7faf13176ca0ba46b2 /rules.js
parent1723023768ca11179bd4d0235ab0a4b01d12d5f9 (diff)
download1989-dawn-of-freedom-9e7c1420da9c57f5af27e24ef8a84e7c3cc13116.tar.gz
Fix for Sinatra/Peretroika in TST award
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js88
1 files changed, 56 insertions, 32 deletions
diff --git a/rules.js b/rules.js
index 3e13e98..1511719 100644
--- a/rules.js
+++ b/rules.js
@@ -686,6 +686,7 @@ states.resolve_opponent_event = {
},
tst_7() {
push_undo()
+ log('Event cancelled using Tiananmen Square Track Award')
game.tst_7 = true
game.vm_event_to_do = false
},
@@ -2318,42 +2319,14 @@ function do_sc(space) {
// Check if in Tiananmen Square Track Award
else if (game.state === 'vm_tst_6_sc') {
+ roll += get_tst_6_ops()
roll += 2
log('+2 from Tiananmen Square Track award')
}
else {
//let modifier = 0
let card_ops = get_card_ops(this_card())
-/*
- // 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.includes(25)) {
- log(`+1 from C25`)
- modifier++
- }
- // Check for Sinatra Doctrine
- if (game.active === DEM && game.persistent_events.includes(50)) {
- log(`+1 from C50`)
- modifier++
- }
- // Check for Prudence
- if (game.active === DEM && game.prudence && game.prudence.DEM < 0) {
- log(`${pluralize(game.prudence.DEM, ' op')} from C8`)
- modifier += game.prudence.DEM
- }
- if (game.active === COM && game.prudence && game.prudence.COM < 0) {
- log(`${pluralize(game.prudence.COM, ' op')} from C8`)
- modifier += game.prudence.COM
- }
- 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`)
}
@@ -3262,7 +3235,11 @@ function get_events(card){
}
function get_card_ops(card) {
- let ops = cards[card].ops
+ let ops = 0
+
+ if (card) {
+ ops = cards[card].ops
+ }
if (game.persistent_events.includes(25) && game.active === COM) {
if(game.state === 'choose_card' || game.state === 'stasi_play_card') {
log('+1 op from C25')
@@ -3294,6 +3271,7 @@ function get_card_ops(card) {
}
}
ops += game.prudence.DEM
+
if (ops < 1) {
ops = 1
}
@@ -3314,6 +3292,49 @@ function get_card_ops(card) {
} return ops
}
+function get_tst_6_ops() {
+ let ops = 0
+
+ if (game.persistent_events.includes(25) && game.active === COM) {
+ log('+1 op from C25')
+ ops ++
+ }
+ if (game.persistent_events.includes(50) && game.active === DEM) {
+ log('+1 op from C50')
+ ops ++
+ }
+
+ if ((game.active === DEM && game.prudence && game.prudence.DEM !== 0)) {
+ if (ops > 0) {
+ log(`${pluralize(game.prudence.DEM,'op')} from C8`)
+ } else {
+ log(`-1 op from C8`)
+ }
+
+ ops += game.prudence.DEM
+
+ if (ops < -1) {
+ ops = -1
+ }
+ }
+
+ if (game.active === COM && game.prudence && game.prudence.COM < 0) {
+
+ if (ops > 0) {
+ log(`${pluralize(game.prudence.COM,'op')} from C8`)
+ } else {
+ log(`-1 op from C8`)
+ }
+
+ ops += game.prudence.COM
+ if (ops < -1) {
+ ops = -1
+ }
+ }
+ return ops
+}
+
+
// =========== MOVING THROUGH TURNS ============
function end_round() {
@@ -8248,12 +8269,15 @@ states.vm_tst_8 = {
}
},
event() {
+ push_undo()
game.vm_event_to_do = false
game.return_state = 'vm_tst_8'
game.return = game.active
- goto_vm(game.played_card)
+ game.vm_event = game.played_card
+ goto_vm(game.vm_event)
},
ops() {
+ push_undo()
game.vm_infl_to_do = false
game.return = game.active
game.return_state = 'vm_tst_8'