Fixed so the damage calculation is correct. Fixed so the right tooltip is shown for attacks

This commit is contained in:
WBHarry 2025-12-01 16:25:59 +01:00
parent 8f917c3640
commit 51135b6a67
8 changed files with 48 additions and 32 deletions

View file

@ -35,14 +35,8 @@ export default class RegisterHandlebarsHelpers {
return accum;
}
static damageFormula(attack, actor) {
const traitTotal = actor.system.traits?.[attack.roll.trait]?.value;
const instances = [
attack.damage.parts.map(x => Roll.replaceFormulaData(x.value.getFormula(), actor)).join(' + '),
traitTotal
].filter(x => x);
return instances.join(traitTotal > 0 ? ' + ' : ' - ');
static damageFormula(attack) {
return game.system.api.fields.ActionFields.DamageField.getFormulaString.bind(attack)(attack.damage.parts);
}
static formulaValue(formula, item) {