From 4150ad52927750366f951fd8b310d91d76fe61c6 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 11 May 2024 19:35:54 +0200 Subject: fix percy's north route --- rules.js | 8 ++++---- rules.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rules.js b/rules.js index da6d9e7..232df2b 100644 --- a/rules.js +++ b/rules.js @@ -3932,7 +3932,7 @@ function has_free_parley_levy() { return true; return false; } -function has_route_to(start, to) { +function has_york_route_to(start, to) { if (start === to) return true; search_seen.fill(0); @@ -3943,7 +3943,7 @@ function has_route_to(start, to) { if (here === to) return true; // exception for start locale - if (here === start || (is_friendly_locale(here) && !has_enemy_lord(here))) { + if (here === start || (has_york_favour(here) && !has_lancaster_lord(here))) { for (let next of data.locales[here].adjacent) { if (!search_seen[next]) { search_seen[next] = 1; @@ -5103,7 +5103,7 @@ function add_battle_capability_troops() { log_battle_cap(lord, AOW_YORK_PERCYS_NORTH1); add_lord_forces(lord, MILITIA, 4); } - if (lord_has_capability(lord, AOW_YORK_PERCYS_NORTH2) && has_route_to(here, LOC_CARLISLE)) { + if (lord_has_capability(lord, AOW_YORK_PERCYS_NORTH2) && has_york_route_to(here, LOC_CARLISLE)) { log_battle_cap(lord, AOW_YORK_PERCYS_NORTH2); add_lord_forces(lord, MEN_AT_ARMS, 2); } @@ -5137,7 +5137,7 @@ function remove_battle_capability_troops(lord) { if (lord_has_capability(lord, AOW_YORK_PERCYS_NORTH1) && is_north(here)) { add_lord_forces(lord, MILITIA, -4); } - if (lord_has_capability(lord, AOW_YORK_PERCYS_NORTH2) && has_route_to(here, LOC_CARLISLE)) { + if (lord_has_capability(lord, AOW_YORK_PERCYS_NORTH2) && has_york_route_to(here, LOC_CARLISLE)) { add_lord_forces(lord, MEN_AT_ARMS, -2); } if (lord_has_capability(lord, AOW_YORK_KINGDOM_UNITED) && (is_north(here) || is_south(here) || is_wales(here))) { diff --git a/rules.ts b/rules.ts index 110a0f3..4945c17 100644 --- a/rules.ts +++ b/rules.ts @@ -4747,7 +4747,7 @@ function has_free_parley_levy() { return false } -function has_route_to(start: Locale, to: Locale) { +function has_york_route_to(start: Locale, to: Locale) { if (start === to) return true @@ -4762,7 +4762,7 @@ function has_route_to(start: Locale, to: Locale) { return true // exception for start locale - if (here === start || (is_friendly_locale(here) && !has_enemy_lord(here))) { + if (here === start || (has_york_favour(here) && !has_lancaster_lord(here))) { for (let next of data.locales[here].adjacent) { if (!search_seen[next]) { search_seen[next] = 1 @@ -6107,7 +6107,7 @@ function add_battle_capability_troops() { log_battle_cap(lord, AOW_YORK_PERCYS_NORTH1) add_lord_forces(lord, MILITIA, 4) } - if (lord_has_capability(lord, AOW_YORK_PERCYS_NORTH2) && has_route_to(here, LOC_CARLISLE)) { + if (lord_has_capability(lord, AOW_YORK_PERCYS_NORTH2) && has_york_route_to(here, LOC_CARLISLE)) { log_battle_cap(lord, AOW_YORK_PERCYS_NORTH2) add_lord_forces(lord, MEN_AT_ARMS, 2) } @@ -6142,7 +6142,7 @@ function remove_battle_capability_troops(lord: Lord) { if (lord_has_capability(lord, AOW_YORK_PERCYS_NORTH1) && is_north(here)) { add_lord_forces(lord, MILITIA, -4) } - if (lord_has_capability(lord, AOW_YORK_PERCYS_NORTH2) && has_route_to(here, LOC_CARLISLE)) { + if (lord_has_capability(lord, AOW_YORK_PERCYS_NORTH2) && has_york_route_to(here, LOC_CARLISLE)) { add_lord_forces(lord, MEN_AT_ARMS, -2) } if (lord_has_capability(lord, AOW_YORK_KINGDOM_UNITED) && (is_north(here) || is_south(here) || is_wales(here))) { -- cgit v1.2.3