summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2025-02-08 18:05:03 +0000
committeriainp5 <iain.pearce.ip@gmail.com>2025-02-08 18:07:43 +0000
commit88dda4dc240e1de3f4ef2abba63a132f8f9bebda (patch)
tree7bc54d284ad122f8621179cf87d689421756b712 /rules.js
parentc4ca26e50ddab62c5183415856cb6f5f83977188 (diff)
download1989-dawn-of-freedom-88dda4dc240e1de3f4ef2abba63a132f8f9bebda.tar.gz
Fix end game via Common European Home
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js30
1 files changed, 18 insertions, 12 deletions
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') ||