From da0546400fb89739aaccc83e182569dab67d5cb2 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 18:44:01 +0000 Subject: Fix Deutsche Marks --- Map.docx | Bin 0 -> 44689 bytes data.xlsx | Bin 0 -> 340281 bytes output.txt | 0 rules.js | 21 +++++++++------------ server.code-workspace | 10 ++++++++++ 5 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 Map.docx create mode 100644 data.xlsx create mode 100644 output.txt create mode 100644 server.code-workspace diff --git a/Map.docx b/Map.docx new file mode 100644 index 0000000..e23d852 Binary files /dev/null and b/Map.docx differ diff --git a/data.xlsx b/data.xlsx new file mode 100644 index 0000000..fd1cb69 Binary files /dev/null and b/data.xlsx differ diff --git a/output.txt b/output.txt new file mode 100644 index 0000000..e69de29 diff --git a/rules.js b/rules.js index ef4a9af..30b7848 100644 --- a/rules.js +++ b/rules.js @@ -1650,16 +1650,16 @@ states.vp_roll = { } }, roll () { - let vp_change = vp_roll[get_aftermath_roll()] + let roll = get_aftermath_roll() + let vp_change = vp_roll[roll] if (game.active === DEM) { log(`+${vp_change} VP`) } else { log(`-${vp_change} VP`) } - if (roll >= 4) if (game.active === DEM) {game.vp += vp_change} else {game.vp -= vp_change} - if (game.active === DEM && modified_roll >= 4) { + if (game.active === DEM && roll >= 4) { game.phase = 1 } else { game.phase = 0 @@ -4832,19 +4832,18 @@ function vm_civic_forum() { } function vm_common_european_home() { - let valid_cards = [] - for (let c = first_strategy_card; c <= last_strategy_card; ++c) { + let hands = [...game.democrat_hand, ...game.communist_hand] + for (let c of hands) { if (game.active === DEM) { if (cards[c].side === 'C') { - valid_cards.push(c) + game.valid_cards.push(c) } } else { if (cards[c].side === 'D') { - valid_cards.push(c) + game.valid_cards.push(c) } } } - game.valid_cards = valid_cards game.state = "vm_common_european_home_choose" } @@ -6352,10 +6351,8 @@ states.vm_deutsche_marks_confirm = { gen_action('done') }, done() { - if (cards[game.vm_event].side === "C") { - if (is_auto_resolve(game.vm_event) || switch_events.includes(game.vm_event)) { - goto_vm(game.vm_event) - } + if (cards[game.vm_event].side === "C" && (is_auto_resolve(game.vm_event) || switch_events.includes(game.vm_event))) { + goto_vm(game.vm_event) } else { next_player() game.state = 'vm_deutsche_marks' diff --git a/server.code-workspace b/server.code-workspace new file mode 100644 index 0000000..449c3b1 --- /dev/null +++ b/server.code-workspace @@ -0,0 +1,10 @@ +{ + "folders": [ + { + "path": "." + }, + { + "path": "../.." + } + ] +} \ No newline at end of file -- cgit v1.2.3