From b65978f5a15459031a4bdec3aa16c4e39b2520a2 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 3 Oct 2024 13:46:21 +0100 Subject: Added separate state for Common European Home --- events.txt | 1 + rules.js | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/events.txt b/events.txt index 28d5fc6..ca58cf5 100644 --- a/events.txt +++ b/events.txt @@ -543,6 +543,7 @@ permanently_remove CARD 74 - FRG Embassies # +1 for Democratic Support Checks in Eastern Europe the rest of this turn. frg_embassies +permanently_remove CARD 75 - Exit Visas* diff --git a/rules.js b/rules.js index 8584074..4613822 100644 --- a/rules.js +++ b/rules.js @@ -4867,7 +4867,7 @@ function vm_army_backs_revolution() { /*if (game.persistent_events['securitate']) { permanently_remove(70) }*/ - delete game.persistent_events['securitate'] + game.persistent_events['securitate'] game.playable_cards = game.playable_cards.filter(n => n !== 70) /*if (game.table_cards.includes(70)) { permanently_remove(70) @@ -6103,6 +6103,62 @@ states.vm_support_check_prep = { } } +states.vm_ceh_support_check_prep = { + inactive: 'do support checks.', + prompt () { + if (game.available_ops === 0) { + view.prompt = 'Support checks: done.' + gen_action('done') + //return + } + if (game.available_ops > 0) { + view.prompt = `Select a space. ${pluralize(game.available_ops, 'support check')} remaining.` + + for (let space_id of game.valid_spaces) { + gen_action_sc(spaces[space_id].name_unique) + } + } + }, + sc(space) { + push_undo() + game.selected_space = find_space_index(space) + + //Then check Austria-Hungary Border Reopened normally + //console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked) + if (game.vm_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 = 'vm_austria_hungary_border_reopened_check' + return + } + //game.state = 'do_support_check' + } /*else { */ + game.state = 'vm_ceh_do_support_check' + }, + done () { + vm_next () + } +} + + +states.vm_ceh_do_support_check = { + inactive: 'do support checks.', + prompt () { + view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` + gen_action('roll') + }, + roll() { + clear_undo() + do_sc(spaces[game.selected_space].name_unique) + game.vm_available_ops-- + if (game.vm_available_ops === 0) { + game.valid_spaces = [] + } + game.state = 'vm_ceh_support_check_prep' + return + } +} + states.vm_austria_hungary_border_reopened_check = { inactive: 'decide Austria-Hungary Border Reopened', prompt() { @@ -8635,6 +8691,7 @@ CODE[73] = [ // Laszlo Tokes* CODE[74] = [ // FRG Embassies [ vm_frg_embassies ], + [ vm_permanently_remove ], [ vm_return ], ] -- cgit v1.2.3