Fixed reroll correcting automation hope/fear/stress

This commit is contained in:
WBHarry 2025-07-24 13:58:29 +02:00
parent 6301e575e3
commit aeb208e777
3 changed files with 17 additions and 3 deletions

View file

@ -193,6 +193,11 @@ export const registerRollDiceHooks = () => {
if (config.roll.isCritical) updates.push({ key: 'stress', value: -1 });
if (config.roll.result.duality === -1) updates.push({ key: 'fear', value: 1 });
if (config.rerolledRoll.isCritical || config.rerolledRoll.result.duality === 1)
updates.push({ key: 'hope', value: -1 });
if (config.rerolledRoll.isCritical) updates.push({ key: 'stress', value: 1 });
if (config.rerolledRoll.result.duality === -1) updates.push({ key: 'fear', value: -1 });
if (updates.length) {
const target = actor.system.partner ?? actor;
if (!['dead', 'unconcious'].some(x => actor.statuses.has(x))) {

View file

@ -232,6 +232,12 @@ export default class DualityRoll extends D20Roll {
});
newRoll.extra = newRoll.extra.slice(2);
Hooks.call(`${CONFIG.DH.id}.postRollDuality`, {
source: { actor: message.system.source.actor ?? '' },
targets: message.system.targets,
roll: newRoll,
rerolledRoll: message.system.roll
});
return { newRoll, parsedRoll };
}
}