summaryrefslogtreecommitdiff
path: root/rules.ts
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-04-20 13:05:23 +0200
committerTor Andersson <tor@ccxvii.net>2024-04-20 13:07:11 +0200
commitb2d23fdcbf7b8bc84ebe8cbe096b3acf168facdf (patch)
tree19f848003014369ca2ad9732546ce03c137c6557 /rules.ts
parentb26583409418c352f2691eab1d36e4b2d7f172c6 (diff)
downloadplantagenet-b2d23fdcbf7b8bc84ebe8cbe096b3acf168facdf.tar.gz
Disband any Unrouted Lord who loses all troops before Death Check.
This includes any removed from battle capabilities.
Diffstat (limited to 'rules.ts')
-rw-r--r--rules.ts18
1 files changed, 15 insertions, 3 deletions
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()) {