Minor fixes
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
| @@ -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 | ||||
|     }); | ||||
|   | ||||
| @@ -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; | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -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, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user