mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
This commit is contained in:
parent
5a7d1d204c
commit
9ce66e93fb
3 changed files with 3 additions and 3 deletions
|
|
@ -111,7 +111,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
||||||
return actorData;
|
return actorData;
|
||||||
}
|
}
|
||||||
|
|
||||||
async use(event, options) {
|
async use(event, options = {}) {
|
||||||
if (!this.actor) throw new Error("An Action can't be used outside of an Actor context.");
|
if (!this.actor) throw new Error("An Action can't be used outside of an Actor context.");
|
||||||
|
|
||||||
if (this.chatDisplay) await this.toChat();
|
if (this.chatDisplay) await this.toChat();
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
|
||||||
if(this.targetSelection === true) {
|
if(this.targetSelection === true) {
|
||||||
this.targetShort = this.targets.reduce((a,c) => {
|
this.targetShort = this.targets.reduce((a,c) => {
|
||||||
if(c.hit) a.hit += 1;
|
if(c.hit) a.hit += 1;
|
||||||
else c.miss += 1;
|
else a.miss += 1;
|
||||||
return a;
|
return a;
|
||||||
}, {hit: 0, miss: 0})
|
}, {hit: 0, miss: 0})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ export default class D20Roll extends DHRoll {
|
||||||
config.targetSelection = true;
|
config.targetSelection = true;
|
||||||
config.targets.forEach(target => {
|
config.targets.forEach(target => {
|
||||||
const difficulty = config.roll.difficulty ?? target.difficulty ?? target.evasion;
|
const difficulty = config.roll.difficulty ?? target.difficulty ?? target.evasion;
|
||||||
target.hit = this.isCritical || roll.total >= difficulty;
|
target.hit = roll.isCritical || roll.total >= difficulty;
|
||||||
});
|
});
|
||||||
data.success = config.targets.some(target => target.hit)
|
data.success = config.targets.some(target => target.hit)
|
||||||
} else if (config.roll.difficulty) {
|
} else if (config.roll.difficulty) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue