2024-05-16 17:57:51 +02:00
|
|
|
let type = this.item.getFlag("wfrp4e", "breath")
|
|
|
|
let types = {
|
2024-05-17 01:07:37 +02:00
|
|
|
none : "Aucun",
|
|
|
|
cold : "Froid",
|
2024-05-16 17:57:51 +02:00
|
|
|
corrosion : "Corrosion",
|
2024-05-17 01:07:37 +02:00
|
|
|
fire : "Feu",
|
|
|
|
electricity : "Electricité",
|
2024-05-16 17:57:51 +02:00
|
|
|
poison : "Poison",
|
2024-05-17 01:07:37 +02:00
|
|
|
smoke : "Fumée",
|
|
|
|
various : "Divers"
|
2024-05-16 17:57:51 +02:00
|
|
|
}
|
|
|
|
if (!type)
|
|
|
|
{
|
2024-05-17 01:07:37 +02:00
|
|
|
type = (await ItemDialog.create(ItemDialog.objectToArray(types, this.item.img), 1, "Choisir le Souffle"))[0]?.id;
|
2024-05-16 17:57:51 +02:00
|
|
|
this.item.updateSource({"flags.wfrp4e.breath" : type})
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!this.item.name.includes("(") && types[type] && type != "none")
|
|
|
|
{
|
|
|
|
this.item.updateSource({name : this.item.name += ` (${types[type]})`, "system.specification.value" : this.item.system.specification.value.replace("(Type)", "").trim()})
|
|
|
|
}
|