mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 02:19:54 +02:00
Fixed ChatMessage damage creation
This commit is contained in:
parent
1f12a98c63
commit
42ec4f8c30
8 changed files with 152 additions and 113 deletions
|
|
@ -17,7 +17,7 @@ export class ChatDamageData extends foundry.abstract.DataModel {
|
|||
}
|
||||
|
||||
get active() {
|
||||
return Boolean(Object.keys(this.types).length);
|
||||
return !!this.main || Boolean(Object.keys(this.resources).length);
|
||||
}
|
||||
|
||||
static #validateRoll(rollJSON) {
|
||||
|
|
@ -28,12 +28,12 @@ export class ChatDamageData extends foundry.abstract.DataModel {
|
|||
}
|
||||
|
||||
_prepareRolls() {
|
||||
for (const key of Object.keys(this.types)) {
|
||||
const type = this.types[key];
|
||||
try {
|
||||
this.types[key] = Roll.fromData(type);
|
||||
this.types[key].options.modifierTotal = CONFIG.Dice.daggerheart.DHRoll.calculateTotalModifiers(type);
|
||||
} catch {}
|
||||
if (this.main) {
|
||||
this.main = Roll.fromData(this.main);
|
||||
}
|
||||
|
||||
for (const key of Object.keys(this.resources)) {
|
||||
this.resources[key] = Roll.fromData(this.resources[key]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue