2024-05-16 17:57:51 +02:00
|
|
|
let resistance
|
|
|
|
if (this.item.name.includes("("))
|
|
|
|
{
|
|
|
|
resistance = this.item.parenthesesText
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2024-05-17 12:46:44 +02:00
|
|
|
resistance = await ValueDialog.create("Entrez la Résistance", "Résistance")
|
2024-05-16 17:57:51 +02:00
|
|
|
|
|
|
|
if (resistance)
|
|
|
|
{
|
|
|
|
this.item.updateSource({name : this.item.name + ` (${resistance})`})
|
|
|
|
this.effect.updateSource({name : this.effect.name + ` (${resistance})`})
|
|
|
|
}
|
|
|
|
}
|
2024-05-17 12:46:44 +02:00
|
|
|
this.item.updateSource({"system.tests.value" : this.item.system.tests.value.replace("menace associée", resistance)})
|
2024-05-16 17:57:51 +02:00
|
|
|
|
|
|
|
if (resistance && !this.effect.name.includes("("))
|
|
|
|
{
|
|
|
|
this.effect.updateSource({name : this.effect.name += ` (${resistance})`})
|
|
|
|
}
|