import { DS4Item } from "../item/item"; import { DS4ItemDataType } from "../item/item-data"; import { DS4ActorDataType, ModifiableData } from "./actor-data"; export class DS4Actor extends Actor { /** @override */ prepareDerivedData(): void { const data = this.data; const attributes = data.data.attributes; Object.values(attributes).forEach( (attribute: ModifiableData) => (attribute.total = attribute.base + attribute.mod), ); const traits = data.data.traits; Object.values(traits).forEach((trait: ModifiableData) => (trait.total = trait.base + trait.mod)); const combatValues = data.data.combatValues; Object.values(combatValues).forEach( (combatValue: ModifiableData) => (combatValue.total = combatValue.base + combatValue.mod), ); combatValues.hitPoints.max = combatValues.hitPoints.total; } }