Open Bogster13 opened 1 day ago
Here is an updated script for Seal Wounds that seems to works with Foundry 12
let sourceActor = game.actors.get(this.effect.system.sourceData.test.context.speaker.actor);
let healed = this.actor.system.characteristics.tgh.bonus + this.effect.system.sourceData.test.result.SL + sourceActor.system.characteristics.wil.bonus;
this.script.scriptMessage("<strong>" + this.actor.name + "</strong> healed " + healed + " wounds");
await this.actor.update({"system.combat.wounds.value" : this.actor.system.combat.wounds.value - healed});
await this.actor.hasCondition("bleeding")?.delete()
let existing = this.actor.effects.find(e => e.getFlag("impmal", "sealWounds"))
if (existing)
{
await this.actor.addCondition("fatigued")
this.script.options.immediate.deleteEffect = true;
}
else
{
this.effect.updateSource({"flags.impmal.sealWounds" : true})
}
Thanks, but editing the script probably isn't ideal. If the sourceActor
getter isn't working then many other scripts are likely broken.
This is probably because of the Warhammer Library integration where things aren't lining up correctly.
Oh I agree that it's not ideal, mostly wrote it as a temporary solution to use in my own game until it can get fixed.
Describe the bug When using Seal Wounds the effect will fail to apply to the target.
To Reproduce Use Foundry 12, use seal wound with a target attempt to apply.
Uncaught (in promise) TypeError: this.effect.sourceTest.actor is undefined [Detected 1 package: warhammer-lib(1.2.2)]
I think the problem might be in the WarhammerLibrary-FVTT - src/document/effect.js
If i understand it correctly we should use this.effect.sourceActor to get the source actor now instead of this.effect.sourceTest.actor.system.characteristics.wil.bonus; because sourceTest no longer has an actor in Foundry 12.
But this.effect.sourceActor will fail because it relies on sourceTest that will return test.data instead of just test.
might need to be this
this.effect.system.sourceData.test.context.speaker
returns an object that should be usable by the functionObject { scene: "NUEDEFAULTSCENE0", token: "NAbITbQYjYA5fK4K", actor: "QiMSgysDqIaNjdGp", alias: "Primaris Biomancer" }
while this.sourceTest.context.speaker will return an error because sourceTest return test.data and there is no test.data.context, context is one step up in test.context.