From 88dda4dc240e1de3f4ef2abba63a132f8f9bebda Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 8 Feb 2025 18:05:03 +0000 Subject: Fix end game via Common European Home --- rules.js | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 36639e4..e8e462d 100644 --- a/rules.js +++ b/rules.js @@ -749,6 +749,7 @@ states.play_card = { push_undo() log_ops_banner() check_ligachev_non_event() + check_ceh() if (game.state === 'game_over') { return } else { @@ -767,6 +768,7 @@ states.play_card = { push_undo() log_ops_banner() check_ligachev_non_event() + check_ceh() if (game.state === 'game_over') { return } else { @@ -779,6 +781,7 @@ states.play_card = { push_undo() log_ops_banner() check_ligachev_non_event() + check_ceh() if (game.state === 'game_over') { return } else { @@ -3191,6 +3194,21 @@ function end_raise_stakes(){ } } +function check_ceh() { + if (game.played_card === C_COMMON_EUROPEAN_HOME) { + if (game.active === DEM) { + game.vp -- + logi(`-1 VP for playing C${C_COMMON_EUROPEAN_HOME} for Operations.`) + } else { + game.vp ++ + logi(`+1 VP for playing C${C_COMMON_EUROPEAN_HOME} for Operations.`) + } + if (check_vp()) { + return + } + } +} + function check_reformer() { if (game.dem_tst_position !== game.com_tst_position) { if (!game.playable_cards.includes(C_REFORMER_REHABILITATED)) { @@ -3586,18 +3604,6 @@ function get_tst_6_ops() { } function finish_play_card() { - if (game.played_card === C_COMMON_EUROPEAN_HOME) { - if (game.active === DEM) { - game.vp -- - logi(`-1 VP for playing C${C_COMMON_EUROPEAN_HOME} for Operations.`) - } else { - game.vp ++ - logi(`+1 VP for playing C${C_COMMON_EUROPEAN_HOME} for Operations.`) - } - if (check_vp()) { - return - } - } if (cards[game.played_card].playable || game.playable_cards.includes(game.played_card)) { if ( (game.active === DEM && cards[game.played_card].side === 'C') || -- cgit v1.2.3