foundryvtt-wh4-lang-fr-fr/scripts/8ByuHnUZ4RNTdGVv.js

17 lines
838 B
JavaScript
Raw Permalink Normal View History

2024-05-16 17:57:51 +02:00
let strLoss = Math.ceil(CONFIG.Dice.randomUniform() * 10)
let tghLoss = Math.ceil(CONFIG.Dice.randomUniform() * 10)
if (!this.actor.has("Mort-vivant") && !this.actor.has("Démoniaque"))
2024-05-16 17:57:51 +02:00
{
this.actor.setupSkill(game.i18n.localize("NAME.Cool"), { appendTitle: " - " + this.effect.name, fields: { difficulty: "average" }, context: { failure: `Pert de ${strLoss} en Force et ${tghLoss} en Endurance` } }).then(async test => {
2024-05-16 17:57:51 +02:00
await test.roll();
if (test.failed) {
this.actor.update({ "system.characteristics.s.initial": this.actor.system.characteristics.s.initial - strLoss, "system.characteristics.t.initial": this.actor.system.characteristics.t.initial - tghLoss })
}
})
}
else {
this.script.scriptNotification(`<strong>${this.actor.name}</strong> est immunisé à ${this.effect.name}`)
2024-05-16 17:57:51 +02:00
}