mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-21 18:09:54 +02:00
Correted chatDamageData isCritical so it works for both TagTeam and normal chatMessage damage
This commit is contained in:
parent
cfb6bc2479
commit
d33277f2be
1 changed files with 9 additions and 3 deletions
|
|
@ -1,4 +1,6 @@
|
||||||
import { triggerChatRollFx } from '../../helpers/utils.mjs';
|
import { triggerChatRollFx } from '../../helpers/utils.mjs';
|
||||||
|
import { MemberData } from '../tagTeamData.mjs';
|
||||||
|
import DHActorRoll from './actorRoll.mjs';
|
||||||
|
|
||||||
export class ChatDamageData extends foundry.abstract.DataModel {
|
export class ChatDamageData extends foundry.abstract.DataModel {
|
||||||
constructor(data = {}, options = {}) {
|
constructor(data = {}, options = {}) {
|
||||||
|
|
@ -8,10 +10,14 @@ export class ChatDamageData extends foundry.abstract.DataModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
get isCritical() {
|
get isCritical() {
|
||||||
if (!this.parent?.parent) return false;
|
if (this.parent && this.parent instanceof MemberData) {
|
||||||
|
return this.parent.roll.isCritical;
|
||||||
|
}
|
||||||
|
if (this.parent && this.parent instanceof DHActorRoll && this.parent.parent) {
|
||||||
|
return Roll.fromJSON(this.parent.parent._source.rolls[0]).isCritical;
|
||||||
|
}
|
||||||
|
|
||||||
const roll = Roll.fromJSON(this.parent.parent._source.rolls[0]);
|
return false;
|
||||||
return roll.isCritical;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static defineSchema() {
|
static defineSchema() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue