Fix bio + initiative
All checks were successful
Release Creation / build (release) Successful in 1m2s
All checks were successful
Release Creation / build (release) Successful in 1m2s
This commit is contained in:
@@ -35,8 +35,8 @@ export default class FTLNomadProtagonist extends foundry.abstract.TypeDataModel
|
||||
schema.health = new fields.SchemaField({
|
||||
staminaValue: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
staminaMax: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
wounds: new fields.NumberField({ ...requiredInteger, initial:0, min: 0 }),
|
||||
triageResults: new fields.StringField({ required: true, nullable: false, initial: "none", choices: SYSTEM.TRIAGE_RESULTS })
|
||||
wounds: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
triageResults: new fields.StringField({ required: true, nullable: false, initial: "none", choices: SYSTEM.TRIAGE_RESULTS })
|
||||
})
|
||||
|
||||
schema.enc = new fields.SchemaField({
|
||||
@@ -76,18 +76,18 @@ export default class FTLNomadProtagonist extends foundry.abstract.TypeDataModel
|
||||
|
||||
prepareDerivedData() {
|
||||
super.prepareDerivedData();
|
||||
|
||||
let encMax = 10 + (2*this.skills.physical.value)
|
||||
|
||||
let encMax = 10 + (2 * this.skills.physical.value)
|
||||
if (encMax !== this.enc.max) {
|
||||
this.enc.max = encMax
|
||||
}
|
||||
let enc = 0
|
||||
let armor = 0
|
||||
for (let i of this.parent.items) {
|
||||
for (let i of this.parent.items) {
|
||||
if (i.system?.enc) {
|
||||
enc += i.system.enc
|
||||
}
|
||||
if ( i.system?.protection) {
|
||||
if (i.system?.protection) {
|
||||
armor += i.system.protection
|
||||
}
|
||||
}
|
||||
@@ -97,12 +97,12 @@ export default class FTLNomadProtagonist extends foundry.abstract.TypeDataModel
|
||||
if (armor !== this.armor.value) {
|
||||
this.armor.value = armor
|
||||
}
|
||||
let staminaMax = 14 + (3*this.skills.physical.value)
|
||||
let staminaMax = 14 + (3 * this.skills.physical.value)
|
||||
if (staminaMax !== this.health.staminaMax) {
|
||||
this.health.staminaMax = staminaMax
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
isEncumbered() {
|
||||
return this.enc.value > this.enc.max
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user