mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 06:26:13 +01:00
parent
5732639391
commit
17aa0680d2
1 changed files with 7 additions and 2 deletions
|
|
@ -33,7 +33,7 @@ export default class DamageRoll extends DHRoll {
|
||||||
static async buildPost(roll, config, message) {
|
static async buildPost(roll, config, message) {
|
||||||
const chatMessage = config.source?.message
|
const chatMessage = config.source?.message
|
||||||
? ui.chat.collection.get(config.source.message)
|
? ui.chat.collection.get(config.source.message)
|
||||||
: getDocumentClass('ChatMessage').applyRollMode({}, config.rollMode);
|
: getDocumentClass('ChatMessage').applyRollMode({}, config.rollMode ?? CONST.DICE_ROLL_MODES.PUBLIC);
|
||||||
if (game.modules.get('dice-so-nice')?.active) {
|
if (game.modules.get('dice-so-nice')?.active) {
|
||||||
const pool = foundry.dice.terms.PoolTerm.fromRolls(
|
const pool = foundry.dice.terms.PoolTerm.fromRolls(
|
||||||
Object.values(config.damage).flatMap(r => r.parts.map(p => p.roll))
|
Object.values(config.damage).flatMap(r => r.parts.map(p => p.roll))
|
||||||
|
|
@ -46,9 +46,14 @@ export default class DamageRoll extends DHRoll {
|
||||||
chatMessage.whisper?.length > 0 ? chatMessage.whisper : null,
|
chatMessage.whisper?.length > 0 ? chatMessage.whisper : null,
|
||||||
chatMessage.blind
|
chatMessage.blind
|
||||||
);
|
);
|
||||||
|
config.mute = true;
|
||||||
}
|
}
|
||||||
await super.buildPost(roll, config, message);
|
await super.buildPost(roll, config, message);
|
||||||
if (config.source?.message) chatMessage.update({ 'system.damage': config.damage });
|
if (config.source?.message) {
|
||||||
|
chatMessage.update({ 'system.damage': config.damage });
|
||||||
|
|
||||||
|
if (!game.modules.get('dice-so-nice')?.active) foundry.audio.AudioHelper.play({ src: CONFIG.sounds.dice });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static unifyDamageRoll(rolls) {
|
static unifyDamageRoll(rolls) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue