From e4e13bf6a49617d153e754e45a8607bcf96485b3 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 25 Apr 2024 20:50:27 +0200 Subject: oops remove_battle_troops --- rules.ts | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/rules.ts b/rules.ts index 7344bb2..c68d269 100644 --- a/rules.ts +++ b/rules.ts @@ -5536,36 +5536,44 @@ function add_battle_capability_troops() { if (lord_has_capability(lord, AOW_YORK_MUSTERD_MY_SOLDIERS) && has_york_favour(here)) { logcap(AOW_YORK_MUSTERD_MY_SOLDIERS) + logi("L" + lord) add_lord_forces(lord, MEN_AT_ARMS, 2) add_lord_forces(lord, LONGBOWMEN, 1) } if (lord_has_capability(lord, AOW_LANCASTER_MUSTERD_MY_SOLDIERS) && has_lancaster_favour(here)) { logcap(AOW_LANCASTER_MUSTERD_MY_SOLDIERS) + logi("L" + lord) add_lord_forces(lord, MEN_AT_ARMS, 2) add_lord_forces(lord, LONGBOWMEN, 1) } if (lord_has_capability(lord, AOW_LANCASTER_WELSH_LORD) && is_wales(here)) { logcap(AOW_LANCASTER_WELSH_LORD) + logi("L" + lord) add_lord_forces(lord, LONGBOWMEN, 2) } if (lord_has_capability(lord, AOW_YORK_PEMBROKE) && is_wales(here)) { logcap(AOW_YORK_PEMBROKE) + logi("L" + lord) add_lord_forces(lord, LONGBOWMEN, 2) } if (lord_has_capability(lord, AOW_YORK_PERCYS_NORTH1) && is_north(here)) { logcap(AOW_YORK_PERCYS_NORTH1) + logi("L" + lord) add_lord_forces(lord, MILITIA, 4) } if (lord_has_capability(lord, AOW_YORK_PERCYS_NORTH2) && can_supply_at(LOC_CARLISLE, 0)) { logcap(AOW_YORK_PERCYS_NORTH2) + logi("L" + lord) add_lord_forces(lord, MILITIA, 4) } if (lord_has_capability(lord, AOW_YORK_KINGDOM_UNITED) && (is_north(here) || is_south(here) || is_wales(here))) { logcap(AOW_YORK_KINGDOM_UNITED) + logi("L" + lord) add_lord_forces(lord, MILITIA, 3) } if (lord_has_capability(lord, AOW_LANCASTER_PHILIBERT_DE_CHANDEE) && is_at_or_adjacent_to_friendly_english_channel_port(here)) { logcap(AOW_LANCASTER_PHILIBERT_DE_CHANDEE) + logi("L" + lord) add_lord_forces(lord, MEN_AT_ARMS, 2) } } @@ -5575,29 +5583,45 @@ function add_battle_capability_troops() { function remove_battle_capability_troops(lord: Lord) { let here = game.battle.where if (lord_has_capability(lord, AOW_YORK_MUSTERD_MY_SOLDIERS) && has_york_favour(here)) { + logcap(AOW_YORK_MUSTERD_MY_SOLDIERS) + logi("L" + lord) add_lord_forces(lord, MEN_AT_ARMS, -2) add_lord_forces(lord, LONGBOWMEN, -1) } if (lord_has_capability(lord, AOW_LANCASTER_MUSTERD_MY_SOLDIERS) && has_lancaster_favour(here)) { + logcap(AOW_LANCASTER_MUSTERD_MY_SOLDIERS) + logi("L" + lord) add_lord_forces(lord, MEN_AT_ARMS, -2) add_lord_forces(lord, LONGBOWMEN, -1) } if (lord_has_capability(lord, AOW_LANCASTER_WELSH_LORD) && is_wales(here)) { + logcap(AOW_LANCASTER_WELSH_LORD) + logi("L" + lord) add_lord_forces(lord, LONGBOWMEN, -2) } if (lord_has_capability(lord, AOW_YORK_PEMBROKE) && is_wales(here)) { + logcap(AOW_YORK_PEMBROKE) + logi("L" + lord) add_lord_forces(lord, LONGBOWMEN, -2) } if (lord_has_capability(lord, AOW_YORK_PERCYS_NORTH1) && is_north(here)) { + logcap(AOW_YORK_PERCYS_NORTH1) + logi("L" + lord) add_lord_forces(lord, MILITIA, -4) } if (lord_has_capability(lord, AOW_YORK_PERCYS_NORTH2) && can_supply_at(LOC_CARLISLE, 0)) { + logcap(AOW_YORK_PERCYS_NORTH2) + logi("L" + lord) add_lord_forces(lord, MILITIA, -4) } if (lord_has_capability(lord, AOW_YORK_KINGDOM_UNITED) && (is_north(here) || is_south(here) || is_wales(here))) { + logcap(AOW_YORK_KINGDOM_UNITED) + logi("L" + lord) add_lord_forces(lord, MILITIA, -3) } if (lord_has_capability(lord, AOW_LANCASTER_PHILIBERT_DE_CHANDEE) && is_at_or_adjacent_to_friendly_english_channel_port(here)) { + logcap(AOW_LANCASTER_PHILIBERT_DE_CHANDEE) + logi("L" + lord) add_lord_forces(lord, MEN_AT_ARMS, -2) } } @@ -8008,7 +8032,7 @@ function should_disband_lords_without_troops() { function goto_battle_aftermath() { // Remove temporary troops granted by capabilities for (let lord of all_lords) - if (get_lord_locale(lord) !== game.battle.where) + if (get_lord_locale(lord) === game.battle.where) remove_battle_capability_troops(lord) set_active_defender() -- cgit v1.2.3