mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
[Fix] 397 - Reroll Improvements (#400)
* Fixed reroll correcting automation hope/fear/stress * Fixed advantage/disadvantage reroll counting on d20s
This commit is contained in:
parent
e8e328039e
commit
80744381f5
8 changed files with 86 additions and 7 deletions
|
|
@ -171,11 +171,19 @@ export default class DualityRoll extends D20Roll {
|
|||
|
||||
data.hope = {
|
||||
dice: roll.dHope.denomination,
|
||||
value: roll.dHope.total
|
||||
value: roll.dHope.total,
|
||||
rerolled: {
|
||||
any: roll.dHope.results.some(x => x.rerolled),
|
||||
rerolls: roll.dHope.results.filter(x => x.rerolled)
|
||||
}
|
||||
};
|
||||
data.fear = {
|
||||
dice: roll.dFear.denomination,
|
||||
value: roll.dFear.total
|
||||
value: roll.dFear.total,
|
||||
rerolled: {
|
||||
any: roll.dFear.results.some(x => x.rerolled),
|
||||
rerolls: roll.dFear.results.filter(x => x.rerolled)
|
||||
}
|
||||
};
|
||||
data.rally = {
|
||||
dice: roll.dRally?.denomination,
|
||||
|
|
@ -232,6 +240,13 @@ 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:
|
||||
newRoll.result.duality !== message.system.roll.result.duality ? message.system.roll : undefined
|
||||
});
|
||||
return { newRoll, parsedRoll };
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue