From beba1f7cd37947f98c2b479109e88e8d709f9e4e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 22 Sep 2024 20:09:47 +0100 Subject: Various small updates --- rules.js | 54 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 7 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index e8a3c57..9538139 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, 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, 99, 102, 108] const switch_events = [6, 20, 71] exports.scenarios = [ "Standard" ] @@ -1002,7 +1002,7 @@ states.draw_power_cards = { } // Events which affect cards drawn - if (game.persistent_events['roundtable_talks']) { + if (game.persistent_events['roundtable_talks'] && game.com_pwr_hand_limit > 2) { log('Democrat receives 2 cards from Communist due to C17') game.dem_pwr_hand_limit += 2 game.com_pwr_hand_limit -= 2 @@ -1010,7 +1010,23 @@ states.draw_power_cards = { game.persistent_events['roundtable_talks'] = false } - if (game.persistent_events['national_salvation_front'] && (game.pwr_struggle_in === 'Romania' || game.pwr_struggle_in === 'Bulgaria')) { + if (game.persistent_events['peasant_parties_revolt'] && game.com_pwr_hand_limit > 1) { + let farmer_check = false + for (let space of spaces) { + if (space && space.country === game.pwr_struggle_in && game.socio === 3 && space.demCtrl === 1) { + farmer_check = true + } + } + if (farmer_check) { + log('Democrat receives 1 card from Communist due to C72') + game.dem_pwr_hand_limit += 1 + game.com_pwr_hand_limit -= 1 + permanently_remove(72) + game.persistent_events['peasant_parties_revolt'] = false + } + } + + if (game.persistent_events['national_salvation_front'] && (game.pwr_struggle_in === 'Romania' || game.pwr_struggle_in === 'Bulgaria') && game.dem_pwr_hand_limit > 2) { log('Communist receives 2 cards from Democrat due to C102') game.dem_pwr_hand_limit -= 2 game.com_pwr_hand_limit += 2 @@ -1422,7 +1438,7 @@ states.support_loss ={ view.prompt = 'Support Loss: finished.' gen_action('done') } else if (game.phase === 1 && game.valid_spaces.length === 0) { - view.prompt = 'No remaining influence to remove.' + view.prompt = 'Support Loss: no remaining influence to remove.' gen_action('done') } }, @@ -1458,6 +1474,9 @@ states.support_loss ={ log(`Modified roll: ${modified_roll}`) } game.available_ops = support_loss_roll[modified_roll] + if (game.available_ops === 0) { + log('Does not remove influence') + } game.phase++ valid_spaces_support_loss() }, @@ -4953,6 +4972,16 @@ function vm_roundtable_talks() { vm_next() } +function vm_sajudis_check() { + if (spaces[56].demCtrl !== 1) { + game.valid_spaces.push(56) + } + if (spaces[70].demCtrl !== 1) { + game.valid_spaces.push(70) + } + vm_next() +} + function vm_sajudis() { game.playable_cards[81].playable = 1 game.stability++ @@ -5841,10 +5870,11 @@ states.vm_play_event_from_discard = { prompt() { if (game.valid_cards.length === 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no valid cards in discard.` - gen_action('done') + gen_action('pass') } else if (game.temp === 0) { view.prompt = `${event_prompt()}.` for (let card of game.valid_cards) { + gen_action('pass') gen_action_card(card) } } else { @@ -5863,6 +5893,15 @@ states.vm_play_event_from_discard = { if (switch_events.includes(card)) {next_player()} goto_vm(card) }, + pass(){ + push_undo() + if (game.valid_cards.length === 0) { + log('No valid cards to choose') + } else{ + log('Did not choose a card') + } + vm_next() + }, done(){ game.discard = false vm_next() @@ -7032,7 +7071,7 @@ states.vm_warsaw_pact_summit = { return `resolve ${cards[game.played_card].name}.` }, prompt() { - view.prompt = 'Choose to play for support checks or influence.' + view.prompt = 'Choose to play for support checks or place SPs.' gen_action('influence') gen_action('support_check') }, @@ -7669,7 +7708,7 @@ CODE[32] = [ // Peasant Parties* ] CODE[33] = [ // Sajudis* - [ vm_valid_spaces, 56, 70 ], + [ vm_sajudis_check ], [ vm_prompt, 'any Minorities space' ], [ vm_take_control_prep, 1 ], [ vm_sajudis ], @@ -7693,6 +7732,7 @@ CODE[35] = [ // Heal our Bleeding Wounds* CODE[36] = [ // Dash for the West* [ vm_permanently_remove ], + [ vm_prompt, 'select any Democratic event with an asterix(*) from the discard pile. Event occurs immediately.'], [ vm_dash_for_the_west ], [ vm_return ], ] -- cgit v1.2.3