diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-11-22 15:40:29 +0000 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-11-22 15:40:29 +0000 |
commit | 11f2a1d73c2ca7d59ea12415e89ea6454cb4fb57 (patch) | |
tree | a60a86266a0efc4cfd95bdaa486f720c41f0b9af | |
parent | ba66612d0d7e092a3b7b1dc91f1b39d00182029f (diff) | |
download | 1989-dawn-of-freedom-11f2a1d73c2ca7d59ea12415e89ea6454cb4fb57.tar.gz |
Debug shock therapy
-rw-r--r-- | rules.js | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -4106,26 +4106,31 @@ function vm_return() { delete game.vm_max_infl delete game.vm_influence_added delete game.communist_hand_red - + console.log('in vm_return') game.vm_event = 0 /*Reset to 0 now that event has been completed. Hopefully this doesn't cause issues! */ if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) { + console.log('debug 1') reset_austria_hungary_border_reopened() } //Check if end event state is needed if (game.is_pwr_struggle || game.state === 'vm_tst_6' || game.return_state === 'tiananmen_square_attempt_done') { + console.log('debug 2') vm_end_event() } //Check if auto-resolve opponent event else if (is_auto_resolve(game.played_card) && ((cards[game.played_card].side === 'C' && game.active === DEM) || (cards[game.played_card].side === 'D' && game.active === COM) )) { + console.log('debug 3') vm_end_event() } else { + console.log('debug 4') game.state = 'vm_end_event' } } function vm_end_event() { + console.log('vm_end_event, game.return', game.return, 'game.return_state', game.return_state, 'game.vm_infl_to_do', game.vm_infl_to_do) if (game.return !== game.active) { next_player()} if (game.return_state === 'power_struggle') { @@ -5500,6 +5505,7 @@ states.vm_end_event = { return `resolve ${clean_name(cards[this_card()].name)}.` }, prompt () { + console.log('in state vm_end_event') view.prompt = `${clean_name(cards[this_card()].name)}: done.` if (game.vm_infl_to_do || game.return_state === 'vm_tst_8') { gen_action('done') @@ -5509,6 +5515,7 @@ states.vm_end_event = { }, done() { push_undo() + console.log('done called') vm_end_event() }, end_round() { @@ -7231,7 +7238,7 @@ states.vm_shock_therapy = { logi(`-${worker_farmer} from Communist controlled Worker and Farmer spaces`) log(`Modified roll: ${Math.max(roll - worker_farmer, 0)}`) if ((roll - worker_farmer) > 2) { - log('C93 is successful. +3 VP') + log(`C${C_SHOCK_THERAPY} is successful. +3 VP`) game.vp += 3 if (check_vp()) { return @@ -7239,7 +7246,7 @@ states.vm_shock_therapy = { vm_next() } else { log('C93 is unsuccessful. Required 3 or more') - permanently_remove(93) + permanently_remove(C_SHOCK_THERAPY) vm_return() } }, |