mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Bunch o fxies (#674)
This commit is contained in:
parent
f5febe74fe
commit
0108e3d222
6 changed files with 20 additions and 8 deletions
|
|
@ -73,7 +73,7 @@ export default class DhCharacter extends BaseDataActor {
|
|||
),
|
||||
gold: new fields.SchemaField({
|
||||
coins: new fields.NumberField({ initial: 0, integer: true }),
|
||||
handfulls: new fields.NumberField({ initial: 0, integer: true }),
|
||||
handfulls: new fields.NumberField({ initial: 1, integer: true }),
|
||||
bags: new fields.NumberField({ initial: 0, integer: true }),
|
||||
chests: new fields.NumberField({ initial: 0, integer: true })
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -12,7 +12,10 @@ export default class UsesField extends fields.SchemaField {
|
|||
initial: null,
|
||||
nullable: true
|
||||
}),
|
||||
consumeOnSuccess: new fields.BooleanField({ initial: false, label: "DAGGERHEART.ACTIONS.Settings.consumeOnSuccess.label" })
|
||||
consumeOnSuccess: new fields.BooleanField({
|
||||
initial: false,
|
||||
label: 'DAGGERHEART.ACTIONS.Settings.consumeOnSuccess.label'
|
||||
})
|
||||
};
|
||||
super(usesFields, options, context);
|
||||
}
|
||||
|
|
@ -30,6 +33,7 @@ export default class UsesField extends fields.SchemaField {
|
|||
if (!uses) return null;
|
||||
return {
|
||||
...uses,
|
||||
remaining: this.remainingUses,
|
||||
enabled: uses.hasOwnProperty('enabled') ? uses.enabled : true
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import DHActionConfig from '../../applications/sheets-configs/action-config.mjs';
|
||||
import { itemAbleRollParse } from '../../helpers/utils.mjs';
|
||||
import MappingField from './mappingField.mjs';
|
||||
|
||||
/**
|
||||
|
|
@ -167,7 +168,10 @@ export function ActionMixin(Base) {
|
|||
get remainingUses() {
|
||||
if (!this.uses) return null;
|
||||
|
||||
return Math.max((this.uses.max ?? 0) - (this.uses.value ?? 0), 0);
|
||||
return Math.max(
|
||||
(this.uses.max ? itemAbleRollParse(this.uses.max, this.actor) : 0) - (this.uses.value ?? 0),
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
static async create(data, operation = {}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue