From 72595561e3c14688b285e59511aecb50b47e9f0d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 2 Dec 2024 11:28:19 +0100 Subject: Supply from Exile Box to Port on same sea should not count distance. ... don't need to haul from the port on the same sea back to scotland! --- rules.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'rules.ts') diff --git a/rules.ts b/rules.ts index b8c839c..4ad0882 100644 --- a/rules.ts +++ b/rules.ts @@ -4170,14 +4170,18 @@ function goto_supply() { init_supply() } -function modify_supply(loc: Locale, supply: number, report: boolean) { +function modify_supply(loc: Locale, supply: number, is_port_supply: boolean, report: boolean) { let here = get_lord_locale(game.command) let carts = count_shared_carts(here, true) // Must carry supply over land with one cart per provender per way - let distance = map_get(game.supply, loc, 0) >> 3 - if (distance > 0) - supply = Math.min(supply, Math.floor(carts / distance)) + if (is_exile_box(here) && is_port_supply) { + /* exception: supply from exile box to port on same sea! */ + } else { + let distance = map_get(game.supply, loc, 0) >> 3 + if (distance > 0) + supply = Math.min(supply, Math.floor(carts / distance)) + } // Harbingers capability doubles supply received if (lord_has_capability(game.command, AOW_LANCASTER_HARBINGERS)) { @@ -4198,7 +4202,7 @@ function get_port_supply_amount(loc: Locale, report: boolean) { if (is_seaport(loc) || is_exile_box(loc)) { let here = get_lord_locale(game.command) let ships = count_shared_ships(here, true) - return modify_supply(loc, ships, report) + return modify_supply(loc, ships, true, report) } return 0 } @@ -4220,7 +4224,7 @@ function get_stronghold_supply_amount(loc: Locale, report: boolean) { supply += 1 } - return modify_supply(loc, supply, report) + return modify_supply(loc, supply, false, report) } return 0 } -- cgit v1.2.3