mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-23 02:49:55 +02:00
[Feature] ComboDice Modifier (#2061)
This commit is contained in:
parent
7aa4101889
commit
b7f03f7a2d
7 changed files with 208 additions and 19 deletions
|
|
@ -4,19 +4,20 @@ export default class RegisterHandlebarsHelpers {
|
|||
static registerHelpers() {
|
||||
Handlebars.registerHelper({
|
||||
add: this.add,
|
||||
includes: this.includes,
|
||||
times: this.times,
|
||||
coalesce: this.coalesce,
|
||||
damageFormula: this.damageFormula,
|
||||
formulaValue: this.formulaValue,
|
||||
damageSymbols: this.damageSymbols,
|
||||
rollParsed: this.rollParsed,
|
||||
hasProperty: foundry.utils.hasProperty,
|
||||
getProperty: foundry.utils.getProperty,
|
||||
setVar: this.setVar,
|
||||
empty: this.empty,
|
||||
formulaValue: this.formulaValue,
|
||||
getProperty: foundry.utils.getProperty,
|
||||
hasProperty: foundry.utils.hasProperty,
|
||||
includes: this.includes,
|
||||
isNullish: this.isNullish,
|
||||
pluralize: this.pluralize,
|
||||
positive: this.positive,
|
||||
isNullish: this.isNullish
|
||||
rollParsed: this.rollParsed,
|
||||
setVar: this.setVar,
|
||||
times: this.times
|
||||
});
|
||||
}
|
||||
static add(a, b) {
|
||||
|
|
@ -25,6 +26,10 @@ export default class RegisterHandlebarsHelpers {
|
|||
return (Number.isNaN(aNum) ? 0 : aNum) + (Number.isNaN(bNum) ? 0 : bNum);
|
||||
}
|
||||
|
||||
static coalesce(...args) {
|
||||
return args.find(a => a !== undefined && a !== null);
|
||||
}
|
||||
|
||||
static includes(list, item) {
|
||||
return list.includes(item);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue