mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-25 11:59:54 +02:00
[Fix] 2094 - Critical Damage (#2096)
Some checks failed
Project CI / build (24.x) (push) Has been cancelled
Some checks failed
Project CI / build (24.x) (push) Has been cancelled
This commit is contained in:
parent
66ddb5c032
commit
7fd2a7f17e
12 changed files with 109 additions and 78 deletions
|
|
@ -495,9 +495,8 @@ export function expireActiveEffects(actor, allowedTypes = null) {
|
|||
actor.deleteEmbeddedDocuments('ActiveEffect', effectsToExpire);
|
||||
}
|
||||
|
||||
export async function getCritDamageBonus(formula) {
|
||||
const critRoll = new Roll(formula);
|
||||
await critRoll.evaluate();
|
||||
export function getCritDamageBonus(terms) {
|
||||
const critRoll = Roll.fromTerms(terms);
|
||||
return critRoll.dice.reduce((acc, dice) => acc + dice.faces * dice.results.filter(r => r.active).length, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue