summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-11-18 19:10:28 +0000
committeriainp5 <iain.pearce.ip@gmail.com>2024-11-18 19:10:28 +0000
commit828b47de96c9ce53fe94d47bf4d9ad59998c3e89 (patch)
tree4007f3b9604c2310f8d1798bfff75084a18efcc5
parenta5cad5916776ff66e7c7d224f6b2d966db8d888f (diff)
download1989-dawn-of-freedom-828b47de96c9ce53fe94d47bf4d9ad59998c3e89.tar.gz
Add conditional autoresolves
-rw-r--r--events.txt9
-rw-r--r--rules.js12
2 files changed, 18 insertions, 3 deletions
diff --git a/events.txt b/events.txt
index a62e810..a3ff2d2 100644
--- a/events.txt
+++ b/events.txt
@@ -628,9 +628,11 @@ endif
CARD 82 - Spitzel*
# Remove 2 Democratic SPs in Germany.
permanently_remove
+if !is_auto_resolve(C_SPITZEL)
valid_spaces_country_opp 'East_Germany'
prompt ' from East Germany'
remove_opp_infl 2
+endif
CARD 83 - Modrow*
@@ -675,7 +677,6 @@ logi `C${C_THE_WALL_MUST_GO} has not been successfully played for the event.`
endif
-
CARD 88 - Adamec*
# Roll a die. On a 4-6 add 4 Communist SPs in Czechoslovakia, no more than 2 per space. -1 drm for every Worker or Farmer space in Czechoslovakia that is controlled by the Democratic Player.
permanently_remove
@@ -685,7 +686,6 @@ prompt 'Czechoslovakia'
add_limited_infl 4 2
-
CARD 89 - Domino Theory*
# If the Democrat holds Power in at least 2 counties, he may retrieve any Power Struggle - card from the discard pile and play it immediately as an event. The Democrat receives a -1 drm to his dice rolls for this Power Struggle.
permanently_remove
@@ -695,7 +695,6 @@ domino_theory
endif
-
CARD 90 - Civic Forum*
# +1 VP. Place 4 SPs in Czechoslovakia. The Democratic Player may make Support Checks in Czechoslovakia using the Ops value of this card if the Czech Writers space is Democratically controlled.
valid_spaces_country 'Czechoslovakia'
@@ -710,12 +709,14 @@ support_check 2
CARD 91 - My First Banana*
# Remove 2 Communist SPs and make two Support Checks in Germany using the Ops value of this card.
permanently_remove
+if !is_auto_resolve(C_MY_FIRST_BANANA)
valid_spaces_country_opp 'East_Germany'
prompt ' from East Germany'
remove_opp_infl 2
valid_spaces_country_sc 'East_Germany'
prompt 'select a space in East Germany'
support_check 2
+endif
CARD 92 - Betrayal
@@ -779,12 +780,14 @@ endif
CARD 98 - Politburo Intrigue*
# Remove 3 Democratic SPs in Bulgaria, no more than 2 per space. Then make one Support Check in Bulgaria, using the Ops value of this card.
permanently_remove
+if !is_auto_resolve(C_POLITBURO_INTRIGUE)
valid_spaces_country_opp 'Bulgaria'
prompt ' from Bulgaria'
remove_limited_opp_infl 3 2
valid_spaces_country_sc 'Bulgaria'
prompt 'make a support check in Bulgaria'
1_support_check
+endif
CARD 99 - Ligachev*
diff --git a/rules.js b/rules.js
index ac40f5b..d3c4dd6 100644
--- a/rules.js
+++ b/rules.js
@@ -3087,6 +3087,18 @@ function is_auto_resolve(card) {
if (!game.state.startsWith('vm')) { logi('Democrat has no cards to set aside') }
return true
}
+ } else if (card === C_SPITZEL) {
+ let dem_germany_infl = spaces.filter(space => space.country === 'East_Germany' && game.demInfl[space.space_id] > 0).length
+ if (dem_germany_infl === 0) {
+ if (!game.state.startsWith('vm')) { logi('No influence to remove') }
+ return true
+ }
+ } else if (card === C_MY_FIRST_BANANA) {
+ let com_germany_infl = spaces.filter(space => space.country === 'East_Germany' && game.comInfl[space.space_id] > 0).length
+ if (com_germany_infl === 0) {
+ if (!game.state.startsWith('vm')) { logi('No influence to remove') }
+ return true
+ }
}
else {
return false