foundryvtt-wh4-lang-fr-fr/reference_scripts/QfTBRGXVfwQSghmd.js

19 lines
669 B
JavaScript
Raw Permalink Normal View History

2024-06-06 21:09:27 +02:00
fromUuid(this.effect.origin).then(caster => {
if (caster) {
if (actor.items.find(it => it.name == game.i18n.localize("Bestial"))) {
let healed = caster.characteristics.wp.bonus
let wounds = duplicate(args.actor.status.wounds)
wounds.value += healed
if (wounds.value > wounds.max)
wounds.value = wounds.max
args.actor.update({ "system.status.wounds": wounds })
ChatMessage.create({ content: `${this.actor.prototypeToken.name} regains ${healed} Wounds`, speaker: { alias: this.effect.name } })
} else {
ui.notifications.warn("Target actor has no Bestial trait")
}
}
})