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

12 lines
326 B
JavaScript
Raw Permalink Normal View History

2024-06-06 22:07:28 +02:00
let closed = !this.item.getFlag("wfrp4e-soc", "gunport") || false;
await this.item.setFlag("wfrp4e-soc", "gunport", closed);
2024-10-08 20:52:09 +02:00
let scriptData = this.effect.system.scriptData;
2024-06-06 22:07:28 +02:00
if (closed) {
2024-10-08 20:52:09 +02:00
scriptData[0].label = "Open";
2024-06-06 22:07:28 +02:00
} else {
2024-10-08 20:52:09 +02:00
scriptData[0].label = "Close";
2024-06-06 22:07:28 +02:00
}
2024-10-08 20:52:09 +02:00
await this.effect.update({"system.scriptData": scriptData});