Adapt healing

This commit is contained in:
Dapoolp 2025-07-19 15:10:56 +02:00
parent 92feddce1b
commit 3186378872
12 changed files with 95 additions and 87 deletions

View file

@ -57,13 +57,13 @@ export default class DHRoll extends Roll {
// Create Chat Message
if (config.source?.message) {
console.log(config)
if(Array.isArray(config.roll?.parts)) {
const pool = foundry.dice.terms.PoolTerm.fromRolls(config.roll.parts.map(r => r.roll));
if(Object.values(config.roll)?.length) {
const pool = foundry.dice.terms.PoolTerm.fromRolls(Object.values(config.roll).flatMap(r => r.parts.map(p => p.roll)));
roll = Roll.fromTerms([pool]);
}
if (game.modules.get('dice-so-nice')?.active) await game.dice3d.showForRoll(roll, game.user, true);
} else {
console.log(roll, config)
config.message = await this.toMessage(roll, config);
}
}