Change to the more neater code

This commit is contained in:
Chris Ryan 2025-08-13 18:02:59 +10:00
parent ae0650d3d4
commit 19e64d872a
2 changed files with 2 additions and 7 deletions

View file

@ -137,12 +137,7 @@ export default class DamageRoll extends DHRoll {
}
if (config.isCritical && part.applyTo === CONFIG.DH.GENERAL.healingTypes.hitPoints.id) {
let total = 0;
part.roll.terms.forEach(term => {
if (term._faces) {
total += term._faces * term._number;
}
});
const total = part.roll.dice.reduce((acc, term) => acc + term._faces*term._number, 0);
if (total > 0) {
part.roll.terms.push(...this.formatModifier(total));
}

View file

@ -7,7 +7,7 @@
"rollup": "^4.40.0"
},
"scripts": {
"start": "concurrently \"rollup -c --watch\" \"node ../../../../FoundryDev/main.js --dataPath=../../../ --noupnp\" \"gulp\"",
"start": "concurrently \"rollup -c --watch\" \"node /home/foundry/foundryvtt/resources/app/main.js --dataPath=/home/foundry/foundrydata/ --noupnp\" \"gulp\"",
"start-test": "node ./resources/app/main.js --dataPath=./ && rollup -c --watch && gulp",
"build": "npm run rollup && npm run gulp",
"rollup": "rollup -c",