From ae8db111558ebf3a229b38c3033af81532a254cb Mon Sep 17 00:00:00 2001 From: WBHarry Date: Sat, 7 Mar 2026 19:09:21 +0100 Subject: [PATCH] Added consideration for an active combatant --- lang/en.json | 3 ++- module/data/fields/action/transformField.mjs | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lang/en.json b/lang/en.json index 414efe43..4e786e28 100755 --- a/lang/en.json +++ b/lang/en.json @@ -81,7 +81,8 @@ "noTransformActor": "There is no assigned actor to transform into", "transformActorMissing": "The assigned actor to transform into does not exist. It was probably deleted or moved in/out of a compendium", "canvasError": "There is no active scene.", - "prototypeError": "You can only use a transform action from a Token" + "prototypeError": "You can only use a transform action from a Token", + "actorLinkError": "You cannot transform a token with Actor Link set to true" } }, "Config": { diff --git a/module/data/fields/action/transformField.mjs b/module/data/fields/action/transformField.mjs index c351c75a..f6d692af 100644 --- a/module/data/fields/action/transformField.mjs +++ b/module/data/fields/action/transformField.mjs @@ -37,6 +37,11 @@ export default class DHSummonField extends fields.SchemaField { return false; } + if (this.actor.prototypeToken.actorLink) { + ui.notifications.warn(game.i18n.localize('DAGGERHEART.ACTIONS.TYPES.transform.actorLinkError')); + return false; + } + if (!this.actor.token) { ui.notifications.warn(game.i18n.localize('DAGGERHEART.ACTIONS.TYPES.transform.prototypeError')); return false; @@ -51,6 +56,10 @@ export default class DHSummonField extends fields.SchemaField { { diff: false, recursive: false, noHook: true } ); + if (this.actor.token.combatant) { + this.actor.token.combatant.update({ actorId: actor.id, img: actor.prototypeToken.texture.src }); + } + const marks = { hitPoints: 0, stress: 0 }; if (!this.transform.resourceRefresh.hitPoints) { marks.hitPoints = Math.min(