mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 15:03:37 +02:00
Fix adversary damage rolls
This commit is contained in:
parent
2b8e4cb2fa
commit
2a55e317fc
2 changed files with 9 additions and 6 deletions
|
|
@ -54,11 +54,14 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
|
|||
}
|
||||
|
||||
get roll() {
|
||||
if (this.parent.type === 'dualityRoll')
|
||||
return this.parent.rolls.find(x => x instanceof game.system.api.dice.DualityRoll);
|
||||
|
||||
if (this.parent.type === 'fateRoll')
|
||||
return this.parent.rolls.find(x => x instanceof game.system.api.dice.FateRoll);
|
||||
switch (this.parent.type) {
|
||||
case 'adversaryRoll':
|
||||
return this.parent.rolls.find(x => x instanceof game.system.api.dice.D20Roll);
|
||||
case 'dualityRoll':
|
||||
return this.parent.rolls.find(x => x instanceof game.system.api.dice.DualityRoll);
|
||||
case 'fateRoll':
|
||||
return this.parent.rolls.find(x => x instanceof game.system.api.dice.FateRoll);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ export default class DamageField extends fields.SchemaField {
|
|||
...config,
|
||||
roll: formulas,
|
||||
data: this.getRollData(),
|
||||
isCritical: message?.system.roll.isCritical
|
||||
isCritical: Boolean(message?.system.roll?.isCritical)
|
||||
};
|
||||
delete damageConfig.evaluate;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue