mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Bug/chat roll fixes (#726)
* #635 & #637 * #653 * Fix: #681 #682 #685 #686 * Fix duplicate messages * Remove comments
This commit is contained in:
parent
5d0a4382cc
commit
f9cb0954f9
21 changed files with 242 additions and 546 deletions
|
|
@ -139,17 +139,17 @@ export default class D20Roll extends DHRoll {
|
|||
static postEvaluate(roll, config = {}) {
|
||||
const data = super.postEvaluate(roll, config);
|
||||
data.type = config.roll?.type;
|
||||
data.difficulty = config.roll.difficulty;
|
||||
if (config.targets?.length) {
|
||||
config.targetSelection = true;
|
||||
config.targets.forEach(target => {
|
||||
const difficulty = config.roll.difficulty ?? target.difficulty ?? target.evasion;
|
||||
target.hit = roll.isCritical || roll.total >= difficulty;
|
||||
});
|
||||
data.success = config.targets.some(target => target.hit);
|
||||
} else if (config.roll.difficulty) {
|
||||
data.difficulty = config.roll.difficulty;
|
||||
data.success = config.targets.some(target => target.hit)
|
||||
} else if (config.roll.difficulty)
|
||||
data.success = roll.isCritical || roll.total >= config.roll.difficulty;
|
||||
}
|
||||
|
||||
data.advantage = {
|
||||
type: config.roll.advantage,
|
||||
dice: roll.dAdvantage?.denomination,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue