summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-11-27 18:19:42 +0000
committeriainp5 <iain.pearce.ip@gmail.com>2024-11-27 18:19:42 +0000
commit577c7fa0e30f7dfca85b4de670274725e1ddce7d (patch)
treea0602ad4b00d78440b8ad4e4943f1cf40b81f17d
parentc371a5aacf4d80da8b2dfe37b7e08777ab042cfc (diff)
download1989-dawn-of-freedom-577c7fa0e30f7dfca85b4de670274725e1ddce7d.tar.gz
Add Solidarity Legalized to conditional autoresolve
-rw-r--r--events.txt6
-rw-r--r--rules.js20
2 files changed, 20 insertions, 6 deletions
diff --git a/events.txt b/events.txt
index 0971a59..a2d8a6c 100644
--- a/events.txt
+++ b/events.txt
@@ -12,10 +12,12 @@ prompt 'make a Support Check in Poland'
CARD 2 - Solidarity Legalised*
# Place a Democratic SP in every uncontrolled Worker and Farmer space in Poland. Allows play of Walesa.
-solidarity_legalised
-valid_spaces_solidarity_legalised
+if !is_auto_resolve(C_SOLIDARITY_LEGALIZED)
+solidarity_legalised_spaces
prompt 'to every uncontrolled Worker and Farmer space in Poland'
add_limited_infl 9 1
+endif
+solidarity_legalised
CARD 3 - Walesa
diff --git a/rules.js b/rules.js
index 3879e17..70b00ae 100644
--- a/rules.js
+++ b/rules.js
@@ -3120,6 +3120,12 @@ function is_auto_resolve(card) {
if (!game.state.startsWith('vm')) { logi('No influence to remove') }
return true
}
+ } else if (card === C_SOLIDARITY_LEGALIZED) {
+ let uncontrolled_worker_farmer = vm_valid_spaces_solidarity_legalised()
+ if (uncontrolled_worker_farmer.length === 0) {
+ if (!game.state.startsWith('vm')) { logi('No uncontrolled Worker or Farmer spaces in Poland') }
+ return true
+ }
}
else {
return false
@@ -4344,8 +4350,7 @@ function vm_valid_spaces_solidarity_legalised() {
valid_spaces.push(space.space_id);
}
}
- game.valid_spaces = valid_spaces
- vm_next()
+ return valid_spaces
}
function vm_active_country () {
@@ -5260,6 +5265,11 @@ function vm_solidarity_legalised() {
vm_next()
}
+function vm_solidarity_legalised_spaces(){
+ game.valid_spaces = vm_valid_spaces_solidarity_legalised()
+ vm_next()
+}
+
function vm_st_nicholas_church () {
add_to_persistent_events(C_ST_NICHOLAS_CHURCH)
logi(`Allows play of C${C_THE_MONDAY_DEMONSTRATIONS}`)
@@ -8025,10 +8035,12 @@ CODE[1] = [ // Legacy of Martial Law*
]
CODE[2] = [ // Solidarity Legalised*
- [ vm_solidarity_legalised ],
- [ vm_valid_spaces_solidarity_legalised ],
+ [ vm_if, ()=>!is_auto_resolve(C_SOLIDARITY_LEGALIZED) ],
+ [ vm_solidarity_legalised_spaces ],
[ vm_prompt, 'to every uncontrolled Worker and Farmer space in Poland' ],
[ vm_add_limited_infl, 9, 1 ],
+ [ vm_endif ],
+ [ vm_solidarity_legalised ],
[ vm_return ],
]