mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 23:49:02 +01:00
Initial
This commit is contained in:
parent
b6195127fe
commit
0c742eb91b
5 changed files with 200 additions and 131 deletions
|
|
@ -345,6 +345,37 @@ export const refreshTypes = {
|
|||
}
|
||||
};
|
||||
|
||||
export const featureTokenTypes = {
|
||||
tide: {
|
||||
id: 'tide',
|
||||
label: 'Tide',
|
||||
group: 'TYPES.Actor.character'
|
||||
},
|
||||
chaos: {
|
||||
id: 'chaos',
|
||||
label: 'Chaos',
|
||||
group: 'TYPES.Actor.character'
|
||||
}
|
||||
};
|
||||
|
||||
export const featureDiceTypes = {
|
||||
prayer: {
|
||||
id: 'prayer',
|
||||
label: 'Prayer Dice',
|
||||
group: 'TYPES.Actor.character'
|
||||
},
|
||||
favor: {
|
||||
id: 'favor',
|
||||
label: 'Favor Points',
|
||||
group: 'TYPES.Actor.character'
|
||||
},
|
||||
slayer: {
|
||||
id: 'slayer',
|
||||
label: 'Slayer Dice',
|
||||
group: 'TYPES.Actor.character'
|
||||
}
|
||||
};
|
||||
|
||||
export const abilityCosts = {
|
||||
hp: {
|
||||
id: 'hp',
|
||||
|
|
@ -366,36 +397,13 @@ export const abilityCosts = {
|
|||
label: 'Armor Stack',
|
||||
group: 'TYPES.Actor.character'
|
||||
},
|
||||
prayer: {
|
||||
id: 'prayer',
|
||||
label: 'Prayer Dice',
|
||||
group: 'TYPES.Actor.character'
|
||||
},
|
||||
favor: {
|
||||
id: 'favor',
|
||||
label: 'Favor Points',
|
||||
group: 'TYPES.Actor.character'
|
||||
},
|
||||
slayer: {
|
||||
id: 'slayer',
|
||||
label: 'Slayer Dice',
|
||||
group: 'TYPES.Actor.character'
|
||||
},
|
||||
tide: {
|
||||
id: 'tide',
|
||||
label: 'Tide',
|
||||
group: 'TYPES.Actor.character'
|
||||
},
|
||||
chaos: {
|
||||
id: 'chaos',
|
||||
label: 'Chaos',
|
||||
group: 'TYPES.Actor.character'
|
||||
},
|
||||
fear: {
|
||||
id: 'fear',
|
||||
label: 'Fear',
|
||||
group: 'TYPES.Actor.adversary'
|
||||
}
|
||||
},
|
||||
...featureTokenTypes,
|
||||
...featureDiceTypes
|
||||
};
|
||||
|
||||
export const countdownTypes = {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,18 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
|||
|
||||
/** @inheritDoc */
|
||||
static defineSchema() {
|
||||
const schema = {};
|
||||
const schema = {
|
||||
uses: new fields.SchemaField({
|
||||
value: new fields.NumberField({ nullable: true, initial: null }),
|
||||
max: new fields.NumberField({ nullable: true, initial: null }),
|
||||
icon: new fields.StringField({ initial: 'fa-solid fa-hashtag' }),
|
||||
recovery: new fields.StringField({
|
||||
choices: CONFIG.DH.GENERAL.refreshTypes,
|
||||
initial: null,
|
||||
nullable: true
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
if (this.metadata.hasDescription) schema.description = new fields.HTMLField({ required: true, nullable: true });
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,20 @@
|
|||
export default class RegisterHandlebarsHelpers {
|
||||
static registerHelpers() {
|
||||
Handlebars.registerHelper({
|
||||
emptyObject: this.emptyObject,
|
||||
add: this.add,
|
||||
includes: this.includes,
|
||||
times: this.times,
|
||||
damageFormula: this.damageFormula,
|
||||
damageSymbols: this.damageSymbols,
|
||||
tertiary: this.tertiary,
|
||||
signedNumber: this.signedNumber
|
||||
tertiary: this.tertiary
|
||||
});
|
||||
}
|
||||
|
||||
static emptyObject(a) {
|
||||
return !a || typeof a !== 'object' || Object.keys(a).length === 0;
|
||||
}
|
||||
|
||||
static add(a, b) {
|
||||
const aNum = Number.parseInt(a);
|
||||
const bNum = Number.parseInt(b);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue