2024-05-16 17:57:51 +02:00
|
|
|
let chatData = { whisper: ChatMessage.getWhisperRecipients("GM") }
|
|
|
|
let message = ""
|
|
|
|
|
2024-06-06 22:46:40 +02:00
|
|
|
let wounds = foundry.utils.duplicate(this.actor.status.wounds)
|
2024-05-16 17:57:51 +02:00
|
|
|
let regenRoll = await new Roll("1d10").roll();
|
|
|
|
let regen = regenRoll.total;
|
|
|
|
|
|
|
|
if (wounds.value >= wounds.max)
|
|
|
|
return
|
|
|
|
|
|
|
|
if (wounds.value > 0)
|
|
|
|
{
|
|
|
|
wounds.value += regen
|
|
|
|
if (wounds.value > wounds.max)
|
|
|
|
{
|
|
|
|
wounds.value = wounds.max
|
|
|
|
}
|
2024-05-17 12:46:44 +02:00
|
|
|
message += `<b>${this.actor.name}</b> guérit de ${regen} Points de Blessure.`
|
2024-05-16 17:57:51 +02:00
|
|
|
|
|
|
|
if (regen == 10)
|
|
|
|
{
|
2024-05-17 12:46:44 +02:00
|
|
|
message += `<br>De plus, il guérit d'une Blessure Critique.`
|
2024-05-16 17:57:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (regen >= 8)
|
|
|
|
{
|
2024-05-17 12:46:44 +02:00
|
|
|
message += `<b>${this.actor.name}</b> a obtenu un ${regen} et guérit 1 Point de Blessure.`
|
2024-05-16 17:57:51 +02:00
|
|
|
wounds.value += 1
|
|
|
|
if (regen == 10)
|
|
|
|
{
|
2024-05-17 12:46:44 +02:00
|
|
|
message += `<br>De plus, il guérit d'une Blessure Critique.`
|
2024-05-16 17:57:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
message += `<b>${this.actor.name}</b> Regenerate roll of ${regen} - No effect.`
|
|
|
|
}
|
|
|
|
|
|
|
|
await this.actor.update({ "system.status.wounds": wounds })
|
|
|
|
this.script.scriptMessage(message, { whisper: ChatMessage.getWhisperRecipients("GM") })
|
|
|
|
|
|
|
|
if (this.actor.Species?.toLowerCase() != "ogre")
|
|
|
|
{
|
|
|
|
this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : " - " + this.effect.name, fields : {difficulty : "average"}}).then(test => {
|
|
|
|
test.roll()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|