From e4cf9f359261b1fc2ce24c6f2d668d5700650548 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 6 Oct 2024 09:35:57 +0100 Subject: Consistent use of valid_spaces_country_opp --- events.txt | 10 +++++----- rules.js | 52 ++++++++++++++++++++-------------------------------- 2 files changed, 25 insertions(+), 37 deletions(-) diff --git a/events.txt b/events.txt index 2ab7233..c8ca6eb 100644 --- a/events.txt +++ b/events.txt @@ -297,7 +297,7 @@ permanently_remove 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. if !game.the_tyrant_is_gone -valid_spaces_country_sc 'Romania' +valid_spaces_country_opp 'Romania' prompt ' from Romania' remove_opp_infl 3 valid_spaces_country_sc 'Romania' @@ -322,7 +322,7 @@ power_struggle CARD 44 - Inflationary Currency # Target any Country where your opponent has Power. Place 2 SPs and make 1 Support Check in the Country using the Ops value of this card. Your opponent may cancel the Support Check by discarding a 3 Ops value card. inflationary_currency -valid_spaces_country_sc +valid_spaces_country_opp prompt ()=>` from ${country_name(game.vm_active_country)}` remove_opp_infl 2 inflationary_currency_discard @@ -604,7 +604,7 @@ permanently_remove CARD 82 - Spitzel* # Remove 2 Democratic SPs in Germany. -valid_spaces_country_sc 'East_Germany' +valid_spaces_country_opp 'East_Germany' prompt ' from East Germany' remove_opp_infl 2 permanently_remove @@ -706,7 +706,7 @@ permanently_remove CARD 94 - Union of Democratic Forces* # Remove 4 Communist SPs from Bulgaria. Democratic Player may make Support Checks in Bulgaria using the Ops value of this card if the Bulgarian writers space is Democratically controlled. -valid_spaces_country_sc 'Bulgaria' +valid_spaces_country_opp 'Bulgaria' prompt ' from Bulgaria' remove_opp_infl 4 valid_spaces_country_sc 'Bulgaria' @@ -744,7 +744,7 @@ endif CARD 98 - Politburo Intrigue* # Remove 3 Democratic SPs in Bulgaria, no more than 2 per space. Then make one Support Check in Bulgaria, using the Ops value of this card. -valid_spaces_country_sc 'Bulgaria' +valid_spaces_country_opp 'Bulgaria' prompt ' from Bulgaria' remove_limited_opp_infl 3 2 valid_spaces_country_sc 'Bulgaria' diff --git a/rules.js b/rules.js index fa7c869..b9f1610 100644 --- a/rules.js +++ b/rules.js @@ -2533,26 +2533,19 @@ function valid_spaces_sc() { infl = game.demInfl[i] //if (infl !== 0 ) { // Check Solidarity Legalised - if (game.persistent_events.includes(2)) { - if (space.space_id === 14) {continue} - } + if (game.persistent_events.includes(2) && space.space_id === 14) {continue} + // Check Civic Forum - if (game.persistent_events.includes(90)) { - if (space.space_id === 30) {continue} - } + if (game.persistent_events.includes(90) && space.space_id === 30) {continue} + // Check We Are the People - if (game.persistent_events.includes(48)) { - if (space.space_id === 9) {continue} - } - valid_spaces_set.add(space.space_id); + if (game.persistent_events.includes(48) && space.space_id === 9) {continue} //Check for Foreign Currency Debt Burden - if (game.persistent_events.includes(49)) { - for (let n of valid_spaces_set) { - if (spaces[n].country === game.foreign_currency_debt_burden) { - valid_spaces_set.delete(n); - } - } + if (game.persistent_events.includes(49) && space.country === game.foreign_currency_debt_burden) {continue} { + + valid_spaces_set.add(space.space_id); + } //} } @@ -4474,15 +4467,18 @@ function vm_valid_spaces_country_sc () { //Check We are the People if (game.persistent_events.includes(48) && space.space_id === 9) {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} } } } game.valid_spaces = valid_spaces //Check for Foreign Currency Debt Burden - if (game.persistent_events.includes(49) && game.active === DEM) { + /*if (game.persistent_events.includes(49) && game.active === COM) { game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country !== game.foreign_currency_debt_burden) - } + }*/ vm_next() } @@ -8647,7 +8643,7 @@ CODE[40] = [ // Hungarian Democratic Forum CODE[41] = [ // Ceausescu* [ vm_if, ()=>!game.the_tyrant_is_gone ], - [ vm_valid_spaces_country_sc, 'Romania' ], + [ vm_valid_spaces_country_opp, 'Romania' ], [ vm_prompt, ' from Romania' ], [ vm_remove_opp_infl, 3 ], [ vm_valid_spaces_country_sc, 'Romania' ], @@ -8672,7 +8668,7 @@ CODE[43] = [ // Power Struggle - Bulgaria CODE[44] = [ // Inflationary Currency [ vm_inflationary_currency ], - [ vm_valid_spaces_country_sc ], + [ vm_valid_spaces_country_opp ], [ vm_prompt, ()=>` from ${country_name(game.vm_active_country)}` ], [ vm_remove_opp_infl, 2 ], [ vm_inflationary_currency_discard ], @@ -8953,7 +8949,7 @@ CODE[81] = [ // The Baltic Way* ] CODE[82] = [ // Spitzel* - [ vm_valid_spaces_country_sc, 'East_Germany' ], + [ vm_valid_spaces_country_opp, 'East_Germany' ], [ vm_prompt, ' from East Germany' ], [ vm_remove_opp_infl, 2 ], [ vm_permanently_remove ], @@ -9055,7 +9051,7 @@ CODE[93] = [ // Shock Therapy* ] CODE[94] = [ // Union of Democratic Forces* - [ vm_valid_spaces_country_sc, 'Bulgaria' ], + [ vm_valid_spaces_country_opp, 'Bulgaria' ], [ vm_prompt, ' from Bulgaria' ], [ vm_remove_opp_infl, 4 ], [ vm_valid_spaces_country_sc, 'Bulgaria' ], @@ -9080,7 +9076,7 @@ CODE[96] = [ // The Chinese Solution* ] CODE[97] = [ // The Tyrant is Gone* - [ vm_if, ()=>game.persistent_events.includes(54) ], + [ vm_if, ()=>game.persistent_events['the_crowd_turns_against_ceausescu'] ], [ vm_valid_spaces, 51 ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], @@ -9093,7 +9089,7 @@ CODE[97] = [ // The Tyrant is Gone* ] CODE[98] = [ // Politburo Intrigue* - [ vm_valid_spaces_country_sc, 'Bulgaria' ], + [ vm_valid_spaces_country_opp, 'Bulgaria' ], [ vm_prompt, ' from Bulgaria' ], [ vm_remove_limited_opp_infl, 3, 2 ], [ vm_valid_spaces_country_sc, 'Bulgaria' ], @@ -9201,14 +9197,6 @@ CODE[110] = [ // Malta Summit* // #endregion - - - - - - - - // ============= TIANANMEN SQUARE TRACK AWARDS ==================== CODE[203] = [//Tiananmen Square space 3 award [vm_tst_3], -- cgit v1.2.3