Files
foundryvtt-wh4-lang-fr-fr/scripts/iNAQJa5HyaEckknX.js
LeRatierBretonnier 8862698262
All checks were successful
Validation JSON / validate (push) Successful in 15s
Release Creation / build (release) Successful in 57s
Nombreuses corections de scripts...
2026-03-07 15:02:18 +01:00

17 lines
596 B
JavaScript

let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})
await test.roll();
let opposedResult = test.opposedMessages[0]?.system.opposedHandler?.resultMessage?.system.opposedTest?.result
if (opposedResult?.winner == "attacker")
{
let spells = this.actor.itemTypes.spell;
if (spells.length)
{
let chosen = spells[Math.floor(CONFIG.Dice.randomUniform() * spells.length)]
this.script.message(`Perd l'accès à <strong>${chosen.name}</strong>`)
chosen.update({name : chosen.name += " (PERDU)"})
}
}