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

12 lines
341 B
JavaScript

let closed = !this.item.getFlag("wfrp4e-soc", "gunport") || false;
await this.item.setFlag("wfrp4e-soc", "gunport", closed);
let scriptData = this.effect.flags.wfrp4e.scriptData;
if (closed) {
scriptData[0].label = "Ouvert";
} else {
scriptData[0].label = "Fermé";
}
await this.effect.update({"flags.wfrp4e.scriptData": scriptData});