foundryvtt-wh4-lang-fr-fr/scripts/GjkxWj9wCAclM9WA.js

17 lines
546 B
JavaScript
Raw Normal View History

2024-05-16 17:57:51 +02:00
let effects = foundry.utils.deepClone(this.item.effects.contents.filter(e => e.active));
effects.splice(effects.length - 1);
if (effects.length == 0)
{
return this.script.scriptNotification("All Effects have been used. Reset to select them again")
}
let choice = await ItemDialog.create(effects, 1, "Choose Power to Gain");
if (choice[0])
{
choice[0].update({disabled : true})
let effect = choice[0].convertToApplied();
effect.name += ` (${this.effect.name})`
this.actor.createEmbeddedDocuments("ActiveEffect", [effect]);
}