diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-09-17 14:36:40 +0100 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-09-17 14:36:40 +0100 |
commit | 13e1109ed52324739a7f422502ad0c6e4572db25 (patch) | |
tree | c18b29e5e283aa98b29f6be66a440b846d1ce571 | |
parent | d2eb5b584d4859158a0092262aa49a1535736a94 (diff) | |
download | 1989-dawn-of-freedom-13e1109ed52324739a7f422502ad0c6e4572db25.tar.gz |
Debugging steps for power struggle
-rw-r--r-- | rules.js | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -473,6 +473,7 @@ states.choose_card = { game.persistent_events['ligachev'] = false
}
game.state = 'play_card'
+ console.log('game.state', game.state)
},
pass() {
log('No cards remaining. Passed')
@@ -527,6 +528,7 @@ states.play_card ={ },
event() {
push_undo()
+ console.log('played event, game.active', game.active)
log_gap(`Played C${cards[game.played_card].number} for the event`)
if (scoring_cards.includes(game.played_card)) {game.phase = 0}
else {game.phase = 1}
@@ -947,6 +949,7 @@ states.draw_power_cards = { },
draw() {
push_undo()
+ console.log('called draw cards, game.active', game.active)
let presence = check_presence(game.pwr_struggle_in)
if (presence.dem_spaces > 0) {
game.dem_pwr_hand_limit = 6 + 2*(presence.dem_spaces - 1)
@@ -986,6 +989,7 @@ states.draw_power_cards = { //Check if The Crowd Turns Against Ceausescu occurs
if (game.persistent_events['the_crowd_turns_against_ceausescu'] && game.pwr_struggle_in === 'Romania') {
+ console.log('draw cards: crowd subcheck, game.active', game.active)
if (game.active === COM) {
game.return = COM
next_player()
@@ -995,6 +999,7 @@ states.draw_power_cards = { } else {
log_h2('Raise the Stakes')
game.state = 'raise_stakes_1'
+ console.log('game.state', game.state, 'game.active', game.active)
}
}
}
@@ -1073,7 +1078,7 @@ states.raise_stakes_1 = { inactive: 'raise the stakes',
prompt () {
- console.log('game.played_power_card', game.played_power_card)
+ console.log('raise the stakes: game.played_power_card', game.played_power_card)
if (game.raised_stakes_discard === 3) {
view.prompt = 'Raise the stakes: done.'
gen_action('done')
@@ -4685,16 +4690,19 @@ function vm_poszgay() { }
function vm_power_struggle() {
+ console.log('in vm_power_struggle. game.vm_event', game.vm_event, 'game.active', game.active)
game.is_pwr_struggle = true
//Check if Power Struggle is because of an event
if (game.vm_event > 0) {
+ console.log('vm_power_struggle, in game.vm_event check')
game.pwr_struggle_in = countries[scoring_cards.indexOf(game.vm_event)]
log_h2(`C${game.vm_event}`)
}
//Otherwise set Power Struggle country normally
else {
+ console.log('vm_power_struggle, country set normally')
game.pwr_struggle_in = countries[scoring_cards.indexOf(game.played_card)]
log_h2(`C${game.played_card}`)
}
@@ -4702,11 +4710,13 @@ function vm_power_struggle() { //Check for Securitate
if (game.pwr_struggle_in === 'Romania' && game.persistent_events['securitate']) {
+ console.log('in Securitate subcheck')
log('C70: Democrat reveals Power Struggle cards')
game.view_opp_hand = true
}
log_h2('Deal Cards')
game.state = 'draw_power_cards'
+ console.log('game.state',game.state)
}
function vm_presidential_visit() {
|