summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-11-05 20:03:45 +0000
committeriainp5 <iain.pearce.ip@gmail.com>2024-11-05 20:03:45 +0000
commitebf691da7c8f992a2b1a20fc2b7cee7b84c3bee9 (patch)
tree7505dd42ce9ed02646b78ec41d9ddd1482dc8580
parentd74ad01205df4dc4f669e078fe0f5699f8d70db7 (diff)
download1989-dawn-of-freedom-ebf691da7c8f992a2b1a20fc2b7cee7b84c3bee9.tar.gz
Update autoresolve events
-rw-r--r--events.txt42
-rw-r--r--rules.js125
2 files changed, 128 insertions, 39 deletions
diff --git a/events.txt b/events.txt
index 54203f1..01ba963 100644
--- a/events.txt
+++ b/events.txt
@@ -44,7 +44,9 @@ general_strike
CARD 6 - Brought in for Questioning
# The Democratic Player must randomly discard a card. If it is a Communist event it takes place immediately.
+if !is_auto_resolve(C_BROUGHT_IN_FOR_QUESTIONING)
brought_in_for_questioning
+endif
CARD 7 - State Run Media*
@@ -78,9 +80,11 @@ endif
CARD 11 - Dissident arrested
# Remove 2 Democratic SPs from any Intellectuals space.
+if !is_auto_resolve(C_DISSIDENT_ARRESTED)
valid_spaces_opponent_socio 5
prompt 'any Intellectuals space'
remove_x_opp_infl 2
+endif
CARD 12 - Apparatchicks
@@ -140,7 +144,9 @@ add_x_infl 3
CARD 20 - Deutsche Marks*
# Democratic Player gives the Communist Player his highest Ops value card. If a Communist event it takes place immediately, otherwise use the Ops value of the card without triggering the event.
permanently_remove
+if !is_auto_resolve(C_DEUTSCHE_MARKS)
deutsche_marks
+endif
CARD 21 - Common European Home
@@ -160,9 +166,11 @@ power_struggle
CARD 24 - St Nicolas Church
# Place sufficient Democratic SPs in the Lutheran Church space for Democratic control. Allows play of The Monday Demonstrations.
+if !check_dem_control(S_LUTHERAN_CHURCH)
valid_spaces 'Lutheran Church'
prompt 'the Lutheran Church'
take_control_prep 1
+endif
st_nicholas_church
@@ -225,10 +233,13 @@ add_limited_infl 4 2
CARD 33 - Sajudis*
# +1 VP. Reduce USSR stability by 1. Place sufficient Democratic support in any Minorities space for control. Allows play of The Baltic Way.
permanently_remove
+sajudis
+if !is_auto_resolve(C_SAJUDIS)
sajudis_check
prompt 'any Minorities space'
take_control_prep 1
-sajudis
+endif
+
CARD 34 - Fidesz*
@@ -293,7 +304,10 @@ prompt 'make a Support Check in Hungary'
CARD 41 - Ceausescu*
# Remove 3 Democratic SPs in Romania and make a Support Check in Romania using the Ops value of this card. If the Democratic Player has any SPs in spaces adjacent to Cluj at the end of this action round remove 1 Communist SP from Bucharest. May not be played as an event after The Tyrant is Gone.
permanently_remove
-if !game.the_tyrant_is_gone
+if game.the_tyrant_is_gone
+tyrant_block
+else
+if !is_auto_resolve(C_CEAUSESCU)
valid_spaces_country_opp 'Romania'
prompt ' from Romania'
remove_opp_infl 3
@@ -302,8 +316,6 @@ prompt 'make a support check in Romania'
1_support_check
prompt ' from Bucharesti'
ceausescu
-else
-tyrant_block
endif
@@ -350,13 +362,18 @@ CARD 47 - Bulgarian Turks Expelled*
# -2 VP. Remove any Democratic SPs in Razgrad.
permanently_remove
bulgarian_turks_expelled
+if !is_auto_resolve(C_BULGARIAN_TURKS_EXPELLED)
+valid_spaces 'Razgrad'
prompt 'Razgrad'
remove_all_infl 1
+endif
CARD 48 - We are the People!*
# The Democrat can move up to 4 SPs from the Lutheran Church space to any spaces in Germany, no more than 2 per space. The Communist may no longer make Support Checks in Leipzig.
+if !is_auto_resolve(C_WE_ARE_THE_PEOPLE)
we_are_the_people
+endif
CARD 49 - Foreign Currency Debt Burden*
@@ -383,9 +400,11 @@ add_infl_free
CARD 52 - Normalisation
# Remove all Democratic SPs from the Czechoslovakia Elite and Bureaucrat Spaces.
permanently_remove
+if !is_auto_resolve(C_NORMALISATION)
normalisation
prompt 'the Czechoslovakia Elite and Bureaucrat Spaces'
remove_all_infl 2
+endif
CARD 53 - Li Peng*
@@ -508,7 +527,9 @@ securitate
CARD 71 - Kiss of Death*
# The Communist Player must randomly discard a card. If it is neutral or Democratic it takes place immediately.
permanently_remove
+if !is_auto_resolve(C_KISS_OF_DEATH)
kiss_of_death
+endif
CARD 72 - Peasant Parties Revolt
@@ -588,9 +609,12 @@ add_infl_free
CARD 81 - The Baltic Way*
# +2 VP. Reduce USSR stability by 1. Place sufficient Democratic SPs in any Minorities space for control. .Requires play of Sajudis. Allows play of Breakaway Baltic Republics.
permanently_remove
+the_baltic_way_prep
+if !is_auto_resolve(C_THE_BALTIC_WAY)
the_baltic_way
prompt 'any Minorities space'
take_control_prep 1
+endif
CARD 82 - Spitzel*
@@ -636,7 +660,10 @@ remove_infl 3
CARD 87 - Kohl Proposes Reunification*
# +2 VP. The Democratic Player may place SPs or make Support Checks using the Ops value of this card if The Wall Must Go! has been played as an event successfully.
permanently_remove
+kohl_proposes_reunification_prep
+if !is_auto_resolve(C_KOHL_PROPOSES_REUNIFICATION)
kohl_proposes_reunification
+endif
@@ -683,8 +710,10 @@ support_check 2
CARD 92 - Betrayal
# Choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs.
permanently_remove
+if !is_auto_resolve(C_BETRAYAL)
prompt 'choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs'
betrayal
+endif
CARD 93 - Shock Therapy*
@@ -774,10 +803,13 @@ national_salvation_front
CARD 103 - Government Resigns*
# Remove all Communist SPs from any uncontrolled Elite space.
+permanently_remove
+if !is_auto_resolve(C_GOVERNMENT_RESIGNS)
government_resigns
prompt 'any uncontrolled Elite space'
remove_all_infl 1
-permanently_remove
+endif
+
CARD 104 - New Year's Eve Party*
diff --git a/rules.js b/rules.js
index 6ca2c78..3c3eebd 100644
--- a/rules.js
+++ b/rules.js
@@ -3009,53 +3009,81 @@ function is_auto_resolve(card) {
else if (card === C_KOHL_PROPOSES_REUNIFICATION && !game.persistent_events.includes(C_THE_WALL_MUST_GO)) {
return true
}
- if (card === C_BROUGHT_IN_FOR_QUESTIONING || card === C_DEUTSCHE_MARKS) {
- if (game.democrat_hand.length === 0) { return true }
+ else if (card === C_BROUGHT_IN_FOR_QUESTIONING ) {
+ if (game.democrat_hand.length === 0) {
+ if (!game.state.startsWith('vm')) { log('Democrat has no cards to discard') }
+ return true }
+ }
+ else if (card === C_DEUTSCHE_MARKS) {
+ if (game.democrat_hand.length === 0) {
+ if (!game.state.startsWith('vm')) { log('Democrat has no cards to give') }
+ return true }
+ }
+ else if (card === C_KISS_OF_DEATH ) {
+ if (game.communist_hand.length === 0) {
+ if (!game.state.startsWith('vm')) { log('Communist has no cards to discard') }
+ return true }
}
else if (card === C_DISSIDENT_ARRESTED) {
- let dem_intellectual_infl = spaces.filter(space => space.socio === 5 && game.demInfl[space] > 0).length
+ let dem_intellectual_infl = spaces.filter(space => space.socio === 5 && game.demInfl[space.space_id] > 0).length
+ console.log('dem_intellectual_infl', dem_intellectual_infl)
if (dem_intellectual_infl === 0) {
- log('No influence to remove')
+ if (!game.state.startsWith('vm')) { log('No influence to remove') }
return true
}
} else if (card === C_SAJUDIS || card === C_THE_BALTIC_WAY) {
if (!game.systematization === S_HARGHITA_COVASNA) {
- if (dem_control(S_RAZGRAD) && dem_control(S_HARGHITA_COVASNA)) {
- log('Both Minorities spaces already controlled')
+ if (check_dem_control(S_RAZGRAD) && check_dem_control(S_HARGHITA_COVASNA)) {
+ if (!game.state.startsWith('vm')) { log('Both Minorities spaces already controlled') }
return true
}
- } else if (dem_control(S_RAZGRAD)) {
- log('Both Minorities spaces already controlled')
+ } else if (check_dem_control(S_RAZGRAD)) {
+ if (!game.state.startsWith('vm')) { log('Both Minorities spaces already controlled') }
return true
}
} else if (card === C_CEAUSESCU) {
let dem_romania_infl = spaces.filter(space => space.country === 'Romania' && game.demInfl[space] > 0).length
if (dem_romania_infl === 0) {
- log('No influence to remove')
+ if (!game.state.startsWith('vm')) { log('No influence to remove') }
return true
}
}
else if (card === C_WE_ARE_THE_PEOPLE) {
if (game.demInfl[S_LUTHERAN_CHURCH] === 0) {
- log('No influence to remove')
+ if (!game.state.startsWith('vm')) { log('No influence to remove') }
return true
}
}
else if (card === C_BETRAYAL) {
if (!game.systematization === S_ORTHODOX_CHURCH_ROMANIA) {
if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] === 0) {
- log('No influence to remove')
+ if (!game.state.startsWith('vm')) { log('No influence to remove') }
return true
}
} else if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] === 0 && game.demInfl[S_ORTHODOX_CHURCH_ROMANIA] === 0) {
- log('No influence to remove')
+ if (!game.state.startsWith('vm')) { log('No influence to remove') }
return true
}
}
else if (card === C_GOVERNMENT_RESIGNS) {
let uncontrolled_elites = spaces.filter( s => game.comInfl[s] > 0 && !check_control(s)).length
if (uncontrolled_elites === 0) {
- log('No uncontrolled Elite spaces')
+ if (!game.state.startsWith('vm')) { log('No uncontrolled Elite spaces') }
+ return true
+ }
+ } else if (card === C_ST_NICHOLAS_CHURCH) {
+ if (check_dem_control(S_LUTHERAN_CHURCH)) {
+ if (!game.state.startsWith('vm')) { log('Lutheran Church already controlled') }
+ return true
+ }
+ } else if (card === C_BULGARIAN_TURKS_EXPELLED) {
+ if (game.demInfl[S_RAZGRAD] === 0 ) {
+ if (!game.state.startsWith('vm')) { log('No influence to remove') }
+ return true
+ }
+ } else if (card === C_NORMALIZATION) {
+ if (game.demInfl[S_PRAHA] === 0 && game.demInfl[S_PLZEN] === 0 ) {
+ if (!game.state.startsWith('vm')) { log('No influence to remove') }
return true
}
}
@@ -4595,7 +4623,6 @@ function vm_bulgarian_turks_expelled(){
if (check_vp()) {
return
}
- if (game.demInfl[S_RAZGRAD] > 0) {game.valid_spaces = [S_RAZGRAD]}
vm_next()
}
@@ -4878,20 +4905,16 @@ function vm_klaus_and_komarek() {
vm_next()
}
-function vm_kohl_proposes_reunification() {
+function vm_kohl_proposes_reunification_prep() {
log('+2 VP')
game.vp += 2
if (check_vp()) {
return
}
- if (game.persistent_events.includes(C_THE_WALL_MUST_GO)) {
- game.vm_event = C_KOHL_PROPOSES_REUNIFICATION
- game.state = 'vm_common_european_home_play'
- } else {
- permanently_remove(C_KOHL_PROPOSES_REUNIFICATION)
- vm_return()
- }
-
+}
+function vm_kohl_proposes_reunification() {
+ game.vm_event = C_KOHL_PROPOSES_REUNIFICATION
+ game.state = 'vm_common_european_home_play'
}
function vm_kremlin_coup() {
@@ -5096,6 +5119,7 @@ function vm_sajudis() {
if (check_vp()) {
return
}
+ log(`Allows play of C${C_THE_BALTIC_WAY} for the event`)
vm_next()
}
@@ -5194,11 +5218,9 @@ function vm_tear_gas () {
vm_next()
}
-function vm_the_baltic_way() {
+function vm_the_baltic_way_prep() {
game.playable_cards.push(C_BREAKAWAY_BALTIC_REPUBLICS)
game.stability++
- if (!check_dem_control(S_HARGHITA_COVASNA) && game.systematization !== S_HARGHITA_COVASNA) {game.valid_spaces.push(S_HARGHITA_COVASNA)}
- if (!check_dem_control(S_RAZGRAD) ) {game.valid_spaces.push(S_RAZGRAD)}
log('+3 VP')
game.vp += 3
if (check_vp()) {
@@ -5207,6 +5229,12 @@ function vm_the_baltic_way() {
vm_next()
}
+function vm_the_baltic_way() {
+ if (!check_dem_control(S_HARGHITA_COVASNA) && game.systematization !== S_HARGHITA_COVASNA) {game.valid_spaces.push(S_HARGHITA_COVASNA)}
+ if (!check_dem_control(S_RAZGRAD) ) {game.valid_spaces.push(S_RAZGRAD)}
+ vm_next()
+}
+
function vm_the_chinese_solution() {
game.state = 'vm_the_chinese_solution'
}
@@ -7888,7 +7916,9 @@ CODE[5] = [ // General strike
]
CODE[6] = [ // Brought in for Questioning
+ [ vm_if, ()=>!is_auto_resolve(C_BROUGHT_IN_FOR_QUESTIONING) ],
[ vm_brought_in_for_questioning ],
+ [ vm_endif ],
[ vm_return ],
]
@@ -7922,9 +7952,11 @@ CODE[10] = [ // Cult of Personality
]
CODE[11] = [ // Dissident arrested
+ [ vm_if, ()=>!is_auto_resolve(C_DISSIDENT_ARRESTED) ],
[ vm_valid_spaces_opponent_socio, 5 ],
[ vm_prompt, 'any Intellectuals space' ],
[ vm_remove_x_opp_infl, 2 ],
+ [ vm_endif ],
[ vm_return ],
]
@@ -7984,7 +8016,9 @@ CODE[19] = [ // Papal vist
CODE[20] = [ // Deutsche Marks*
[ vm_permanently_remove ],
+ [ vm_if, ()=>!is_auto_resolve(C_DEUTSCHE_MARKS) ],
[ vm_deutsche_marks ],
+ [ vm_endif ],
[ vm_return ],
]
@@ -8004,9 +8038,11 @@ CODE[23] = [ // Power Struggle - Hungary
]
CODE[24] = [ // St Nicolas Church
+ [ vm_if, ()=>!check_dem_control(S_LUTHERAN_CHURCH) ],
[ vm_valid_spaces, 'Lutheran Church' ],
[ vm_prompt, 'the Lutheran Church' ],
[ vm_take_control_prep, 1 ],
+ [ vm_endif ],
[ vm_st_nicholas_church ],
[ vm_return ],
]
@@ -8069,10 +8105,12 @@ CODE[32] = [ // Peasant Parties*
CODE[33] = [ // Sajudis*
[ vm_permanently_remove ],
+ [ vm_sajudis ],
+ [ vm_if, ()=>!is_auto_resolve(C_SAJUDIS) ],
[ vm_sajudis_check ],
[ vm_prompt, 'any Minorities space' ],
[ vm_take_control_prep, 1 ],
- [ vm_sajudis ],
+ [ vm_endif ],
[ vm_return ],
]
@@ -8137,7 +8175,10 @@ CODE[40] = [ // Hungarian Democratic Forum
CODE[41] = [ // Ceausescu*
[ vm_permanently_remove ],
- [ vm_if, ()=>!game.the_tyrant_is_gone ],
+ [ vm_if, ()=>game.the_tyrant_is_gone ],
+ [ vm_tyrant_block ],
+ [ vm_else ],
+ [ vm_if, ()=>!is_auto_resolve(C_CEAUSESCU) ],
[ vm_valid_spaces_country_opp, 'Romania' ],
[ vm_prompt, ' from Romania' ],
[ vm_remove_opp_infl, 3 ],
@@ -8146,8 +8187,6 @@ CODE[41] = [ // Ceausescu*
[ vm_1_support_check ],
[ vm_prompt, ' from Bucharesti' ],
[ vm_ceausescu ],
- [ vm_else ],
- [ vm_tyrant_block ],
[ vm_endif ],
[ vm_return ],
]
@@ -8194,13 +8233,18 @@ CODE[46] = [ // Goodbye Lenin!*
CODE[47] = [ // Bulgarian Turks Expelled*
[ vm_permanently_remove ],
[ vm_bulgarian_turks_expelled ],
+ [ vm_if, ()=>!is_auto_resolve(C_BULGARIAN_TURKS_EXPELLED) ],
+ [ vm_valid_spaces, 'Razgrad' ],
[ vm_prompt, 'Razgrad' ],
[ vm_remove_all_infl, 1 ],
+ [ vm_endif ],
[ vm_return ],
]
CODE[48] = [ // We are the People!*
+ [ vm_if, ()=>!is_auto_resolve(C_WE_ARE_THE_PEOPLE) ],
[ vm_we_are_the_people ],
+ [ vm_endif ],
[ vm_return ],
]
@@ -8227,9 +8271,11 @@ CODE[51] = [ // 40th Anniversary Celebration*
CODE[52] = [ // Normalisation
[ vm_permanently_remove ],
+ [ vm_if, ()=>!is_auto_resolve(C_NORMALISATION) ],
[ vm_normalisation ],
[ vm_prompt, 'the Czechoslovakia Elite and Bureaucrat Spaces' ],
[ vm_remove_all_infl, 2 ],
+ [ vm_endif ],
[ vm_return ],
]
@@ -8352,7 +8398,9 @@ CODE[70] = [ // Securitate*
CODE[71] = [ // Kiss of Death*
[ vm_permanently_remove ],
+ [ vm_if, ()=>!is_auto_resolve(C_KISS_OF_DEATH) ],
[ vm_kiss_of_death ],
+ [ vm_endif ],
[ vm_return ],
]
@@ -8432,9 +8480,12 @@ CODE[80] = [ // Nepotism*
CODE[81] = [ // The Baltic Way*
[ vm_permanently_remove ],
+ [ vm_the_baltic_way_prep ],
+ [ vm_if, ()=>!is_auto_resolve(C_THE_BALTIC_WAY) ],
[ vm_the_baltic_way ],
[ vm_prompt, 'any Minorities space' ],
[ vm_take_control_prep, 1 ],
+ [ vm_endif ],
[ vm_return ],
]
@@ -8480,7 +8531,10 @@ CODE[86] = [ // The Wall Must Go!*
CODE[87] = [ // Kohl Proposes Reunification*
[ vm_permanently_remove ],
+ [ vm_kohl_proposes_reunification_prep ],
+ [ vm_if, ()=>!is_auto_resolve(C_KOHL_PROPOSES_REUNIFICATION) ],
[ vm_kohl_proposes_reunification ],
+ [ vm_endif ],
[ vm_return ],
]
@@ -8524,8 +8578,10 @@ CODE[91] = [ // My First Banana*
CODE[92] = [ // Betrayal
[ vm_permanently_remove ],
+ [ vm_if, ()=>!is_auto_resolve(C_BETRAYAL) ],
[ vm_prompt, 'choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs' ],
[ vm_betrayal ],
+ [ vm_endif ],
[ vm_return ],
]
@@ -8564,8 +8620,8 @@ CODE[96] = [ // The Chinese Solution*
]
CODE[97] = [ // The Tyrant is Gone*
- [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ],
- [ vm_valid_spaces_com, 'Cluj-Napoca' ],
+ [ vm_if, ()=>game.persistent_events.includes(54) ],
+ [ vm_valid_spaces, 'Cluj-Napoca' ],
[ vm_prompt, 'the Romanian Elite Space' ],
[ vm_remove_x_opp_infl, 4 ],
[ vm_the_tyrant_is_gone ],
@@ -8615,10 +8671,12 @@ CODE[102] = [ // National Salvation Front*
]
CODE[103] = [ // Government Resigns*
+ [ vm_permanently_remove ],
+ [ vm_if, ()=>!is_auto_resolve(C_GOVERNMENT_RESIGNS) ],
[ vm_government_resigns ],
[ vm_prompt, 'any uncontrolled Elite space' ],
[ vm_remove_all_infl, 1 ],
- [ vm_permanently_remove ],
+ [ vm_endif ],
[ vm_return ],
]
@@ -8725,4 +8783,3 @@ CODE[351] = [ // Scare Tactics
[ vm_return ],
]
// #endregion
-