foundryvtt-wh4-lang-fr-fr/scripts/2sDH6RvoOAR40oqH.js

20 lines
851 B
JavaScript
Raw Permalink Normal View History

2024-05-16 17:57:51 +02:00
if (!["Goblin", "Orc"].includes(this.actor.system.details.species.value)) {
let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), { appendTitle: ` - ${this.effect.name}` })
await test.roll();
if (test.failed) {
let infection = await fromUuid("Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg")
this.actor.createEmbeddedDocuments("Item", [infection])
}
}
// Since wounds change when the effect is deleted, need to wait until after
// the max wounds have been recalculated to apply damage
game.wfrp4e.utility.sleep(1000).then(async () => {
let roll = await new Roll("1d10").roll();
roll.toMessage(this.script.getChatData());
this.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true }))
})