summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2024-02-14 14:39:58 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2024-02-14 14:39:58 +0100
commitf63bb185504a581f39ec7d773366a82b8371322c (patch)
tree943625f356e5fed64ec01e9687524158c435f02f
parent63bdb2f68c49282845002523e4c58658ae50d680 (diff)
downloadplantagenet-f63bb185504a581f39ec7d773366a82b8371322c.tar.gz
assert all lords on land during levy phase
-rw-r--r--rules.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index eeb1cf2..a5daedd 100644
--- a/rules.js
+++ b/rules.js
@@ -11882,7 +11882,14 @@ function assertMutuallyExclusiveLords() {
function assertAllLordsHaveTroopsOrRetinue() {
for (let lord = first_york_lord; lord <= last_lancaster_lord; ++lord) {
if (is_lord_on_map(lord) && !count_lord_all_forces(lord) && !get_lord_forces(lord, RETINUE))
- throw Error(`ASSERT: Lord "${data.lords[lord].name}" without troops or retinue`)
+ throw Error(`ASSERT: Lord "${data.lords[lord].name}" without troops or retinue.`)
+ }
+}
+
+function assertAllLordsOnLand() {
+ for (let lord = first_york_lord; lord <= last_lancaster_lord; ++lord) {
+ if (is_lord_at_sea(lord))
+ throw Error(`ASSERT: Lord "${data.lords[lord].name}" at sea during Levy phase.`)
}
}
@@ -11892,6 +11899,8 @@ exports.assertState = function (state) {
// assertMutuallyExclusiveLords()
if (game.state !== "battle_losses" && game.state !== "death_or_disband")
assertAllLordsHaveTroopsOrRetinue()
+ if (is_levy_phase())
+ assertAllLordsOnLand()
}
let log_sanity = []