mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-24 00:13:39 +02:00
swap to use the DualityRoll not base roll
This commit is contained in:
parent
5ffb22fcc5
commit
73a834e3a9
4 changed files with 9 additions and 7 deletions
|
|
@ -215,7 +215,10 @@ Hooks.on('chatMessage', (_, message) => {
|
||||||
const hopeAndFearRoll = `1${rollCommand.hope ?? 'd12'}+1${rollCommand.fear ?? 'd12'}`;
|
const hopeAndFearRoll = `1${rollCommand.hope ?? 'd12'}+1${rollCommand.fear ?? 'd12'}`;
|
||||||
const advantageRoll = `${advantageState === true ? '+d6' : advantageState === false ? '-d6' : ''}`;
|
const advantageRoll = `${advantageState === true ? '+d6' : advantageState === false ? '-d6' : ''}`;
|
||||||
const attributeRoll = `${trait?.value ? `${trait.value > 0 ? `+${trait.value}` : `${trait.value}`}` : ''}`;
|
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);
|
setDiceSoNiceForDualityRoll(roll, advantageState);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
export { default as DhCharacterSheet } from './sheets/actors/character.mjs';
|
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 DhpAdversarySheet } from './sheets/actors/adversary.mjs';
|
|
||||||
export { default as DhCompanionSheet } from './sheets/companion.mjs';
|
export { default as DhCompanionSheet } from './sheets/companion.mjs';
|
||||||
export { default as DhpClassSheet } from './sheets/items/class.mjs';
|
export { default as DhpClassSheet } from './sheets/items/class.mjs';
|
||||||
export { default as DhpSubclass } from './sheets/items/subclass.mjs';
|
export { default as DhpSubclass } from './sheets/items/subclass.mjs';
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ export class DHRoll extends Roll {
|
||||||
}
|
}
|
||||||
|
|
||||||
static async buildPost(roll, config, message) {
|
static async buildPost(roll, config, message) {
|
||||||
console.log(config)
|
console.log(config);
|
||||||
for (const hook of config.hooks) {
|
for (const hook of config.hooks) {
|
||||||
if (Hooks.call(`${SYSTEM.id}.postRoll${hook.capitalize()}`, config, message) === false) return null;
|
if (Hooks.call(`${SYSTEM.id}.postRoll${hook.capitalize()}`, config, message) === false) return null;
|
||||||
}
|
}
|
||||||
|
|
@ -374,7 +374,7 @@ export class DualityRoll extends D20Roll {
|
||||||
applyBaseBonus() {
|
applyBaseBonus() {
|
||||||
this.options.roll.modifiers = [
|
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)
|
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 = {}) {
|
static async postEvaluate(roll, config = {}) {
|
||||||
super.postEvaluate(roll, config);
|
super.postEvaluate(roll, config);
|
||||||
config.roll.type = config.type;
|
config.roll.type = config.type;
|
||||||
if(config.source?.message) {
|
if (config.source?.message) {
|
||||||
const chatMessage = ui.chat.collection.get(config.source.message);
|
const chatMessage = ui.chat.collection.get(config.source.message);
|
||||||
chatMessage.update({'system.damage': config});
|
chatMessage.update({ 'system.damage': config });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@
|
||||||
<div class="dice-result">
|
<div class="dice-result">
|
||||||
<div class="dice-tooltip">
|
<div class="dice-tooltip">
|
||||||
<div class="wrapper">
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue