swap to use the DualityRoll not base roll

This commit is contained in:
IrkTheImp 2025-07-01 17:07:18 -05:00
parent 5ffb22fcc5
commit 73a834e3a9
4 changed files with 9 additions and 7 deletions

View file

@ -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);

View file

@ -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';

View file

@ -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 });
}
}
}

View file

@ -99,7 +99,7 @@
<div class="dice-result">
<div class="dice-tooltip">
<div class="wrapper">
{{> 'systems/daggerheart/templates/chat/parts/damage-chat.hbs' damage=damage noTitle=true}}
{{!-- {{> 'systems/daggerheart/templates/chat/parts/damage-chat.hbs' damage=damage noTitle=true}} --}}
</div>
</div>
</div>