From 7f7b59dc2fb2e02d547b94a20beac021efe17de8 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 20 Sep 2024 18:28:19 +0100 Subject: Fix NYE Party --- rules.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 510ef0f..1909f77 100644 --- a/rules.js +++ b/rules.js @@ -1593,7 +1593,7 @@ states.finish_scoring ={ done() { console.log('game.return_state', game.return_state) log('Power Struggle resolved') /*At this point log card dicarded or permanently removed? */ - if (game.return_state === 'new_years_eve_party') { + if (game.persistent_events['new_years_eve_party'] === 2) { game.state = 'new_years_eve_party' return } @@ -1631,8 +1631,9 @@ states.end_turn_4_5_4 = { log('Communist player has a held scoring card') goto_game_over(DEM, `${DEM} won by held scoring card!`) } - else if (game.persistent_events['new_years_eve_party']) { + else if (game.persistent_events['new_years_eve_party'] === 1) { log_h1(`New Year's Eve Party`) + game.persistent_events['new_years_eve_party'] = 2 game.state = 'new_years_eve_party' } else if(game.turn === 10) { @@ -1828,42 +1829,36 @@ states.new_years_eve_party = { east_germany() { push_undo() log('Chose to score East Germany') - game.return_state = 'new_years_eve_party' game.vm_event = 42 goto_vm(42) }, poland() { push_undo() log('Chose to score Poland') - game.return_state = 'new_years_eve_party' game.vm_event = 22 goto_vm(22) }, czechoslovakia() { push_undo() log('Chose to score Czechoslovakia') - game.return_state = 'new_years_eve_party' game.vm_event = 55 goto_vm(55) }, hungary() { push_undo() log('Chose to score Hungary') - game.return_state = 'new_years_eve_party' game.vm_event = 23 goto_vm(23) }, romania() { push_undo() log('Chose to score Romania') - game.return_state = 'new_years_eve_party' game.vm_event = 95 goto_vm(95) }, bulgaria () { push_undo() log('Chose to score Bulgaria') - game.return_state = 'new_years_eve_party' game.vm_event = 43 goto_vm(43) }, @@ -2932,10 +2927,7 @@ function end_round() { } game.state = 'honecker' return - } /*else if (game.persistent_events['new_years_eve_party']) { - game.state = 'new_years_eve_party' - return - } */ + } else if (game.dem_tst_position >= 6 && game.com_tst_position <= 5) { log_h2('Tiananmen Square Track Award') if (game.active !== DEM) { @@ -6461,7 +6453,7 @@ states.vm_new_years_eve_party = { }, end() { push_undo() - game.persistent_events['new_years_eve_party'] = true + game.persistent_events['new_years_eve_party'] = 1 log('Chooses to end the game. There will be no final scoring') let power = Object.values(game.revolutions).filter(value => value === false).length if (power > 3) { -- cgit v1.2.3