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

21 lines
635 B
JavaScript
Raw Normal View History

2024-05-16 17:57:51 +02:00
let resistance
if (this.item.name.includes("("))
{
resistance = this.item.parenthesesText
}
else
{
resistance = await ValueDialog.create("Enter Resistance", "Resistance")
if (resistance)
{
this.item.updateSource({name : this.item.name + ` (${resistance})`})
this.effect.updateSource({name : this.effect.name + ` (${resistance})`})
}
}
this.item.updateSource({"system.tests.value" : this.item.system.tests.value.replace("the associated Threat", resistance)})
if (resistance && !this.effect.name.includes("("))
{
this.effect.updateSource({name : this.effect.name += ` (${resistance})`})
}