mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-05 20:34:15 +02:00
Compare commits
3 commits
c958acabe6
...
5b61340fee
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b61340fee | ||
|
|
acafd2c8b9 | ||
|
|
9473250f0c |
5 changed files with 15 additions and 9 deletions
|
|
@ -309,7 +309,7 @@ Hooks.on('chatMessage', (_, message) => {
|
|||
target,
|
||||
difficulty,
|
||||
title,
|
||||
label: 'test',
|
||||
label: game.i18n.localize('DAGGERHEART.GENERAL.dualityRoll'),
|
||||
actionType: null,
|
||||
advantage
|
||||
});
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ export class DHActionRollData extends foundry.abstract.DataModel {
|
|||
if (this.type === CONFIG.DH.GENERAL.rollTypes.attack.id)
|
||||
modifiers.push({
|
||||
label: 'Bonus to Hit',
|
||||
value: this.bonus ?? this.parent.actor.system.attack.roll.bonus
|
||||
value: this.bonus ?? this.parent.actor.system.attack.roll.bonus ?? 0
|
||||
});
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -35,7 +35,9 @@ export default class D20Roll extends DHRoll {
|
|||
|
||||
get isCritical() {
|
||||
if (!this.d20._evaluated) return;
|
||||
return this.d20.total >= this.data.system.criticalThreshold;
|
||||
|
||||
const criticalThreshold = this.options.actionType === 'reaction' ? 20 : this.data.system.criticalThreshold;
|
||||
return this.d20.total >= criticalThreshold;
|
||||
}
|
||||
|
||||
get hasAdvantage() {
|
||||
|
|
|
|||
|
|
@ -131,11 +131,13 @@ export default class DualityRoll extends D20Roll {
|
|||
return;
|
||||
}
|
||||
|
||||
const { defaultHopeDice, defaultFearDice } = this.data.rules.dualityRoll;
|
||||
|
||||
this.terms[0] = new foundry.dice.terms.Die({ faces: defaultHopeDice });
|
||||
this.terms[0] = new foundry.dice.terms.Die({
|
||||
faces: this.data.rules.dualityRoll?.defaultHopeDice ?? 12
|
||||
});
|
||||
this.terms[1] = new foundry.dice.terms.OperatorTerm({ operator: '+' });
|
||||
this.terms[2] = new foundry.dice.terms.Die({ faces: defaultFearDice });
|
||||
this.terms[2] = new foundry.dice.terms.Die({
|
||||
faces: this.data.rules.dualityRoll?.defaultFearDice ?? 12
|
||||
});
|
||||
}
|
||||
|
||||
applyAdvantage() {
|
||||
|
|
@ -259,6 +261,8 @@ export default class DualityRoll extends D20Roll {
|
|||
}
|
||||
|
||||
static async handleTriggers(roll, config) {
|
||||
if (!config.source?.actor) return;
|
||||
|
||||
const updates = [];
|
||||
const dualityUpdates = await game.system.registeredTriggers.runTrigger(
|
||||
CONFIG.DH.TRIGGER.triggers.dualityRoll.id,
|
||||
|
|
|
|||
|
|
@ -86,9 +86,9 @@ export const enrichedDualityRoll = async (
|
|||
const config = {
|
||||
event: event ?? {},
|
||||
title: title,
|
||||
headerTitle: label,
|
||||
roll: {
|
||||
trait: traitValue && target ? traitValue : null,
|
||||
label: label,
|
||||
difficulty: difficulty,
|
||||
advantage,
|
||||
type: reaction ? 'reaction' : null
|
||||
|
|
@ -101,7 +101,7 @@ export const enrichedDualityRoll = async (
|
|||
await target.diceRoll(config);
|
||||
} else {
|
||||
// For no target, call DualityRoll directly with basic data
|
||||
config.data = { experiences: {}, traits: {} };
|
||||
config.data = { experiences: {}, traits: {}, rules: {} };
|
||||
config.source = { actor: null };
|
||||
await CONFIG.Dice.daggerheart.DualityRoll.build(config);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue