From 807e58e36a56ca8602c60aca9f9f2fb36b19dfec Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Tue, 19 Jan 2021 23:01:14 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20pertes=20des=20entit=C3=A9s=20de=20cauche?= =?UTF-8?q?mar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/module/actor.js b/module/actor.js index 78e19e36..5dff7740 100644 --- a/module/actor.js +++ b/module/actor.js @@ -1151,7 +1151,7 @@ export class RdDActor extends Actor { const sante = duplicate(this.data.data.sante); let compteur = sante[name]; if (!compteur) { - return; + return ; } let result = { sonne: false, @@ -2236,7 +2236,9 @@ export class RdDActor extends Actor { let encaissement = this.jetEncaissement(rollData); this.ajouterBlessure(encaissement); // Will upate the result table - const perteVie = await this.santeIncDec("vie", - encaissement.vie); + const perteVie = this.isEntiteCauchemar() + ? { newValue: 0} + : await this.santeIncDec("vie", - encaissement.vie); const perteEndurance = await this.santeIncDec("endurance", -encaissement.endurance, (encaissement.critiques > 0)); this.computeEtatGeneral(); @@ -2250,7 +2252,7 @@ export class RdDActor extends Actor { encaissement.sonne = perteEndurance.sonne; encaissement.jetEndurance = perteEndurance.jetEndurance; encaissement.endurance = santeOrig.endurance.value - perteEndurance.newValue; - encaissement.vie = santeOrig.vie.value - perteVie.newValue; + encaissement.vie = this.isEntiteCauchemar() ? 0 : (santeOrig.vie.value - perteVie.newValue); ChatUtility.createChatWithRollMode(this.name, { roll: encaissement.roll,