Fix in creature+actor sheet

This commit is contained in:
2026-06-25 22:08:42 +02:00
parent f3c9a531e1
commit 393f059d17
8 changed files with 184 additions and 16 deletions
+10
View File
@@ -51,6 +51,13 @@ export default class AwECharacter extends foundry.abstract.TypeDataModel {
}, {})
)
schema.keyAttribute = new fields.StringField({
required: true,
nullable: false,
initial: "agility",
choices: Object.fromEntries(Object.values(SYSTEM.ATTRIBUTES).map(a => [a.id, a.label]))
})
// Condition penalty magnitudes (used when the respective condition is active)
schema.inhibitedPenalty = new fields.NumberField({ required: true, nullable: false, integer: true, initial: 2, min: 0 })
schema.vulnerablePenalty = new fields.NumberField({ required: true, nullable: false, integer: true, initial: 2, min: 0 })
@@ -70,5 +77,8 @@ export default class AwECharacter extends foundry.abstract.TypeDataModel {
const bonusPart = attr.bonus !== 0 ? ` + Bonus ${attr.bonus >= 0 ? '+' : ''}${attr.bonus}` : ''
attr.modBreakdown = `Level ${level} + Boosts ${attr.boostLevel}${bonusPart} = ${attr.mod >= 0 ? '+' : ''}${attr.mod}`
}
this.hp.max = (10 * level) + this.attributes.fitness.mod
this.hp.value = Math.min(this.hp.value, this.hp.max)
}
}