Sync robot enc
All checks were successful
Release Creation / build (release) Successful in 1m8s

This commit is contained in:
2025-10-18 18:03:30 +02:00
parent 99d9cb435f
commit 8a5d1cc1d8
15 changed files with 85 additions and 31 deletions

View File

@@ -49,7 +49,19 @@ export default class FTLNomadRobot extends foundry.abstract.TypeDataModel {
prepareDerivedData() {
super.prepareDerivedData();
let encMax = this.durability + (2 * this.skills.physical.value)
if (encMax !== this.enc.max) {
this.enc.max = encMax
}
let enc = 0
for (let i of this.parent.items) {
if (i.system?.enc) {
enc += i.system.enc
}
}
if (enc !== this.enc.value) {
this.enc.value = enc
}
}
isEncumbered() {