From 7d0809e94fc27048e845cc738ca50104afff935c Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 17 Sep 2024 18:39:39 +0100 Subject: Fix Kiss of Death with no cards --- rules.js | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index ea60afd..6f3a8bb 100644 --- a/rules.js +++ b/rules.js @@ -5324,6 +5324,18 @@ states.vm_support_check_prep = { sc(space) { push_undo() game.selected_space = find_space_index(space) + + // Check for Austria-Hungary Border Reopened - check on first support check only + console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked) + if (!game.austria_hungary_border_reopened_checked) { + game.austria_hungary_border_reopened_checked = true + console.log('in ahb check, country, ', spaces[game.selected_space].country, 'ahb', game.persistent_events['austria_hungary_border_reopened']) + if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events['austria_hungary_border_reopened'] && game.active === DEM) { + game.state = 'vm_austria_hungary_border_reopened_check' + return + } + //game.state = 'do_support_check' + } /*else { */ game.state = 'vm_do_support_check' }, done () { @@ -5332,6 +5344,22 @@ states.vm_support_check_prep = { } } +states.vm_austria_hungary_border_reopened_check = { + inactive: 'decide Austria-Hungary Border Reopened', + prompt() { + view.prompt = 'Austria-Hungary Border Reopened: will all support checks be in East Germany?' + gen_action('yes') + gen_action('no') + }, + yes() { + game.austria_hungary_border_reopened_used = true + game.state = 'vm_do_support_check' + }, + no() { + game.state = 'vm_do_support_check' + } +} + states.vm_1_support_check_prep = { inactive: 'do support checks.', prompt () { @@ -5991,16 +6019,23 @@ states.vm_kiss_of_death = { return `resolve ${cards[game.played_card].name}.` }, prompt() { - //if (game.temp === 0) { + if (game.communist_hand.length === 0) { + view.prompt = 'Kiss of Death. No cards to discard.' + gen_action('pass') + } else { view.prompt = 'Kiss of Death: you must randomly discard a card.' gen_action('discard') - //} + } }, discard() { game.vm_event = discard_card(game.communist_hand) next_player() game.state = 'vm_kiss_of_death_finish' }, + pass() { + log('No cards to discard') + vm_next() + } } states.vm_kiss_of_death_finish = { -- cgit v1.2.3