[Feature] ComboDice Modifier (#2061)

This commit is contained in:
WBHarry 2026-07-22 12:17:25 +02:00 committed by GitHub
parent 7aa4101889
commit b7f03f7a2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 208 additions and 19 deletions

View file

@ -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);
}