From bc4f9c520a403e7dea42e9c9d9198afab8a8f858 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 8 Nov 2024 02:29:44 +0100 Subject: fix retreat mixed french/bavarian at map edge. --- rules.js | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 04974e2..d29a7d7 100644 --- a/rules.js +++ b/rules.js @@ -117,6 +117,7 @@ const IMPERIAL_ELECTION = 24 const ELIMINATED = data.cities.name.length const ARENBERG = 17 +const BAVARIAN_GENERAL = 18 const SAXONY_GENERAL = 19 const PRUSSIAN_TRAIN_2 = 23 @@ -1317,10 +1318,10 @@ function count_generals(to) { function select_stack(s) { let list = [] - for (let p of all_generals) + for (let p of all_generals_by_rank) if ((game.supreme & (1< 1) + gen_action_piece(BAVARIAN_GENERAL) + else + for (let p of game.selected) + gen_action_piece(p) }, - piece(_) { + piece(p) { log("Trapped.") - for (let p of game.selected) { - game.lost_generals += 1 - game.lost_troops += game.troops[p] - eliminate_general(p, false) - } - finish_combat() + game.lost_generals += 1 + game.lost_troops += game.troops[p] + eliminate_general(p, false) + array_remove_item(game.selected, p) + resume_retreat() }, } @@ -6889,7 +6892,7 @@ exports.action = function (state, _player, action, arg) { /* COMMON FRAMEWORK */ -function goto_game_over(result, reason) { +function goto_game_over(result, victory_reason) { log("# The End") game.active = "None" game.state = "game_over" -- cgit v1.2.3