foundryvtt-wh4-lang-fr-fr/reference_scripts/03mJu59V4iByWlsO.js

26 lines
1.1 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// The imbiber immediately
// takes 3 Poisoned Conditions that cannot be resisted at first,
await this.actor.addCondition("poisoned", 3)
// recovers a number of Wounds equal to their Toughness Bonus,
await this.actor.modifyWounds(this.actor.system.characteristics.t.bonus)
// and acquires the Regenerate Creature Trait.
const hasRegenerate = this.actor.has("Regenerate")
if (hasRegenerate === undefined) {
fromUuid("Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR").then(trait => {
let traitItem = trait.toObject()
this.actor.createEmbeddedDocuments("Item", [traitItem], {fromEffect: this.effect.id})
})
}
this.script.scriptMessage(`<p><strong>${this.actor.prototypeToken.name}</strong> has
<ul>
<li>gained 3 Poisoned Conditions that cannot be resisted at first</li>
<li>recovered ${this.actor.system.characteristics.t.bonus} Wounds</li>
<li>acquired the Regenerate Creature Trait.</li>
</ul>
Its up to Ranald if their regenerating can outpace their poisoning.</p>
<p>When all Poisoned Conditions are lost, so too is Regenerate.</p>`,
{ whisper: ChatMessage.getWhisperRecipients("GM"), blind: true })