diff --git a/daggerheart.mjs b/daggerheart.mjs index 5433c586..52d54d77 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -215,7 +215,10 @@ Hooks.on('chatMessage', (_, message) => { const hopeAndFearRoll = `1${rollCommand.hope ?? 'd12'}+1${rollCommand.fear ?? 'd12'}`; const advantageRoll = `${advantageState === true ? '+d6' : advantageState === false ? '-d6' : ''}`; const attributeRoll = `${trait?.value ? `${trait.value > 0 ? `+${trait.value}` : `${trait.value}`}` : ''}`; - const roll = await Roll.create(`${hopeAndFearRoll}${advantageRoll}${attributeRoll}`).evaluate(); + const roll = new DualityRoll(`${hopeAndFearRoll}${advantageRoll}${attributeRoll}`); + await roll.evaluate(); + + console.log('roll result', roll.result); setDiceSoNiceForDualityRoll(roll, advantageState); diff --git a/module/applications/_module.mjs b/module/applications/_module.mjs index 09f63742..df22d6b2 100644 --- a/module/applications/_module.mjs +++ b/module/applications/_module.mjs @@ -1,6 +1,5 @@ export { default as DhCharacterSheet } from './sheets/actors/character.mjs'; export { default as DhpAdversarySheet } from './sheets/actors/adversary.mjs'; -export { default as DhpAdversarySheet } from './sheets/actors/adversary.mjs'; export { default as DhCompanionSheet } from './sheets/companion.mjs'; export { default as DhpClassSheet } from './sheets/items/class.mjs'; export { default as DhpSubclass } from './sheets/items/subclass.mjs'; diff --git a/module/applications/roll.mjs b/module/applications/roll.mjs index cb7d0dff..caf3dd70 100644 --- a/module/applications/roll.mjs +++ b/module/applications/roll.mjs @@ -54,7 +54,7 @@ export class DHRoll extends Roll { } static async buildPost(roll, config, message) { - console.log(config) + console.log(config); for (const hook of config.hooks) { if (Hooks.call(`${SYSTEM.id}.postRoll${hook.capitalize()}`, config, message) === false) return null; } @@ -374,7 +374,7 @@ export class DualityRoll extends D20Roll { applyBaseBonus() { this.options.roll.modifiers = [ { - label: `DAGGERHEART.Abilities.${this.options.roll.trait}.name`, + label: 'HI', value: Roll.replaceFormulaData(`@traits.${this.options.roll.trait}.total`, this.data) } ]; @@ -410,9 +410,9 @@ export class DamageRoll extends DHRoll { static async postEvaluate(roll, config = {}) { super.postEvaluate(roll, config); config.roll.type = config.type; - if(config.source?.message) { + if (config.source?.message) { const chatMessage = ui.chat.collection.get(config.source.message); - chatMessage.update({'system.damage': config}); + chatMessage.update({ 'system.damage': config }); } } } diff --git a/templates/chat/duality-roll.hbs b/templates/chat/duality-roll.hbs index 65ec1676..5a11cff1 100644 --- a/templates/chat/duality-roll.hbs +++ b/templates/chat/duality-roll.hbs @@ -99,7 +99,7 @@