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

21 lines
724 B
JavaScript
Raw Permalink Normal View History

2024-05-16 17:57:51 +02:00
let resistance
2024-10-08 20:52:09 +02:00
if (this.item.name.includes("(") && !this.item.name.toLowerCase().includes("(any)"))
2024-05-16 17:57:51 +02:00
{
resistance = this.item.parenthesesText
}
else
{
2024-10-08 20:52:09 +02:00
resistance = await ValueDialog.create({text : "Enter Resistance", title : "Resistance"})
2024-05-16 17:57:51 +02:00
if (resistance)
{
2024-10-08 20:52:09 +02:00
this.item.updateSource({name : `${this.item.name.split("(")[0].trim()} (${resistance})`})
2024-05-16 17:57:51 +02:00
this.effect.updateSource({name : this.effect.name + ` (${resistance})`})
}
}
2024-10-08 20:52:09 +02:00
this.item.updateSource({"system.tests.value" : this.item.system.tests.value.replace("the associated Threat", resistance)})
2024-05-16 17:57:51 +02:00
if (resistance && !this.effect.name.includes("("))
{
this.effect.updateSource({name : this.effect.name += ` (${resistance})`})
}