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

22 lines
790 B
JavaScript
Raw Normal View History

2024-05-16 17:57:51 +02:00
let test = await this.actor.setupCharacteristic("int", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})
await test.roll();
let opposedResult = test.opposedMessages[0]?.getOppose()?.resultMessage?.getOpposedTest()?.result
if (opposedResult?.winner == "attacker")
{
if (test.failed && (test.result.roll % 11 == 0 || test.result.roll == 100))
{
this.actor.addCondition("unconscious")
await this.actor.update({"system.status.corruption.value" : parseInt(this.actor.status.corruption.value) + 1})
this.script.scriptMessage("Reçoit un Point de Corruption", {whisper : ChatMessage.getWhisperRecipients("GM")})
2024-05-16 17:57:51 +02:00
}
else
{
await this.actor.addCondition("stunned", 1 + opposedResult.differenceSL);
}
}
else
{
return false;
}