From 2fd07fac0f8fd2bad64a770b9c701e963d771a40 Mon Sep 17 00:00:00 2001 From: Troy Nordine Date: Sun, 1 Oct 2023 09:59:27 -0500 Subject: Couple of bug fixes in intercept. --- rules.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 891df8c..530e667 100644 --- a/rules.js +++ b/rules.js @@ -26,6 +26,7 @@ function frac(x) { function range(x) { switch (x) { + case 0: return "0" case 1: return "1" case 2: return "1-2" case 3: return "1-3" @@ -3780,7 +3781,6 @@ states.intercept = { if (way !== null && way.type !== "path") { get_lords_in_locale(loc) .filter(is_friendly_lord) - .filter(l => data.lords[l].valour > 0) .forEach(gen_action_lord) } } @@ -3834,7 +3834,7 @@ function goto_intercept_march() { if (count_group_transport(game.intercept_group) >= count_group_assets(PROV, game.intercept_group)) { game.intercept_group .forEach(l => { - set_lord_locale(get_lord_locale(game.command)) + set_lord_locale(l, get_lord_locale(game.command)) set_lord_moved(l, 1) }) end_intercept_march() @@ -3849,6 +3849,15 @@ function end_intercept_march() { goto_intercept_exiles() } +function do_intercept_march() { + game.intercept_group + .forEach(l => { + set_lord_locale(l, get_lord_locale(game.command)) + set_lord_moved(l, 1) + }) + end_intercept_march() +} + states.intercept_march = { inactive: "Intercept", prompt() { @@ -3875,8 +3884,8 @@ states.intercept_march = { }, prov: drop_prov, - intercept: end_intercept_march, - locale: end_intercept_march, + intercept: do_intercept_march, + locale: do_intercept_march, } function is_enemy_lord(lord) { -- cgit v1.2.3