mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
l
This commit is contained in:
parent
dbb07008f0
commit
faa32c1fba
10 changed files with 90 additions and 59 deletions
|
|
@ -165,6 +165,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
},
|
||||
dialog: {},
|
||||
type: this.type,
|
||||
hasRoll: this.hasRoll,
|
||||
hasDamage: this.damage?.parts?.length && this.type !== 'healing',
|
||||
hasHealing: this.damage?.parts?.length && this.type === 'healing',
|
||||
hasEffect: !!this.effects?.length,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ export default class DHAdversaryRoll extends foundry.abstract.TypeDataModel {
|
|||
})
|
||||
})
|
||||
),
|
||||
targetSelection: new fields.BooleanField({ initial: true }),
|
||||
targetSelection: new fields.BooleanField({ initial: false }),
|
||||
hasRoll: new fields.BooleanField({ initial: false }),
|
||||
hasDamage: new fields.BooleanField({ initial: false }),
|
||||
hasHealing: new fields.BooleanField({ initial: false }),
|
||||
|
|
@ -47,5 +47,12 @@ export default class DHAdversaryRoll extends foundry.abstract.TypeDataModel {
|
|||
game.system.api.fields.ActionFields.TargetField.formatTarget(t)
|
||||
)
|
||||
: this.targets;
|
||||
if(this.targetSelection === true) {
|
||||
this.targetShort = this.targets.reduce((a,c) => {
|
||||
if(c.hit) a.hit += 1;
|
||||
else c.miss += 1;
|
||||
return a;
|
||||
}, {hit: 0, miss: 0})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue