mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-22 07:23:37 +02:00
Basic rework to the roll data in messages
This commit is contained in:
parent
e2b13d6717
commit
2664979823
15 changed files with 199 additions and 226 deletions
|
|
@ -32,7 +32,6 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
|
|||
return {
|
||||
title: new fields.StringField(),
|
||||
actionDescription: new fields.HTMLField(),
|
||||
roll: new fields.ObjectField(),
|
||||
targets: targetsField(),
|
||||
hasRoll: new fields.BooleanField({ initial: false }),
|
||||
hasDamage: new fields.BooleanField({ initial: false }),
|
||||
|
|
@ -55,6 +54,16 @@ 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);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
get actionActor() {
|
||||
if (!this.source.actor) return null;
|
||||
return fromUuidSync(this.source.actor);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue