mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-08 21:58:11 +02:00
Roll All Save button + Merge Attack & Roll Chat message
This commit is contained in:
parent
19cc10a3c9
commit
9f3c587d83
18 changed files with 355 additions and 113 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import DHDamageRoll from '../data/chat-message/damageRoll.mjs';
|
||||
import D20RollDialog from '../dialogs/d20RollDialog.mjs';
|
||||
import DamageDialog from '../dialogs/damageDialog.mjs';
|
||||
|
||||
|
|
@ -53,12 +54,13 @@ export class DHRoll extends Roll {
|
|||
}
|
||||
|
||||
static async buildPost(roll, config, message) {
|
||||
console.log(config)
|
||||
for (const hook of config.hooks) {
|
||||
if (Hooks.call(`${SYSTEM.id}.postRoll${hook.capitalize()}`, config, message) === false) return null;
|
||||
}
|
||||
|
||||
// Create Chat Message
|
||||
if (message.data) {
|
||||
if (config.source?.message) {
|
||||
} else {
|
||||
const messageData = {};
|
||||
config.message = await this.toMessage(roll, config);
|
||||
|
|
@ -388,7 +390,6 @@ export class DualityRoll extends D20Roll {
|
|||
total: roll.dHope.total + roll.dFear.total,
|
||||
label: roll.totalLabel
|
||||
};
|
||||
console.log(roll, config)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -404,5 +405,9 @@ export class DamageRoll extends DHRoll {
|
|||
static async postEvaluate(roll, config = {}) {
|
||||
super.postEvaluate(roll, config);
|
||||
config.roll.type = config.type;
|
||||
if(config.source?.message) {
|
||||
const chatMessage = ui.chat.collection.get(config.source.message);
|
||||
chatMessage.update({'system.damage': config});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue