diff options
author | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2024-02-14 14:39:58 +0100 |
---|---|---|
committer | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2024-02-14 14:39:58 +0100 |
commit | f63bb185504a581f39ec7d773366a82b8371322c (patch) | |
tree | 943625f356e5fed64ec01e9687524158c435f02f | |
parent | 63bdb2f68c49282845002523e4c58658ae50d680 (diff) | |
download | plantagenet-f63bb185504a581f39ec7d773366a82b8371322c.tar.gz |
assert all lords on land during levy phase
-rw-r--r-- | rules.js | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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 = [] |