2024-05-16 17:57:51 +02:00
|
|
|
let chatData = { whisper: ChatMessage.getWhisperRecipients("GM") }
|
|
|
|
let message = ""
|
|
|
|
|
|
|
|
let wounds = duplicate(this.actor.status.wounds)
|
|
|
|
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-06-06 21:09:27 +02:00
|
|
|
message += `<b>${this.actor.name}</b> regagne ${regen} Blessures.`
|
2024-05-16 17:57:51 +02:00
|
|
|
|
|
|
|
if (regen == 10)
|
|
|
|
{
|
2024-06-06 21:09:27 +02:00
|
|
|
message += `<br>Et guéri une Blessure Critique.`
|
|
|
|
}
|
2024-05-16 17:57:51 +02:00
|
|
|
}
|
|
|
|
else if (regen >= 8)
|
|
|
|
{
|
2024-06-06 21:09:27 +02:00
|
|
|
message += `<b>${this.actor.name}</b> a obtenu ${regen} et récupère 1 Blessure.`
|
2024-05-16 17:57:51 +02:00
|
|
|
wounds.value += 1
|
|
|
|
if (regen == 10)
|
|
|
|
{
|
2024-06-06 21:09:27 +02:00
|
|
|
message += `<br>Et guéri une Blessure Critique.`
|
2024-05-16 17:57:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2024-06-06 21:09:27 +02:00
|
|
|
message += `<b>${this.actor.name}</b> Résultat de régénération de ${regen} - Aucun effet.`
|
2024-05-16 17:57:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
await this.actor.update({ "system.status.wounds": wounds })
|
|
|
|
this.script.scriptMessage(message, { whisper: ChatMessage.getWhisperRecipients("GM") })
|