Fixed so that Rally dice works as a single active effect for bard

This commit is contained in:
WBHarry 2026-03-06 16:38:00 +01:00
parent 17aa0680d2
commit 3fbcdebd3b
6 changed files with 13 additions and 107 deletions

View file

@ -557,3 +557,11 @@ export function calculateExpectedValue(formulaOrTerms) {
: [formulaOrTerms];
return terms.reduce((r, t) => r + (t.bonus ?? 0) + (t.diceQuantity ? (t.diceQuantity * (t.faces + 1)) / 2 : 0), 0);
}
export function parseRallyDice(value, effect) {
const legacyStartsWithPrefix = value.toLowerCase().startsWith('d');
const workingValue = legacyStartsWithPrefix ? value.slice(1) : value;
const dataParsedValue = itemAbleRollParse(workingValue, effect.parent);
return `d${game.system.api.documents.DhActiveEffect.effectSafeEval(dataParsedValue)}`;
}