diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-27 15:03:03 +0000 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-27 15:03:03 +0000 |
commit | ac994f2e4e8e1db0faa0a189683030fa390a40aa (patch) | |
tree | ced5babc65b64bd207c82968a4635a0c26d2a386 | |
parent | 6d04226467871e4327be2d913dcbb65b9cbff0e7 (diff) | |
download | 1989-dawn-of-freedom-ac994f2e4e8e1db0faa0a189683030fa390a40aa.tar.gz |
Simplify vm support_check code
-rw-r--r-- | rules.js | 34 |
1 files changed, 5 insertions, 29 deletions
@@ -4610,37 +4610,14 @@ function vm_valid_spaces_country_opp () { } function vm_valid_spaces_country_sc () { - let valid_spaces = [] - let country = '' + let active_country if (vm_operand(1)) { - country = vm_operand(1) } + active_country = vm_operand(1) } else { - country = game.vm_active_country - } - for (let space of spaces) { - if (!space) continue - if (game.active === DEM) { - if (space.country === country && game.comInfl[space.space_id] >0) { - valid_spaces.push(space.space_id); - } - } else { - if (space.country === country && game.demInfl[space.space_id] >0) { - //Check Solidarity Legalised - if (game.persistent_events.includes(2) && space.space_id === S_GDANSK) {continue} - - //Check Civic Forum - if (game.persistent_events.includes(90) && space.space_id === S_CHARLES_UNIVERSITY) {continue} - - //Check We are the People - if (game.persistent_events.includes(48) && space.space_id === S_LEIPZIG) {continue} - valid_spaces.push(space.space_id); - - //Check Foreign Currency Debt Burden - if (game.persistent_events.includes(49) && space.country === game.foreign_currency_debt_burden) {continue} - } - } + active_country = game.vm_active_country } - game.valid_spaces = valid_spaces + valid_spaces_sc() + game.valid_spaces = game.valid_spaces.filter( s => spaces[s].country === active_country) vm_next() } @@ -5870,7 +5847,6 @@ function vm_yakovlev_counsels_gorbachev() { function vm_permanently_remove () { // Check if the event is being played as the result of another card, e.g. Dash for the West, is a card which should be removed, and which hasn't already been removed! - console.log('game.vm_event', game.vm_event) if (game.vm_event !== 0 && cards[game.vm_event].remove === 1 && !game.strategy_removed.includes(game.vm_event)) { permanently_remove(game.vm_event) } |