Fixed Feature spellcasting modifier

This commit is contained in:
WBHarry 2025-07-14 00:14:32 +02:00
parent 637918d686
commit 8fc26495c1
12 changed files with 57 additions and 34 deletions

View file

@ -299,3 +299,15 @@ export const updateActorTokens = async (actor, update) => {
}
}
};
export const itemAbleRollParse = (value, actor, item) => {
if (!value) return value;
const isItemTarget = value.toLowerCase().startsWith('item.');
const slicedValue = isItemTarget ? value.slice(5) : value;
try {
return Roll.safeEval(Roll.replaceFormulaData(slicedValue, isItemTarget ? item : actor));
} catch (_) {
return '';
}
};