Feature/165 action save (#231)

* Roll All Save button + Merge Attack & Roll Chat message

* Fix conflicts again
This commit is contained in:
Dapoulp 2025-07-01 19:04:53 +02:00 committed by GitHub
parent b7e4169079
commit 8b834036fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 369 additions and 140 deletions

View file

@ -19,6 +19,7 @@ export default class DHDamageRoll extends foundry.abstract.TypeDataModel {
})
})
),
targetSelection: new fields.BooleanField({ initial: true }),
hasSave: new fields.BooleanField({ initial: false }),
onSave: new fields.StringField(),
source: new fields.SchemaField({
@ -34,4 +35,9 @@ export default class DHDamageRoll extends foundry.abstract.TypeDataModel {
get messageTemplate() {
return `systems/daggerheart/templates/chat/${this.messageType}-roll.hbs`;
}
prepareDerivedData() {
this.hasHitTarget = this.targets.filter(t => t.hit === true).length > 0;
this.currentTargets = this.targetSelection !== true ? Array.from(game.user.targets).map(t => DHBaseAction.formatTarget(t)) : this.targets;
}
}