mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Added consideration for an active combatant
This commit is contained in:
parent
56ba01043d
commit
ae8db11155
2 changed files with 11 additions and 1 deletions
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue