diff options
author | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2024-02-14 14:43:50 +0100 |
---|---|---|
committer | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2024-02-14 14:43:50 +0100 |
commit | a20f825cb1c99c2622cb09923106b0e43970fcf6 (patch) | |
tree | ce203d34d56dca91461a7f04f1d3370e4615a3cd /rules.js | |
parent | f63bb185504a581f39ec7d773366a82b8371322c (diff) | |
download | plantagenet-a20f825cb1c99c2622cb09923106b0e43970fcf6.tar.gz |
assert all lords without routed troops during levy phase
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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 = [] |