mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 16:09:03 +01:00
Fixes
This commit is contained in:
parent
cb92667892
commit
5b4b4affb1
3 changed files with 8 additions and 7 deletions
|
|
@ -195,7 +195,7 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) {
|
||||||
if (!this.action.damage.parts) return;
|
if (!this.action.damage.parts) return;
|
||||||
const data = this.action.toObject(),
|
const data = this.action.toObject(),
|
||||||
part = {};
|
part = {};
|
||||||
if(this.action.actor.isNPC) part.value = { multiplier: 'flat' };
|
if(this.action.actor?.isNPC) part.value = { multiplier: 'flat' };
|
||||||
data.damage.parts.push(part);
|
data.damage.parts.push(part);
|
||||||
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ export default class DamageRoll extends DHRoll {
|
||||||
|
|
||||||
static async buildEvaluate(roll, config = {}, message = {}) {
|
static async buildEvaluate(roll, config = {}, message = {}) {
|
||||||
if (config.evaluate !== false) {
|
if (config.evaluate !== false) {
|
||||||
|
if(config.dialog.configure === false) roll.constructFormula(config);
|
||||||
for (const roll of config.roll) await roll.roll.evaluate();
|
for (const roll of config.roll) await roll.roll.evaluate();
|
||||||
}
|
}
|
||||||
roll._evaluated = true;
|
roll._evaluated = true;
|
||||||
|
|
|
||||||
|
|
@ -56,13 +56,13 @@ export default class DHRoll extends Roll {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create Chat Message
|
// Create Chat Message
|
||||||
if (config.source?.message) {
|
if (roll instanceof CONFIG.Dice.daggerheart.DamageRoll && Object.values(config.roll)?.length) {
|
||||||
if (Object.values(config.roll)?.length) {
|
|
||||||
const pool = foundry.dice.terms.PoolTerm.fromRolls(
|
const pool = foundry.dice.terms.PoolTerm.fromRolls(
|
||||||
Object.values(config.roll).flatMap(r => r.parts.map(p => p.roll))
|
Object.values(config.roll).flatMap(r => r.parts.map(p => p.roll))
|
||||||
);
|
);
|
||||||
roll = Roll.fromTerms([pool]);
|
roll = Roll.fromTerms([pool]);
|
||||||
}
|
}
|
||||||
|
if (config.source?.message) {
|
||||||
if (game.modules.get('dice-so-nice')?.active) await game.dice3d.showForRoll(roll, game.user, true);
|
if (game.modules.get('dice-so-nice')?.active) await game.dice3d.showForRoll(roll, game.user, true);
|
||||||
} else config.message = await this.toMessage(roll, config);
|
} else config.message = await this.toMessage(roll, config);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue