mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Fixed so the damage calculation is correct. Fixed so the right tooltip is shown for attacks
This commit is contained in:
parent
8f917c3640
commit
51135b6a67
8 changed files with 48 additions and 32 deletions
|
|
@ -161,6 +161,22 @@ export default class DamageField extends fields.SchemaField {
|
|||
return formulaValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a display ready damage formula string
|
||||
* Must be called within Action context or similar.
|
||||
* @param {Array<object>} parts Damage Parts
|
||||
* @param {object} data Action getRollData
|
||||
* @returns Formula string
|
||||
*/
|
||||
static getFormulaString(parts) {
|
||||
const strings = [];
|
||||
for (const { value } of parts) {
|
||||
strings.push(Roll.replaceFormulaData(value.getFormula(), this.actor?.getRollData() ?? {}));
|
||||
}
|
||||
|
||||
return strings.join(' + ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare formulas for Damage Roll
|
||||
* Must be called within Action context or similar.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue