From e5e0d2027b895a6ac142f6476b919819c26df23a Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 20 Sep 2024 19:53:49 +0100 Subject: Fix for AHBR when resolving event --- rules.js | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index 1909f77..6b29c4b 100644 --- a/rules.js +++ b/rules.js @@ -717,7 +717,17 @@ states.finish_support_check_prep = { } }, sc(space) { - game.selected_space = find_space_index(space) + push_undo() + + // 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.available_ops > 1) { + 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 = 'finish_austria_hungary_border_reopened_check' + return + } + } game.state = 'finish_do_support_check' }, done () { @@ -725,6 +735,22 @@ states.finish_support_check_prep = { } } +states.finish_austria_hungary_border_reopened_check = { + inactive: 'decide Austria-Hungary Border Reopened', + prompt() { + view.prompt = 'Austria-Hungary Border Reopened: will both support checks be in East Germany?' + gen_action('yes') + gen_action('no') + }, + yes() { + game.austria_hungary_border_reopened_tracker = true + game.state = 'finish_do_support_check' + }, + no() { + game.state = 'finish_do_support_check' + } +} + states.finish_do_support_check = { inactive: 'do support checks', prompt () { @@ -2698,7 +2724,7 @@ function score_country(country) { log(`Battlegrounds: -${presence.com_battlegrounds} VP`) com_vp -= presence.com_battlegrounds } - log(`Total: -${com_vp} VP`) + log(`Total: ${com_vp} VP`) } else { log('No presence: 0 VP') } @@ -2716,7 +2742,7 @@ function score_country(country) { } log(`Battlegrounds: -${presence.com_battlegrounds} VP`) com_vp -= presence.com_battlegrounds - log(`Total: -${com_vp} VP`) + log(`Total: ${com_vp} VP`) log_gap('Democrat:') if (presence.dem_spaces > 0) { @@ -2744,7 +2770,7 @@ function score_country(country) { log(`Battlegrounds: -${presence.com_battlegrounds} VP`) com_vp -= presence.com_battlegrounds } - log(`Total: -${com_vp} VP`) + log(`Total: ${com_vp} VP`) } else { log('No presence: 0 VP') } -- cgit v1.2.3