mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
[Fix] 1325 - Weapon Tooltip Damage Formula (#1355)
* Fixed so the damage calculation is correct. Fixed so the right tooltip is shown for attacks * Moved the damageFormula function to damageAction
This commit is contained in:
parent
b57e98071f
commit
6d8d773a26
8 changed files with 45 additions and 32 deletions
|
|
@ -2,4 +2,17 @@ import DHBaseAction from './baseAction.mjs';
|
|||
|
||||
export default class DHDamageAction extends DHBaseAction {
|
||||
static extraSchemas = [...super.extraSchemas, 'damage', 'target', 'effects'];
|
||||
|
||||
/**
|
||||
* Return a display ready damage formula string
|
||||
* @returns Formula string
|
||||
*/
|
||||
getDamageFormula() {
|
||||
const strings = [];
|
||||
for (const { value } of this.damage.parts) {
|
||||
strings.push(Roll.replaceFormulaData(value.getFormula(), this.actor?.getRollData() ?? {}));
|
||||
}
|
||||
|
||||
return strings.join(' + ');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue