summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-10-07 17:25:11 +0200
committerTor Andersson <tor@ccxvii.net>2023-12-10 18:16:55 +0100
commitdea6d3119e78bdd9cb459a1e56c1d71cfb4be747 (patch)
tree781ccf5f4fab7d513c040a48127a63e0946f0b7a
parent09077aaec083f2328e314a02110645fad24f5b7f (diff)
downloadplantagenet-dea6d3119e78bdd9cb459a1e56c1d71cfb4be747.tar.gz
Simplify gnarly if-statement in count_group_assets.
-rw-r--r--rules.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/rules.js b/rules.js
index fef274c..f822600 100644
--- a/rules.js
+++ b/rules.js
@@ -1077,12 +1077,11 @@ function count_group_assets(type, group = game.group) {
let n = 0
for (let lord of group) {
n += get_lord_assets(lord, type)
- if (
- (game.state === "command" || game.state === "march_laden") &&
- lord_has_capability(lord, AOW_LANCASTER_HAY_WAINS) &&
- type === CART
- )
- n += get_lord_assets(lord, CART)
+ if (type === CART) {
+ if ((game.state === "command" || game.state === "march_laden"))
+ if (lord_has_capability(lord, AOW_LANCASTER_HAY_WAINS))
+ n += get_lord_assets(lord, CART)
+ }
}
return n
}
@@ -3614,8 +3613,8 @@ states.parley = {
}
}
-
// === ACTION: LEVY VASSAL ===
+
// 1) During Levy ONLY
// 2) game.who location must be friendly and Vassal seat locale must be friendly
// 3) there need to not be his vassal marker on the calendar (see vassal disband)