diff --git a/src/module/actor/actor.ts b/src/module/actor/actor.ts index 1b3a790..2192cf8 100644 --- a/src/module/actor/actor.ts +++ b/src/module/actor/actor.ts @@ -139,6 +139,22 @@ export class DS4Actor extends Actor { * Apply final transformations to the Actor data after all effects have been applied. */ prepareFinalDerivedData(): void { + Object.values(this.data.data.attributes).forEach( + (attribute: ModifiableDataBaseTotal) => (attribute.total = Math.ceil(attribute.total)), + ); + Object.values(this.data.data.traits).forEach( + (trait: ModifiableDataBaseTotal) => (trait.total = Math.ceil(trait.total)), + ); + Object.entries(this.data.data.combatValues) + .filter(([key]) => key !== "movement") + .map(([, value]) => value) + .forEach( + (combatValue: ModifiableDataBaseTotal) => (combatValue.total = Math.ceil(combatValue.total)), + ); + (Object.keys(this.data.data.checks) as (keyof typeof this.data.data.checks)[]).forEach((key) => { + this.data.data.checks[key] = Math.ceil(this.data.data.checks[key]); + }); + this.data.data.combatValues.hitPoints.max = this.data.data.combatValues.hitPoints.total; this.data.data.checks.defend = this.data.data.combatValues.defense.total; if (this.data.type === "character") {