mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-16 13:41:07 +01:00
Improved naming of attribute properties
This commit is contained in:
parent
b9c5c3c753
commit
84a41912a7
3 changed files with 5 additions and 5 deletions
|
|
@ -6,7 +6,7 @@ const fields = foundry.data.fields;
|
||||||
const attributeField = () =>
|
const attributeField = () =>
|
||||||
new fields.SchemaField({
|
new fields.SchemaField({
|
||||||
data: 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 })
|
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) {
|
for (var attributeKey in this.traits) {
|
||||||
const attribute = this.traits[attributeKey];
|
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;
|
this.evasion.value = (this.class?.system?.evasion ?? 0) + this.evasion.bonuses;
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ export default class DhpActor extends Actor {
|
||||||
}
|
}
|
||||||
|
|
||||||
var traitsUpdate = changes.traits.reduce((acc, trait) => {
|
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;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
|
|
@ -191,7 +191,7 @@ export default class DhpActor extends Actor {
|
||||||
}
|
}
|
||||||
|
|
||||||
var traitsUpdate = changes.traits.reduce((acc, trait) => {
|
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;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</select>
|
</select>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="attribute-text {{#if (lt attribute.data.total 0)}}negative{{/if}}">{{attribute.data.total}}</div>
|
<div class="attribute-text {{#if (lt attribute.data.value 0)}}negative{{/if}}">{{attribute.data.value}}</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<img src="systems/daggerheart/assets/AttributeShield.svg" />
|
<img src="systems/daggerheart/assets/AttributeShield.svg" />
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue