diff options
-rw-r--r-- | events.txt | 6 | ||||
-rw-r--r-- | rules.js | 20 |
2 files changed, 20 insertions, 6 deletions
@@ -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 @@ -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 ], ] |