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

22 lines
1.0 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.

// Apply changes when the mask is worn
if (args.equipped) {
this.actor.createEmbeddedDocuments("ActiveEffect", [this.item.effects.contents[1]?.convertToApplied()])
this.script.scriptMessage(`${this.actor.name} dons the <strong>${this.item.name}</strong>. <br>
They suffer 20 to all attempts to resist Disease.<br>
If they wear the mask for more than an hour or benefit from any of its effects, they are exposed to @Corruption[moderate]{Moderate Corruption}.
`,
{whisper: ChatMessage.getWhisperRecipients("GM")})
}
// Notify of lingering effects when mask is removed
else if (!args.equipped)
{
await this.item.effects.contents[0].delete();
await this.item.update({name : this.item.name += " (Used)"})
this.script.scriptMessage(`<strong>${this.item.name}</strong> on ${this.actor.name} has been taken off and loses its properties. However, the effects last for [[1d10+4]] days, after which they should be manually removed.`,
{whisper: ChatMessage.getWhisperRecipients("GM")}
)
}