More fixes

This commit is contained in:
WBHarry 2025-07-16 00:53:58 +02:00
parent 701a69a9c1
commit d65c0f91fc
4 changed files with 15 additions and 11 deletions

View file

@ -184,12 +184,21 @@ export const registerRollDiceHooks = () => {
return;
const actor = await fromUuid(config.source.actor),
updates = [];
updates = [],
hopeUpdates = [];
if (!actor) return;
if (config.roll.isCritical || config.roll.result.duality === 1) updates.push({ key: 'hope', value: 1 });
if (config.roll.isCritical || config.roll.result.duality === 1) hopeUpdates.push({ key: 'hope', value: 1 });
if (config.roll.isCritical) updates.push({ key: 'stress', value: -1 });
if (config.roll.result.duality === -1) updates.push({ key: 'fear', value: 1 });
if (hopeUpdates.length) {
if (actor.system.partner) {
actor.system.partner.modifyResource(hopeUpdates);
} else {
updates.push(...hopeUpdates);
}
}
if (updates.length) actor.modifyResource(updates);
if (!config.roll.hasOwnProperty('success') && !config.targets?.length) return;