summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-11-20 18:30:59 +0000
committeriainp5 <iain.pearce.ip@gmail.com>2024-11-20 18:30:59 +0000
commit177fc1531455a29b5b5bec6062f2b75e7decbc9c (patch)
tree3f3bafda23973860fa7056bfc191d8844b0fda15
parent9e0b8bc097d14cc46fb4334fb321734061dc7407 (diff)
download1989-dawn-of-freedom-177fc1531455a29b5b5bec6062f2b75e7decbc9c.tar.gz
Update handling of conditional autoresolves when playing own card
-rw-r--r--rules.js36
1 files changed, 18 insertions, 18 deletions
diff --git a/rules.js b/rules.js
index 570a6fb..95c8530 100644
--- a/rules.js
+++ b/rules.js
@@ -2996,28 +2996,28 @@ function is_auto_resolve(card) {
else if (card === C_KOHL_PROPOSES_REUNIFICATION && !game.persistent_events.includes(C_THE_WALL_MUST_GO)) {
return true
}
- else if (card === C_BROUGHT_IN_FOR_QUESTIONING ) {
+ else if (card === C_BROUGHT_IN_FOR_QUESTIONING && game.active === DEM) {
if (game.democrat_hand.length === 0) {
if (!game.state.startsWith('vm')) { logi('Democrat has no cards to discard') }
return true }
}
- else if (card === C_DEUTSCHE_MARKS) {
+ else if (card === C_DEUTSCHE_MARKS && game.active === DEM) {
if (game.democrat_hand.length === 0) {
if (!game.state.startsWith('vm')) { logi('Democrat has no cards to give') }
return true }
}
- else if (card === C_KISS_OF_DEATH ) {
+ else if (card === C_KISS_OF_DEATH && game.active === COM) {
if (game.communist_hand.length === 0) {
if (!game.state.startsWith('vm')) { logi('Communist has no cards to discard') }
return true }
}
- else if (card === C_DISSIDENT_ARRESTED) {
+ else if (card === C_DISSIDENT_ARRESTED && game.active === DEM) {
let dem_intellectual_infl = spaces.filter(space => space.socio === 5 && game.demInfl[space.space_id] > 0).length
if (dem_intellectual_infl === 0) {
if (!game.state.startsWith('vm')) { logi('No influence to remove') }
return true
}
- } else if (card === C_SAJUDIS || card === C_THE_BALTIC_WAY) {
+ } else if ((card === C_SAJUDIS || card === C_THE_BALTIC_WAY) && game.active === COM) {
if (game.systematization && game.systematization === S_HARGHITA_COVASNA ) {
if (check_dem_control(S_RAZGRAD)) {
if (!game.state.startsWith('vm')) { logi('Minorities spaces already controlled') }
@@ -3034,13 +3034,13 @@ function is_auto_resolve(card) {
return true
}
}
- else if (card === C_WE_ARE_THE_PEOPLE) {
+ else if (card === C_WE_ARE_THE_PEOPLE && game.active === COM) {
if (game.demInfl[S_LUTHERAN_CHURCH] === 0) {
if (!game.state.startsWith('vm')) { logi('No influence to remove') }
return true
}
}
- else if (card === C_BETRAYAL) {
+ else if (card === C_BETRAYAL && game.active === DEM) {
if (!game.systematization === S_ORTHODOX_CHURCH_ROMANIA) {
if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] === 0) {
if (!game.state.startsWith('vm')) { logi('No influence to remove') }
@@ -3051,64 +3051,64 @@ function is_auto_resolve(card) {
return true
}
}
- else if (card === C_GOVERNMENT_RESIGNS) {
+ else if (card === C_GOVERNMENT_RESIGNS && game.active === COM) {
let uncontrolled_elites = spaces.filter( space => spaces[space.space_id].socio === 1 && game.comInfl[space.space_id] > 0 && !check_control(space.space_id)).length
if (uncontrolled_elites === 0) {
if (!game.state.startsWith('vm')) { logi('No uncontrolled Elite spaces') }
return true
}
- } else if (card === C_ST_NICHOLAS_CHURCH) {
+ } else if (card === C_ST_NICHOLAS_CHURCH && game.active === COM) {
if (check_dem_control(S_LUTHERAN_CHURCH)) {
if (!game.state.startsWith('vm')) { logi('Lutheran Church already controlled') }
return true
}
- } else if (card === C_BULGARIAN_TURKS_EXPELLED) {
+ } else if (card === C_BULGARIAN_TURKS_EXPELLED && game.active === DEM) {
if (game.demInfl[S_RAZGRAD] === 0 ) {
if (!game.state.startsWith('vm')) { logi('No influence to remove') }
return true
}
- } else if (card === C_NORMALIZATION) {
+ } else if (card === C_NORMALIZATION && game.active === DEM) {
if (game.demInfl[S_PRAHA] === 0 && game.demInfl[S_PLZEN] === 0 ) {
if (!game.state.startsWith('vm')) { logi('No influence to remove') }
return true
}
} else if (card === C_DOMINO_THEORY) {
if (game.revolutions.filter(value => value === true).length < 2) {
- if (!game.state.startsWith('vm')) { logi('Democrat holds power in fewer than 2 countries') }
+ logi('Democrat holds power in fewer than 2 countries')
return true
} else if (!scoring_cards.some(card => game.strategy_discard.includes(card))) {
if (!game.state.startsWith('vm')) { logi('No scoring cards in discard') }
return true
}
- } else if (card === C_UNION_OF_DEMOCRATIC_FORCES) {
+ } else if (card === C_UNION_OF_DEMOCRATIC_FORCES && game.active === COM) {
let bulgarian_presence = spaces.filter(space => space.country === 'Bulgaria' && game.comInfl[space.space_id] > 0).length
if (bulgarian_presence === 0) {
if (!game.state.startsWith('vm')) { logi('No SPs to remove') }
return true
}
- } else if (card === C_EXIT_VISAS) {
+ } else if (card === C_EXIT_VISAS && game.active === COM) {
if (game.democrat_hand.length === 0) {
if (!game.state.startsWith('vm')) { logi('Democrat has no cards to discard') }
return true
}
- } else if (card === C_SAMIZDAT) {
+ } else if (card === C_SAMIZDAT && game.active === COM) {
if (game.democrat_hand.length === 0) {
if (!game.state.startsWith('vm')) { logi('Democrat has no cards to set aside') }
return true
}
- } else if (card === C_SPITZEL) {
+ } else if (card === C_SPITZEL && game.active === DEM) {
let dem_germany_infl = spaces.filter(space => space.country === 'East_Germany' && game.demInfl[space.space_id] > 0).length
if (dem_germany_infl === 0) {
if (!game.state.startsWith('vm')) { logi('No influence to remove') }
return true
}
- } else if (card === C_MY_FIRST_BANANA) {
+ } else if (card === C_MY_FIRST_BANANA && game.active === COM) {
let com_germany_infl = spaces.filter(space => space.country === 'East_Germany' && game.comInfl[space.space_id] > 0).length
if (com_germany_infl === 0) {
if (!game.state.startsWith('vm')) { logi('No influence to remove') }
return true
}
- } else if (card === C_POLITBURO_INTRIGUE) {
+ } else if (card === C_POLITBURO_INTRIGUE && game.active === DEM) {
let dem_bulgaria_infl = spaces.filter(space => space.country === 'Bulgaria' && game.demInfl[space.space_id] > 0).length
if (dem_bulgaria_infl === 0) {
if (!game.state.startsWith('vm')) { logi('No influence to remove') }