Perte d'endurance max
La perte maximale est l'endurance disponible
This commit is contained in:
parent
f4bb541bb7
commit
e8f69b74c7
@ -1631,6 +1631,7 @@ export class RdDActor extends Actor {
|
||||
let degatsReel = attackerRoll.degats - armure;
|
||||
|
||||
let result = RdDUtility.computeBlessuresSante(degatsReel, attackerRoll.mortalite);
|
||||
result.endurance = Math.max(result.endurance, -Number(this.data.data.sante.endurance.value));
|
||||
await this.santeIncDec("vie", result.vie);
|
||||
await this.santeIncDec("endurance", result.endurance, (result.critiques > 0));
|
||||
result.locName = (attackerRoll.loc) ? attackerRoll.loc.label : "Corps";
|
||||
|
@ -569,9 +569,9 @@ export class RdDUtility {
|
||||
/* -------------------------------------------- */
|
||||
static computeBlessuresSante( degats, mortalite="mortel" ) {
|
||||
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, over20)
|
||||
let over20 = Math.max(degats - 20, 0);
|
||||
encaissement.endurance = - RdDUtility._evaluatePerte(encaissement.endurance, over20);
|
||||
encaissement.vie = - RdDUtility._evaluatePerte(encaissement.vie, over20);
|
||||
return encaissement;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user