mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 23:49:02 +01:00
Adapt healing
This commit is contained in:
parent
92feddce1b
commit
3186378872
12 changed files with 95 additions and 87 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue