From c0b373f5e05dbc64c81c1be9be86d167207a5366 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 26 Sep 2024 08:39:04 +0100 Subject: Updates to Deutsche Marks, Inflationary Currecy, old table cards --- rules.js | 97 ++++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 70 insertions(+), 27 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 621918d..7bcc875 100644 --- a/rules.js +++ b/rules.js @@ -3250,36 +3250,42 @@ function new_turn() { console.log('in new turn') if (game.persistent_events['austria_hungary_border_reopened']) { game.persistent_events['austria_hungary_border_reopened'] = false - permanently_remove(58) + log(`C58 no longer in effect`) + //permanently_remove(58) } if (game.persistent_events['elena']) { game.persistent_events['elena'] = false - permanently_remove(101) + log(`C101 no longer in effect`) + //permanently_remove(101) } if (game.persistent_events['grenztruppen']) { game.persistent_events['grenztruppen'] = false - permanently_remove(59) + log(`C59 no longer in effect`) + //permanently_remove(59) } if (game.persistent_events['foreign_currency_debt_burden'] !== '') { game.persistent_events['foreign_currency_debt_burden'] = '' - permanently_remove(49) + log(`C49 no longer in effect`) + //permanently_remove(49) } if (game.persistent_events['frg_embassies']) { - console.log('in new turn - frg embassies check') game.persistent_events['frg_embassies'] = false - permanently_remove(74) + log(`C74 no longer in effect`) + //permanently_remove(74) } if (game.persistent_events['genscher']) { game.persistent_events['genscher'] = false - permanently_remove(63) + log(`C63 no longer in effect`) + //permanently_remove(63) } if (game.persistent_events['stand_fast'] !== '') { game.persistent_events['stand_fast'] = '' - permanently_remove(100) + log(`C100 no longer in effect`) + //permanently_remove(100) } if (game.samizdat_card > 0 ) { @@ -3574,6 +3580,35 @@ function this_card() { return game.vm_event > 0 ? game.vm_event : game.played_card } +function get_ops(card) { + let ops = cards[card].ops + if (game.active === COM) { + //Check TST op bonus + if (ops === 1 && game.com_tst_position >=2 && game.dem_tst_position <=1) { + ops++ + } + //Events that influence ops + if (game.persistent_events['perestroika']) { + ops++ + } + ops += game.persistent_events['prudence'].COM + + } else { + //Check TST op bonus + if (ops === 1 && game.dem_tst_position >=2 && game.com_tst_position <=1) { + ops++ + } + //Events that influence ops + if (game.persistent_events['sinatra_doctrine']) { + ops++ + } + ops += game.persistent_events['prudence'].DEM + } + //Ops can never be less than one + if (ops <1) { ops = 1 } + return ops +} + const pluralize = (count, noun, suffix = 's') => `${count} ${noun}${Math.abs(count) !== 1 ? suffix : ''}` @@ -4567,8 +4602,9 @@ function vm_army_backs_revolution() { function vm_austria_hungary_border_reopened() { game.persistent_events['austria_hungary_border_reopened'] = true - game.table_cards.push(58) - remove_from_discard(58) + permanently_remove(58) + //game.table_cards.push(58) + //remove_from_discard(58) vm_next() } @@ -4711,8 +4747,9 @@ function vm_eco_glasnost() { function vm_elena(){ game.persistent_events['elena'] = true - game.table_cards.push(101) - remove_from_discard(101) + permanently_remove(101) + //game.table_cards.push(101) + //remove_from_discard(101) vm_next() } @@ -4840,8 +4877,9 @@ function vm_government_resigns() { function vm_grenztruppen() { console.log('in grenztruppen - player active:', game.active) game.persistent_events['grenztruppen'] = true - game.table_cards.push(59) - remove_from_discard(59) + permanently_remove(59) + //game.table_cards.push(59) + //remove_from_discard(59) vm_next() } @@ -4882,22 +4920,22 @@ function vm_inflationary_currency() { } function vm_inflationary_currency_discard() { - for (let card of game.communist_hand){ - if (game.persistent_events['perestroika']) { - if (cards[card].ops >= 2) { + // This function starts with the player who is playing Inflationary Currency for the Event + // Switch player and check the hand of their opponent to see if the have cards with ops > 3 to discard + next_player() + if (game.active === COM) { + for (let card of game.communist_hand){ + if (get_ops(card) >= 3) { game.valid_cards.push(card) } - } else if (game.persistent_events['prudence'].COM !== 0 ) { - if ((cards[card].ops + game.persistent_events['prudence'].COM) >=3 ) { + } + } else { + for (let card of game.democrat_hand){ + if (get_ops(card) >= 3) { game.valid_cards.push(card) } - } else { - if (cards[card].ops >= 3) { - game.valid_cards.push(card) - } } } - next_player() game.state = 'vm_inflationary_currency_discard' } @@ -5071,8 +5109,8 @@ function vm_power_struggle() { function vm_presidential_visit() { game.persistent_events['presidential_visit'] = true - game.table_cards.push(65) - remove_from_discard(65) + //game.table_cards.push(65) + //remove_from_discard(65) log_msg_gap('C65 in effect') vm_next() } @@ -5139,6 +5177,7 @@ function vm_samizdat() { function vm_securitate() { game.persistent_events['securitate'] = true + permanently_remove(70) //game.table_cards.push(70) vm_next() } @@ -6742,6 +6781,7 @@ states.vm_new_years_eve_party = { return } //game.table_cards.push(104) + permanently_remove(104) vm_next() }, continue() { @@ -7802,8 +7842,8 @@ CODE[19] = [ // Papal vist ] CODE[20] = [ // Deutsche Marks* - [ vm_deutsche_marks ], [ vm_permanently_remove ], + [ vm_deutsche_marks ], [ vm_return ], ] @@ -8023,6 +8063,7 @@ CODE[48] = [ // We are the People!* CODE[49] = [ // Foreign Currency Debt Burden* [ vm_foreign_currency_debt_burden ], + [ vm_permanently_remove ], [ vm_return ], ] @@ -8129,6 +8170,7 @@ CODE[64] = [ // Legacy of 1968* CODE[65] = [ // Presidential Visit* [ vm_presidential_visit ], + [ vm_permanently_remove ], [ vm_return ], ] @@ -8509,6 +8551,7 @@ CODE[110] = [ // Malta Summit* + // ============= TIANANMEN SQUARE TRACK AWARDS ==================== CODE[203] = [//Tiananmen Square space 3 award [vm_tst_3], -- cgit v1.2.3