Fixes from 29th of june

This commit is contained in:
2023-06-30 13:14:40 +02:00
parent 0b0b74754f
commit 270c7c4a91
9 changed files with 62 additions and 35 deletions

View File

@@ -41,7 +41,7 @@ export class Hero6Utility {
return list.length > 0;
})
Handlebars.registerHelper('mul', function (a, b) {
return parseInt(a) * parseInt(b);
return Number(a) * Number(b);
})
Handlebars.registerHelper('locationLabel', function (key) {
return __locationNames[key]
@@ -390,9 +390,12 @@ export class Hero6Utility {
let hasHalfDice = ""
if (hero6Formula.match("1/2d6")) {
hero6Formula = hero6Formula.replace("1/2d6", "d6")
hasHalfDice = "+round(1d6)"
hasHalfDice = "+round(1d6/2)"
}
if (hero6Formula.match(".5")) {
hero6Formula = hero6Formula.replace(".5", "")
hasHalfDice = "+round(1d6/2)"
}
let foundryFormula = hero6Formula + hasHalfDice
foundryFormula = foundryFormula.replace(' ', '')
console.log("Parsed formula : ", hero6Formula, foundryFormula)