Bug/chat roll fixes (#726)

* #635 & #637

* #653

* Fix: #681 #682 #685 #686

* Fix duplicate messages

* Remove comments
This commit is contained in:
Dapoulp 2025-08-08 21:34:55 +02:00 committed by GitHub
parent 5d0a4382cc
commit f9cb0954f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 242 additions and 546 deletions

View file

@ -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,