mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Deleting old templates
This commit is contained in:
parent
9b3632be2f
commit
aff5998a45
21 changed files with 447 additions and 1015 deletions
|
|
@ -11,7 +11,6 @@ export default class DamageRoll extends DHRoll {
|
|||
static DefaultDialog = DamageDialog;
|
||||
|
||||
static async buildEvaluate(roll, config = {}, message = {}) {
|
||||
console.log(roll,config)
|
||||
if (config.evaluate !== false)
|
||||
for (const roll of config.roll) await roll.roll.evaluate();
|
||||
|
||||
|
|
@ -33,6 +32,21 @@ export default class DamageRoll extends DHRoll {
|
|||
};
|
||||
}
|
||||
|
||||
static async buildPost(roll, config, message) {
|
||||
if (game.modules.get('dice-so-nice')?.active) {
|
||||
const pool = foundry.dice.terms.PoolTerm.fromRolls(
|
||||
Object.values(config.damage).flatMap(r => r.parts.map(p => p.roll))
|
||||
),
|
||||
diceRoll = Roll.fromTerms([pool]);
|
||||
await game.dice3d.showForRoll(diceRoll, game.user, true);
|
||||
}
|
||||
await super.buildPost(roll, config, message);
|
||||
if (config.source?.message) {
|
||||
const chatMessage = ui.chat.collection.get(config.source.message);
|
||||
chatMessage.update({ 'system.damage': config.damage });
|
||||
}
|
||||
}
|
||||
|
||||
static unifyDamageRoll(rolls) {
|
||||
const unified = {};
|
||||
rolls.forEach(r => {
|
||||
|
|
|
|||
|
|
@ -64,24 +64,8 @@ export default class DHRoll extends Roll {
|
|||
}
|
||||
|
||||
// Create Chat Message
|
||||
// if (roll instanceof CONFIG.Dice.daggerheart.DamageRoll && 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 (config.source?.message) {
|
||||
if (game.modules.get('dice-so-nice')?.active) await game.dice3d.showForRoll(roll, game.user, true);
|
||||
const chatMessage = ui.chat.collection.get(config.source.message);
|
||||
chatMessage.update({ 'system.damage': config.damage });
|
||||
} else {
|
||||
console.log(roll, config)
|
||||
if (!config.source?.message)
|
||||
config.message = await this.toMessage(roll, config);
|
||||
// if(roll._evaluated) {
|
||||
// const cls = getDocumentClass('ChatMessage');
|
||||
// await cls.create(config.message, { rollMode: config.selectedRollMode });
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
static postEvaluate(roll, config = {}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue