mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 23:49:02 +01:00
More fixes
This commit is contained in:
parent
701a69a9c1
commit
d65c0f91fc
4 changed files with 15 additions and 11 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue