[V14] Message Rolls Rework (#1757)

* Basic rework to the roll data in messages

* .

* Fixed advantage/disadvantage

* .

* .

* Fixed TagTeamDialog

* Reuse getter in faces setter

* Simplify fate roll type css class

* Add more caution to the dualityRoll fromData function

* Apply suggestion from @CarlosFdez

* Compute modifiers using deterministic terms (#1758)

---------

Co-authored-by: Carlos Fernandez <cfern1990@gmail.com>
Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
This commit is contained in:
WBHarry 2026-03-31 17:20:22 +02:00 committed by GitHub
parent dbd5ef8bb0
commit f156b12d79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 267 additions and 249 deletions

View file

@ -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);