Add some jsdoc

This commit is contained in:
Dapoolp 2025-08-21 23:12:01 +02:00
parent a54efaeb48
commit 5c73b45193
23 changed files with 501 additions and 555 deletions

View file

@ -4,12 +4,12 @@ import DHRoll from './dhRoll.mjs';
export default class DamageRoll extends DHRoll {
constructor(formula, data = {}, options = {}) {
super(formula, data, options);
if(options.dialog.configure === false) this.constructFormula(options);
}
static DefaultDialog = DamageDialog;
static async buildEvaluate(roll, config = {}, message = {}) {
if (config.dialog.configure === false) roll.constructFormula(config);
if (config.evaluate !== false) for (const roll of config.roll) await roll.roll.evaluate();
roll._evaluated = true;
@ -38,7 +38,13 @@ export default class DamageRoll extends DHRoll {
Object.values(config.damage).flatMap(r => r.parts.map(p => p.roll))
),
diceRoll = Roll.fromTerms([pool]);
await game.dice3d.showForRoll(diceRoll, game.user, true, chatMessage.whisper, chatMessage.blind);
await game.dice3d.showForRoll(
diceRoll,
game.user,
true,
chatMessage.whisper?.length > 0 ? chatMessage.whisper : null,
chatMessage.blind
);
}
await super.buildPost(roll, config, message);
if (config.source?.message)