From bb272b0887a5e4b4e8a7380d02e441874c48ff24 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 15 Oct 2024 08:37:51 +0100 Subject: Tidying up End Action Round --- rules.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 0259fda..a063005 100644 --- a/rules.js +++ b/rules.js @@ -863,6 +863,7 @@ states.tiananmen_square_attempt_success = { done () { push_undo() if (game.vm_event > 200) { + console.log('going to tst award, game.return_state', game.return_state) goto_vm(game.vm_event) } else { game.state = 'tiananmen_square_attempt_done' @@ -4371,7 +4372,7 @@ function pop_vm_prompt() { function vm_return() { - console.log('in vm_return, game.vm_infl_to_do', game.vm_infl_to_do) + console.log('in vm_return, game.vm_infl_to_do', game.vm_infl_to_do, 'return state', game.return_state) //Remove temporary vm variables delete game.support_check_modifier @@ -4385,14 +4386,15 @@ function vm_return() { } //Check if end event state is needed - if (game.is_pwr_struggle || game.state === 'vm_tst_6') { + if (game.is_pwr_struggle || game.state === 'vm_tst_6' || game.return_state === 'tiananmen_square_attempt_done') { vm_end_event() } else { if (!game.vm_infl_to_do) { /*if ((game.active === DEM && game.round_player !==DEM) || (game.active === COM && game.round_player !== COM)) { game.state = 'vm_end_event' } else {*/ - game.state = 'vm_end_event' + game.state = 'vm_end_event' + //} } else { console.log('vm_infl_to_do true') @@ -5914,6 +5916,7 @@ function discarded_card() { // =================== TIANANMEN SQUARE TRACK FUNCTIONS ==================== function vm_tst_3() { + console.log('function vm_tst_3, game.return_state', game.return_state) log_gap('Tiananmen Square Track award') game.state = 'vm_tst_3_prep' } @@ -6219,8 +6222,11 @@ states.vm_remove_x_infl = { }, infl(space) { vm_do_remove_x_infl(space) + if (game.vm_event === 68) { + vm_next() + } /*game.vm_event_done = true - vm_next()*/ + vm_next()*/ }, done () { game.vm_event_done = true @@ -8284,6 +8290,7 @@ states.vm_workers_revolt_finish = { states.vm_tst_3_prep = { inactive: 'resolve Tiananmen Square Track award.', prompt() { + console.log('tst award prep, game.return_state', game.return_state) view.prompt = 'Tiananmen Square Track award: draw 3 cards.' gen_action('draw') }, @@ -8305,8 +8312,9 @@ states.vm_tst_3_prep = { states.vm_tst_3 = { inactive: 'resolve Tiananmen Square Track bonus.', prompt() { + console.log('tst award, game.return_state', game.return_state) if (game.temp < 2) { - view.prompt = `Discard 2 of the drawn cards` + view.prompt = `Discard 2 of the drawn cards.` for (let card of game.valid_cards) { gen_action_card(card) } -- cgit v1.2.3