Added modifier to skills

This commit is contained in:
Vlyan
2023-01-17 10:10:58 +01:00
parent 1d42d2970d
commit 12c8a70f60
6 changed files with 51 additions and 38 deletions

View File

@@ -64,6 +64,12 @@ export const RegisterHandlebars = function () {
return objects.join("");
});
// Make the sum of values
Handlebars.registerHelper('sum', function(...nb) {
nb.pop(); // remove this function call
return nb.reduce((acc, n) => acc + Number(n ?? 0), 0);
});
// Add a setter
Handlebars.registerHelper("setVar", function (varName, varValue, options) {
options.data.root[varName] = varValue;