Nouvelles corrections sur la fiche

This commit is contained in:
2026-03-06 11:31:04 +01:00
parent 65dc626380
commit b9db8eb2fc
4 changed files with 42 additions and 8 deletions
+6 -2
View File
@@ -37,8 +37,10 @@ export default class AwECharacter extends foundry.abstract.TypeDataModel {
// dc = 10 + mod (computed)
// bonus: manual +/- bonus
const attributeField = () => new fields.SchemaField({
boostLevel: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 4,
choices: {0:"0", 1:"1", 2:"2", 3:"3", 4:"4"} }),
// boosts: permanent +1 increments from background, field, step5, and level 3/6/9 progression
// max 7: 4 at creation + 3 from additional boosts at levels 3, 6, 9
boostLevel: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 7,
choices: Object.fromEntries(Array.from({length: 8}, (_, i) => [i, String(i)])) }),
bonus: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 0 })
})
@@ -61,6 +63,8 @@ export default class AwECharacter extends foundry.abstract.TypeDataModel {
const attr = this.attributes[attrId]
attr.mod = level + attr.boostLevel + attr.bonus
attr.dc = 10 + attr.mod
const bonusPart = attr.bonus !== 0 ? ` + Bonus ${attr.bonus >= 0 ? '+' : ''}${attr.bonus}` : ''
attr.modBreakdown = `Level ${level} + Boosts ${attr.boostLevel}${bonusPart} = ${attr.mod >= 0 ? '+' : ''}${attr.mod}`
}
}
}