From 596edf2c4bf3461368451beabb139fdc9289708b Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 28 Sep 2024 07:48:28 +0100 Subject: Fix for Reformer --- rules.js | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/rules.js b/rules.js index 06996f4..0955eba 100644 --- a/rules.js +++ b/rules.js @@ -2763,21 +2763,6 @@ function do_tst_attempt() { game.com_tst_attempted = 1 } } - // Check whether The Reformer is playable: - console.log('reformer check, dem pos:', game.dem_tst_position, 'com:', game.com_tst_position) - if (game.dem_tst_position > game.com_tst_position) { - console.log('reformer set to DEM') - game.playable_cards[67].playable = DEM - } - if (game.dem_tst_position < game.com_tst_position) { - console.log('reformer set to COM') - game.playable_cards[67].playable = COM - } - if (game.dem_tst_position === game.com_tst_position) { - console.log(`reformer set to ''`) - game.playable_cards[67].playable = '' - } - console.log('game.playable_cards[67].playable', game.playable_cards[67].playable) } function check_presence(country) { @@ -3078,6 +3063,23 @@ function end_stasi_choose_card() { } } +function check_reformer() { + console.log('reformer check, dem pos:', game.dem_tst_position, 'com:', game.com_tst_position) + if (game.dem_tst_position > game.com_tst_position) { + console.log('reformer set to DEM') + game.playable_cards[67].playable = DEM + } + if (game.dem_tst_position < game.com_tst_position) { + console.log('reformer set to COM') + game.playable_cards[67].playable = COM + } + if (game.dem_tst_position === game.com_tst_position) { + console.log(`reformer set to ''`) + game.playable_cards[67].playable = '' + } + console.log('game.playable_cards[67].playable', game.playable_cards[67].playable) +} + // =========== MOVING THROUGH TURNS ============ function end_round() { @@ -3154,7 +3156,9 @@ function end_round() { console.log('game.dem_tst_position ', game.dem_tst_position , 'game.com_tst_position ', game.com_tst_position ) - + //Check if the Reformer is playable + check_reformer() + // Check if last round and if so resolve end turn events if (game.round_player === DEM && game.round === 7) { if(game.persistent_events['honecker']) { -- cgit v1.2.3