Merge branch 'main' into feature/death-moves

This commit is contained in:
Chris Ryan 2026-01-16 20:30:05 +10:00
commit 6ea09551fe
19 changed files with 49 additions and 173 deletions

View file

@ -167,7 +167,9 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
const config = foundry.utils.deepClone(this.system);
config.event = event;
if (this.system.action) {
await this.system.action.addEffects(config);
const actor = await foundry.utils.fromUuid(config.source.actor);
const item = actor?.items.get(config.source.item) ?? null;
config.effects = await game.system.api.data.actions.actionsTypes.base.getEffects(actor, item);
await this.system.action.workflow.get('damage')?.execute(config, this._id, true);
}
@ -201,7 +203,16 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
return ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelectedOrPerm'));
this.consumeOnSuccess();
this.system.action?.workflow.get('applyDamage')?.execute(config, targets, true);
if (this.system.action) this.system.action.workflow.get('applyDamage')?.execute(config, targets, true);
else {
for (const target of targets) {
const actor = await foundry.utils.fromUuid(target.actorId);
if (!actor) continue;
if (this.system.hasHealing) actor.takeHealing(this.system.damage);
else actor.takeDamage(this.system.damage);
}
}
}
async onRollSave(event) {