mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 23:49:02 +01:00
Removed isReversed on item resources
This commit is contained in:
parent
28df395e89
commit
d136593968
2 changed files with 16 additions and 18 deletions
|
|
@ -299,8 +299,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
||||||
/* SAVE */
|
/* SAVE */
|
||||||
async rollSave(actor, event, message) {
|
async rollSave(actor, event, message) {
|
||||||
if (!actor) return;
|
if (!actor) return;
|
||||||
return actor
|
return actor.diceRoll({
|
||||||
.diceRoll({
|
|
||||||
event,
|
event,
|
||||||
title: 'Roll Save',
|
title: 'Roll Save',
|
||||||
roll: {
|
roll: {
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,7 @@ export default class CostField extends fields.ArrayField {
|
||||||
if (itemResource.keyIsID) {
|
if (itemResource.keyIsID) {
|
||||||
itemResources[itemResource.key] = {
|
itemResources[itemResource.key] = {
|
||||||
value: this.parent.resource.value ?? 0,
|
value: this.parent.resource.value ?? 0,
|
||||||
max: CostField.formatMax.call(this, this.parent?.resource?.max),
|
max: CostField.formatMax.call(this, this.parent?.resource?.max)
|
||||||
isReversed: true
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -86,10 +85,10 @@ export default class CostField extends fields.ArrayField {
|
||||||
|
|
||||||
static formatMax(max) {
|
static formatMax(max) {
|
||||||
max ??= 0;
|
max ??= 0;
|
||||||
if(isNaN(max)) {
|
if (isNaN(max)) {
|
||||||
const roll = Roll.replaceFormulaData(max, this.getRollData());
|
const roll = Roll.replaceFormulaData(max, this.getRollData());
|
||||||
max = roll.total;
|
max = roll.total;
|
||||||
}
|
}
|
||||||
return max;
|
return Number(max);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue