[Fix] 2094 - Critical Damage (#2096)
Some checks failed
Project CI / build (24.x) (push) Has been cancelled

This commit is contained in:
WBHarry 2026-07-24 01:36:55 +02:00 committed by GitHub
parent 66ddb5c032
commit 7fd2a7f17e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 109 additions and 78 deletions

View file

@ -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);
}