Improved naming of attribute properties

This commit is contained in:
WBHarry 2025-06-01 16:04:50 +02:00
parent b9c5c3c753
commit 84a41912a7
3 changed files with 5 additions and 5 deletions

View file

@ -6,7 +6,7 @@ const fields = foundry.data.fields;
const attributeField = () =>
new fields.SchemaField({
data: new fields.SchemaField({
value: new fields.NumberField({ initial: 0, integer: true }),
bonus: new fields.NumberField({ initial: 0, integer: true }),
base: new fields.NumberField({ initial: 0, integer: true })
})
});
@ -330,7 +330,7 @@ export default class DhpPC extends foundry.abstract.TypeDataModel {
for (var attributeKey in this.traits) {
const attribute = this.traits[attributeKey];
attribute.data.total = attribute.data.base + attribute.data.value;
attribute.data.value = attribute.data.base + attribute.data.bonus;
}
this.evasion.value = (this.class?.system?.evasion ?? 0) + this.evasion.bonuses;