From b2d23fdcbf7b8bc84ebe8cbe096b3acf168facdf Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 20 Apr 2024 13:05:23 +0200 Subject: Disband any Unrouted Lord who loses all troops before Death Check. This includes any removed from battle capabilities. --- rules.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'rules.ts') diff --git a/rules.ts b/rules.ts index 7c9a933..e0fac29 100644 --- a/rules.ts +++ b/rules.ts @@ -4,6 +4,8 @@ // TODO: log end victory conditions at scenario start // TODO: check all who = NOBODY etc resets +// TODO - show held events when played for effect + /* TODO @@ -7359,11 +7361,21 @@ states.battle_spoils = { function goto_death_or_disband() { remove_battle_capability_troops() - // TODO: manually disband routed vassals + // TODO: manually disband lords and vassals + + for (let lord of all_lords) { + if (is_lord_on_map(lord)) { + // Disband lords without troops + if (!lord_has_unrouted_troops(lord)) { + log(`${lord_name[lord]} disbanded`) + disband_lord(lord) + } + } + } - // Routed Vassals get disbanded for (let lord of all_lords) { if (is_lord_on_map(lord)) { + // Routed Vassals get disbanded for_each_vassal_with_lord(lord, v => { if (set_has(game.battle.routed_vassals, v)) { array_remove(game.battle.routed_vassals, v) @@ -10458,7 +10470,7 @@ function goto_lancaster_event_welsh_rebellion() { states.welsh_rebellion_remove_troops = { inactive: "Welsh Rebellion \u2014 Remove troops", prompt() { - view.prompt = `Remove 2 Troops from each enemy Lord in Wales.` + view.prompt = `Welsh Rebellion: Remove 2 Troops from each enemy Lord in Wales.` let done = true if (game.who === NOBODY) { for (let lord of all_enemy_lords()) { -- cgit v1.2.3