summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-11-18 15:32:55 +0000
committeriainp5 <iain.pearce.ip@gmail.com>2024-11-18 15:32:55 +0000
commit2c25d82a4e308d5e1d93606c28698934c22751c5 (patch)
tree05aeff862e89916935131e1f7348ce10f98d7f23
parent6365dc092b06d4573c1c2687d6a652e203ffc32c (diff)
download1989-dawn-of-freedom-2c25d82a4e308d5e1d93606c28698934c22751c5.tar.gz
Add autoresolve for Exit Visas
-rw-r--r--events.txt2
-rw-r--r--rules.js9
2 files changed, 10 insertions, 1 deletions
diff --git a/events.txt b/events.txt
index 7db1b63..09eb662 100644
--- a/events.txt
+++ b/events.txt
@@ -563,8 +563,10 @@ frg_embassies
CARD 75 - Exit Visas*
# The Democratic Player may discard any cards in his hand and draw new cards from the deck.
+if !is_auto_resolve(C_EXIT_VISAS)
permanently_remove
exit_visas
+endif
CARD 76 - Warsaw Pact Summit
diff --git a/rules.js b/rules.js
index 4bf7a33..b991456 100644
--- a/rules.js
+++ b/rules.js
@@ -3077,7 +3077,12 @@ function is_auto_resolve(card) {
if (!game.state.startsWith('vm')) { logi('No SPs to remove') }
return true
}
- }
+ } else if (card === C_EXIT_VISAS) {
+ if (game.democrat_hand.length === 0) {
+ if (!game.state.startsWith('vm')) { logi('Democrat has no cards to discard') }
+ return true
+ }
+ }
else {
return false
}
@@ -8478,8 +8483,10 @@ CODE[74] = [ // FRG Embassies
]
CODE[75] = [ // Exit Visas*
+ [ vm_if, ()=>!is_auto_resolve(C_EXIT_VISAS) ],
[ vm_permanently_remove ],
[ vm_exit_visas ],
+ [ vm_endif ],
[ vm_return ],
]