summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2024-02-14 14:43:50 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2024-02-14 14:43:50 +0100
commita20f825cb1c99c2622cb09923106b0e43970fcf6 (patch)
treece203d34d56dca91461a7f04f1d3370e4615a3cd
parentf63bb185504a581f39ec7d773366a82b8371322c (diff)
downloadplantagenet-a20f825cb1c99c2622cb09923106b0e43970fcf6.tar.gz
assert all lords without routed troops during levy phase
-rw-r--r--rules.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index a5daedd..7cdf519 100644
--- a/rules.js
+++ b/rules.js
@@ -11893,14 +11893,24 @@ function assertAllLordsOnLand() {
}
}
+function assertAllLordsWithoutRoutedTroops() {
+ for (let lord = first_york_lord; lord <= last_lancaster_lord; ++lord) {
+ if (lord_has_routed_troops(lord))
+ throw Error(`ASSERT: Lord "${data.lords[lord].name}" has routed troops during Levy phase.`)
+ }
+}
+
exports.assertState = function (state) {
load_state(state)
// assertMutuallyExclusiveLords()
if (game.state !== "battle_losses" && game.state !== "death_or_disband")
assertAllLordsHaveTroopsOrRetinue()
- if (is_levy_phase())
+
+ if (is_levy_phase()) {
assertAllLordsOnLand()
+ assertAllLordsWithoutRoutedTroops()
+ }
}
let log_sanity = []