diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-04-25 20:50:27 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-04-25 20:50:27 +0200 |
commit | e4e13bf6a49617d153e754e45a8607bcf96485b3 (patch) | |
tree | 175eb64768e191062f002a9e651e15ba70a60687 /rules.ts | |
parent | 6712b7299d6aad5ea124540870c774294893c19a (diff) | |
download | plantagenet-e4e13bf6a49617d153e754e45a8607bcf96485b3.tar.gz |
oops remove_battle_troops
Diffstat (limited to 'rules.ts')
-rw-r--r-- | rules.ts | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -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() |