diff --git a/module/actor.js b/module/actor.js index 6c0b413c..f0c1dcc3 100644 --- a/module/actor.js +++ b/module/actor.js @@ -897,6 +897,7 @@ export class RdDActor extends Actor { if (this.type == 'personnage') minValue = name == "vie" ? Number(-this.data.data.attributs.sconst.value) : 0; let newValue = Math.max(minValue, Math.min(data.value + inc, data.max)); + //console.log("New value ", inc, minValue, newValue); if (name == "endurance" && this.data.type != 'entite' ) { if ( sante.fatigue && inc < 0 ) { // Each endurance lost -> fatigue lost @@ -1291,15 +1292,15 @@ export class RdDActor extends Actor { } /* -------------------------------------------- */ - encaisserDommages( attackerRoll ) { + async encaisserDommages( attackerRoll ) { console.log("encaisserDommages", attackerRoll ) const armure = this.computeArmure( attackerRoll.loc, attackerRoll.domArmePlusDom); let degatsReel = attackerRoll.degats - armure; let result = RdDUtility.computeBlessuresSante(degatsReel, attackerRoll.mortalite); if ( this.data.type != 'entite') // Pas de PV chez les entités - this.santeIncDec("vie", result.vie); - this.santeIncDec("endurance", result.endurance); + await this.santeIncDec("vie", result.vie); + await this.santeIncDec("endurance", result.endurance); result.locName = (attackerRoll.loc) ? attackerRoll.loc.label : "Corps"; this.manageBlessures(result); // Will upate the result table diff --git a/module/rdd-roll-encaisser.js b/module/rdd-roll-encaisser.js index c365dfad..7e2d3ef7 100644 --- a/module/rdd-roll-encaisser.js +++ b/module/rdd-roll-encaisser.js @@ -33,9 +33,11 @@ export class RdDEncaisser extends Dialog { /* -------------------------------------------- */ performEncaisser(html, mortalite = "mortel") { + const ajustement = Number(this.modifier); + const encaissement = new Roll("2d10").roll().total + ajustement; this.actor.encaisserDommages({ - degats: new Roll("2d10").roll().total, - domArmePlusDom: Number(this.modifier), + degats: encaissement, + domArmePlusDom: ajustement, loc: { result: 0, label: "Corps" }, mortalite: mortalite }); diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 4f38a261..ef3cbd9d 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -508,7 +508,7 @@ export class RdDUtility { let encaissement = RdDUtility.selectEncaissement(degats, mortalite) let over20 = degats > 20 ? degats - 20 : 0 encaissement.endurance = - RdDUtility._evaluatePerte(encaissement.endurance, over20) - encaissement.vie = - RdDUtility._evaluatePerte(encaissement.vie, degats, over20) + encaissement.vie = - RdDUtility._evaluatePerte(encaissement.vie, over20) return encaissement; } diff --git a/system.json b/system.json index 175638fe..87031b1f 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", "description": "Rêve de Dragon RPG for FoundryVTT", - "version": "0.9.95", + "version": "0.9.96", "minimumCoreVersion": "0.7.5", "compatibleCoreVersion": "0.7.6", "templateVersion": 51,