diff --git a/module/data/pc.mjs b/module/data/pc.mjs index 4cd32f93..b61c24bd 100644 --- a/module/data/pc.mjs +++ b/module/data/pc.mjs @@ -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; diff --git a/module/documents/actor.mjs b/module/documents/actor.mjs index df5243f8..0ee631cc 100644 --- a/module/documents/actor.mjs +++ b/module/documents/actor.mjs @@ -46,7 +46,7 @@ export default class DhpActor extends Actor { } var traitsUpdate = changes.traits.reduce((acc, trait) => { - acc[`${trait}.data.value`] = this.system.traits[trait].data.value - 1; + acc[`${trait}.data.bonus`] = this.system.traits[trait].data.bonus - 1; return acc; }, {}); @@ -191,7 +191,7 @@ export default class DhpActor extends Actor { } var traitsUpdate = changes.traits.reduce((acc, trait) => { - acc[`${trait}.data.value`] = this.system.traits[trait].data.value + 1; + acc[`${trait}.data.bonus`] = this.system.traits[trait].data.bonus + 1; return acc; }, {}); diff --git a/templates/sheets/parts/attributes.hbs b/templates/sheets/parts/attributes.hbs index cc689af9..2416c763 100644 --- a/templates/sheets/parts/attributes.hbs +++ b/templates/sheets/parts/attributes.hbs @@ -22,7 +22,7 @@ {{/each}} {{else}} -
{{attribute.data.total}}
+
{{attribute.data.value}}
{{/if}}