mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +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() {
|
get roll() {
|
||||||
if (this.parent.type === 'dualityRoll')
|
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);
|
return this.parent.rolls.find(x => x instanceof game.system.api.dice.DualityRoll);
|
||||||
|
case 'fateRoll':
|
||||||
if (this.parent.type === 'fateRoll')
|
|
||||||
return this.parent.rolls.find(x => x instanceof game.system.api.dice.FateRoll);
|
return this.parent.rolls.find(x => x instanceof game.system.api.dice.FateRoll);
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ export default class DamageField extends fields.SchemaField {
|
||||||
...config,
|
...config,
|
||||||
roll: formulas,
|
roll: formulas,
|
||||||
data: this.getRollData(),
|
data: this.getRollData(),
|
||||||
isCritical: message?.system.roll.isCritical
|
isCritical: Boolean(message?.system.roll?.isCritical)
|
||||||
};
|
};
|
||||||
delete damageConfig.evaluate;
|
delete damageConfig.evaluate;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue