From 5ba70b89a7ecb8c4f7b64bcdf4f8c4d30eaeeb44 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Wed, 25 Sep 2024 13:00:29 +0100 Subject: Fix for Deutsche Marks and table cards --- rules.js | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 847e0e6..b5e8ede 100644 --- a/rules.js +++ b/rules.js @@ -2062,6 +2062,10 @@ states.stasi_play_card = { } } +states.stasi_common_european_home = { + +} + // ==================== SUPPORTING STATE FUNCTIONS ============================= @@ -2939,11 +2943,13 @@ function get_value(country) { function permanently_remove(card) { console.log('card:', card) log_msg_gap(`C${cards[card].number} permanently removed`) - let card_index = game.strategy_discard.indexOf(card) + remove_from_discard(card) + + /*let card_index = game.strategy_discard.indexOf(card) if (card_index !== -1) { console.log('sub 1 called') game.strategy_discard.splice(card_index, 1) - } + }*/ card_index = game.table_cards.indexOf(card) if (card_index !== -1) { console.log('sub 2 called') @@ -3414,6 +3420,13 @@ function silent_discard(card) { } } +function remove_from_discard(card) { + let card_index = game.strategy_discard.indexOf(card) + if (card_index !== -1) { + game.strategy_discard.splice(card_index, 1) + } +} + function discard_card(hand) { //let find_card let card = Math.floor(Math.random()*hand.length) @@ -4496,17 +4509,21 @@ function vm_adamec() { } function vm_army_backs_revolution() { + if (game.persistent_events['securitate']) { + permanently_remove(70) + } game.persistent_events['securitate'] = false game.playable_cards[70].playable = 0 - if (game.table_cards.includes(70)) { + /*if (game.table_cards.includes(70)) { permanently_remove(70) - } + }*/ vm_next() } function vm_austria_hungary_border_reopened() { game.persistent_events['austria_hungary_border_reopened'] = true game.table_cards.push(58) + remove_from_discard(58) vm_next() } @@ -4650,6 +4667,7 @@ function vm_eco_glasnost() { function vm_elena(){ game.persistent_events['elena'] = true game.table_cards.push(101) + remove_from_discard(101) vm_next() } @@ -4706,6 +4724,7 @@ function vm_foreign_currency_debt_burden() { return } game.table_cards.push(49) + remove_from_discard(49) game.state = 'vm_foreign_currency_debt_burden' } @@ -4722,6 +4741,7 @@ function vm_foreign_television() { function vm_frg_embassies() { game.persistent_events['frg_embassies'] = true game.table_cards.push(74) + remove_from_discard(74) log('C74 in effect') vm_next() } @@ -4729,6 +4749,7 @@ function vm_frg_embassies() { function vm_general_strike() { game.persistent_events['general_strike'] = true game.table_cards.push(5) + remove_from_discard(5) log('C5 in effect') vm_next() } @@ -4736,6 +4757,7 @@ function vm_general_strike() { function vm_genscher() { game.persistent_events['genscher'] = true game.table_cards.push(63) + remove_from_discard(63) log(`C63 in effect`) vm_next() } @@ -4774,6 +4796,7 @@ 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) vm_next() } @@ -4896,6 +4919,7 @@ function vm_legacy_of_1968() { function vm_li_peng() { game.persistent_events['li_peng'] = true game.table_cards.push(53) + remove_from_discard(53) vm_next() } @@ -4921,6 +4945,7 @@ function vm_modrow() { function vm_national_salvation_front() { game.persistent_events['national_salvation_front'] = true game.table_cards.push(102) + remove_from_discard(102) vm_next() } @@ -4947,6 +4972,7 @@ function vm_peasant_parties_revolt() { game.persistent_events['peasant_parties_revolt'] = true log_msg_gap('C72 in effect') game.table_cards.push(72) + remove_from_discard(72) vm_next() } @@ -5001,6 +5027,7 @@ function vm_power_struggle() { function vm_presidential_visit() { game.persistent_events['presidential_visit'] = true game.table_cards.push(65) + remove_from_discard(65) log_msg_gap('C65 in effect') vm_next() } @@ -5035,6 +5062,7 @@ function vm_reformer_rehabilitated () { function vm_roundtable_talks() { game.persistent_events['roundtable_talks'] = true game.table_cards.push(17) + remove_from_discard(17) log_msg_gap('C17 in effect') vm_next() } @@ -5066,7 +5094,7 @@ function vm_samizdat() { function vm_securitate() { game.persistent_events['securitate'] = true - game.table_cards.push(70) + //game.table_cards.push(70) vm_next() } @@ -5102,7 +5130,7 @@ function vm_stand_fast() { if (game.active === DEM) { game.persistent_events['stand_fast'] = DEM } else {game.persistent_events['stand_fast'] = COM} - game.table_cards.push(100) + //game.table_cards.push(100) vm_next() } @@ -5120,6 +5148,7 @@ function vm_tank_column() { function vm_tear_gas () { game.persistent_events['tear_gas']= true game.table_cards.push(30) + remove_from_discard(30) log_msg_gap('C30 in effect') vm_next() } @@ -5145,6 +5174,7 @@ function vm_the_chinese_solution() { function vm_the_crowd_turns_against_ceausescu() { //game.persistent_events['the_crowd_turns_against_ceausescu'] = true game.table_cards.push(54) + remove_from_discard(54) game.playable_cards[97].playable = 1 vm_next() } @@ -5185,6 +5215,7 @@ function vm_the_tyrant_is_gone() { function vm_the_tyrant_is_gone_prep() { game.table_cards.push(97) + remove_from_discard(97) vm_next() } @@ -5243,6 +5274,7 @@ function vm_yakovlev_counsels_gorbachev() { game.persistent_events['yakovlev'] = true log_msg_gap('C62 in effect') game.table_cards.push(62) + remove_from_discard(62) vm_next() } @@ -6379,7 +6411,7 @@ states.vm_kiss_of_death_finish = { }, prompt() { console.log('game.vm_event', game.vm_event) - if (game.vm_event > 0 && (cards[game.vm_event].side === 'D' || cards[game.vm_event].side === 'N')) { + if (game.vm_event > 0 && game.vm_event !== 21 && (cards[game.vm_event].side === 'D' || cards[game.vm_event].side === 'N')) { view.prompt = `Play ${cards[game.vm_event].name} for the event.` console.log('kiss of death before event button: game.stategy_discard', game.strategy_discard) gen_action('event') @@ -6664,7 +6696,7 @@ states.vm_new_years_eve_party = { if (check_vp()) { return } - game.table_cards.push(104) + //game.table_cards.push(104) vm_next() }, continue() { -- cgit v1.2.3