diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-11-05 07:54:05 +0000 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-11-05 07:54:05 +0000 |
commit | 443b3e978d57d1fae0d8e11097ae6b346d8ea564 (patch) | |
tree | ad70891dcfe167e992212edafe8d8f97b4472c5f /rules.js | |
parent | 6908f939418502b0f397356df8aa767cbe3fd9bb (diff) | |
download | 1989-dawn-of-freedom-443b3e978d57d1fae0d8e11097ae6b346d8ea564.tar.gz |
Update autoresolve events
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 63 |
1 files changed, 57 insertions, 6 deletions
@@ -2998,9 +2998,11 @@ function select_card(card){ function is_auto_resolve(card) { let ceausecu_events = [10, 41, 101, 107] - - if (card === C_THE_TYRANT_IS_GONE) { - if (!game.persistent_events.includes(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU)) { + if (auto_resolve_events.includes(card)) { + return true + } + else if (card === C_THE_TYRANT_IS_GONE) { + if (game.persistent_events.includes(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU)) { return true } } @@ -3009,10 +3011,58 @@ 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_DISSIDENT_ARRESTED) { + let dem_intellectual_infl = spaces.filter(space => space.socio === 5 && game.demInfl[space] > 0).length + if (dem_intellectual_infl === 0) { + 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') + return true + } + } else if (dem_control(S_RAZGRAD)) { + 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') + return true + } + } + else if (card === C_WE_ARE_THE_PEOPLE) { + if (game.demInfl[S_LUTHERAN_CHURCH] === 0) { + 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') + return true + } + } else if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] === 0 && game.demInfl[S_ORTHODOX_CHURCH_ROMANIA] === 0) { + 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') + return true + } } - else if (auto_resolve_events.includes(card)) { - return true - } else { + else { return false } } @@ -4670,6 +4720,7 @@ function vm_eliminate(space_id) { // Eliminate the democrat influence and move t } } + function get_adjusted_adjacency(space_id) { let adjacent_spaces = spaces[space_id].adjacent; if (adjacent_spaces.includes(game.systematization)) { |