From 263502dd2cc34df0e327bd29d261138359a9fc8b Mon Sep 17 00:00:00 2001 From: teisuru <31881306+teisuru@users.noreply.github.com> Date: Sun, 10 Sep 2023 14:43:16 +0200 Subject: march path --- rules.js | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/rules.js b/rules.js index f32e08c..f041364 100644 --- a/rules.js +++ b/rules.js @@ -1055,6 +1055,10 @@ function is_seaport(loc) { return set_has(data.seaports, loc) } +function is_exile(loc) { + return data.locales[loc].type === "exile" +} + function is_city(loc) { return data.locales[loc].type === "city" } @@ -2549,7 +2553,6 @@ states.command = { view.actions.tax = 1 if (can_action_sail()) view.actions.sail = 1 - // PARLEY ACTION }, pass() { @@ -2563,6 +2566,7 @@ states.command = { end_command() }, + forage: goto_forage, supply: goto_supply, tax: goto_tax, @@ -2635,10 +2639,17 @@ function format_group_move() { return "" } function prompt_march() { - let from = get_lord_locale(game.command); - + let from = get_lord_locale(game.command); + if (is_first_action()) + for (let to of data.locales[from].adjacent_by_path) { + gen_action_locale(to); + } + if (game.actions > 0) { - for (let to of data.locales[from].adjacent) { + for (let to of data.locales[from].adjacent_by_road) { + gen_action_locale(to); + } + for (let to of data.locales[from].adjacent_by_highway) { gen_action_locale(to); } } @@ -2647,8 +2658,6 @@ function prompt_march() { gen_action_locale(to); } } - - //TODO MARCH PATH } @@ -2742,6 +2751,8 @@ function march_with_group_2() { set_lord_moved(lord, 1) } + // TODO : Intercept + if (has_unbesieged_enemy_lord(to)) { goto_confirm_approach() } else { @@ -6250,10 +6261,6 @@ function gen_action_locale(locale) { gen_action("locale", locale) } -function gen_action_laden_march(locale) { - gen_action("laden_march", locale) -} - function gen_action_lord(lord) { gen_action("lord", lord) } -- cgit v1.2.3