From e1b09f952f52a0163a969b9c200d8b5fc3c50090 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Wed, 23 Oct 2024 20:23:23 +0100 Subject: Tweaks to New Years Eve Party --- rules.js | 89 ++++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 27 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index aa8cb3a..4112e7f 100644 --- a/rules.js +++ b/rules.js @@ -21,7 +21,7 @@ const countries = ['Poland', 'Hungary', 'East_Germany', 'Bulgaria', 'Czechoslova const elite_spaces = [12, 15, 27, 43, 51, 69] const all_power_cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ] const numberless_cards = [25, 26, 27, 28, 29, 30, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52] -const auto_resolve_events = [5, 8, 9, 13, 17, 25, 26, 30, 35, 50, 53, 54, 58, 59, 62, 63, 65, 70, 72, 74, 99, 102, 108] +const auto_resolve_events = [5, 8, 9, 13, 17, 25, 26, 30, 35, 50, 53, 54, 58, 59, 62, 63, 65, 70, 72, 74, 86, 99, 102, 108] const switch_events = [6, 20, 71] exports.scenarios = [ "Standard" ] @@ -1396,7 +1396,7 @@ states.begin_power_struggle = { states.power_struggle = { inactive: 'play a card.', prompt () { - //console.log('game.tactics_fails', game.tactics_fails) + console.log('game.vm_event', game.vm_event) if (game.phase === 0) { if (game.valid_cards.length > 0) { view.prompt = "Play a card." @@ -1576,22 +1576,40 @@ states.power_struggle = { states.support_loss ={ inactive: 'do Support Loss.', prompt () { - //console.log('game.played_power_card', game.played_power_card) - if (game.phase === 0) { - view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' - gen_action('roll') - } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { - view.prompt = `Support Loss: remove ${pluralize(game.available_ops,'SP')}.` - - for (let space_id of game.valid_spaces) { - gen_action_infl(space_id) + if (!game.vm_event === 104) { + if (game.phase === 0) { + view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' + gen_action('roll') + } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` + + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id) + } + } else if (game.phase === 1 && game.available_ops === 0 ) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` + gen_action('done') + } else if (game.phase === 1 && game.valid_spaces.length === 0) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}. Support Loss: no remaining SPs to remove.` + gen_action('done') + } + } else { + if (game.phase === 0) { + view.prompt = 'You lost the Power Struggle. Roll a die for Support Loss.' + gen_action('roll') + } else if (game.phase === 1 && game.available_ops > 0 && game.valid_spaces.length > 0) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: remove ${pluralize(game.available_ops,'SP')}.` + + for (let space_id of game.valid_spaces) { + gen_action_infl(space_id) + } + } else if (game.phase === 1 && game.available_ops === 0 ) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: finished.` + gen_action('done') + } else if (game.phase === 1 && game.valid_spaces.length === 0) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}. Support Loss: no remaining SPs to remove.` + gen_action('done') } - } else if (game.phase === 1 && game.available_ops === 0 ) { - view.prompt = 'Support Loss: finished.' - gen_action('done') - } else if (game.phase === 1 && game.valid_spaces.length === 0) { - view.prompt = 'Support Loss: no remaining SPs to remove.' - gen_action('done') } }, roll () { @@ -1657,15 +1675,28 @@ states.support_loss ={ states.vp_roll = { inactive: 'do VP Roll.', prompt () { - if (game.phase === 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: roll a die for Victory.` - gen_action('roll') - } else if (game.phase === 1) { - view.prompt = `${clean_name(cards[this_card()].name)}: take power.` - gen_action('take') - } else if (game.phase === 2) { - view.prompt = `${clean_name(cards[this_card()].name)}: proceed to scoring.` - gen_action('scoring') + if (!game.vm_event === 104) { + if (game.phase === 0) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: roll a die for Victory.` + gen_action('roll') + } else if (game.phase === 1) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: take power.` + gen_action('take') + } else if (game.phase === 2) { + view.prompt = `Power Struggle - ${country_name(game.pwr_struggle_in)}: proceed to scoring.` + gen_action('scoring') + } + } else { + if (game.phase === 0) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: roll a die for Victory.` + gen_action('roll') + } else if (game.phase === 1) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: take power.` + gen_action('take') + } else if (game.phase === 2) { + view.prompt = `New Year's Eve Party - ${country_name(game.pwr_struggle_in)}: proceed to scoring.` + gen_action('scoring') + } } }, roll () { @@ -1868,6 +1899,7 @@ states.end_turn_4_5_4 = { } else if (game.persistent_events.includes(104)) { log_h1(`New Year's Eve Party`) + game.vm_event = 104 //Check if the Communist receives VP from The Tyrant is Gone if (game.persistent_events.includes(97)) { game.vp -= 2 @@ -3342,7 +3374,7 @@ function find_event(card) { } function is_auto_resolve(card) { - //Check for the Tyrant is Gone + let ceausecu_events = [10, 41, 101, 107] if (card === 97) { @@ -3353,6 +3385,9 @@ function is_auto_resolve(card) { else if (ceausecu_events.includes(card) && game.persistent_events.includes(97)) { return true } + else if (card === 87 && !game.persistent_events.includes(86)) { + return true + } else if (auto_resolve_events.includes(card)) { return true } else { -- cgit v1.2.3