summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-09-17 18:39:39 +0100
committeriainp5 <iain.pearce.ip@gmail.com>2024-09-17 18:39:39 +0100
commit7d0809e94fc27048e845cc738ca50104afff935c (patch)
treefe468bdd02661e5cc859b33caee6e9768080591f
parente80d4e5c5b75e3b2770f0c3019a9b87d31f43fa7 (diff)
download1989-dawn-of-freedom-7d0809e94fc27048e845cc738ca50104afff935c.tar.gz
Fix Kiss of Death with no cards
-rw-r--r--rules.js39
1 files changed, 37 insertions, 2 deletions
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 = {