Merged with development

This commit is contained in:
WBHarry 2026-01-31 19:35:46 +01:00
commit 307af5b990
11 changed files with 131 additions and 60 deletions

View file

@ -73,7 +73,7 @@ export default class EffectsField extends fields.ArrayField {
});
effects.forEach(async e => {
const effect = this.item.effects.get(e._id);
const effect = (this.item.applyEffects ?? this.item.effects).get(e._id);
if (!token.actor || !effect) return;
await EffectsField.applyEffect(effect, token.actor);
});
@ -96,7 +96,7 @@ export default class EffectsField extends fields.ArrayField {
content: await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/ui/chat/effectSummary.hbs',
{
effects: this.effects.map(e => this.item.effects.get(e._id)),
effects: this.effects.map(e => (this.item.applyEffects ?? this.item.effects).get(e._id)),
targets: messageTargets
}
)
@ -123,7 +123,7 @@ export default class EffectsField extends fields.ArrayField {
// Otherwise, create a new effect on the target
const effectData = foundry.utils.mergeObject({
...effect.toObject(),
...(effect.toObject?.() ?? effect),
disabled: false,
transfer: false,
origin: effect.uuid

View file

@ -159,6 +159,7 @@ export function ActionMixin(Base) {
}
get uuid() {
if (!(this.item instanceof game.system.api.documents.DHItem)) return null;
return `${this.item.uuid}.${this.documentName}.${this.id}`;
}