Gestion des signes draconiques #455
@ -1474,7 +1474,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async santeIncDec(name, inc, isCritique = false) {
|
||||
async santeIncDec(name, inc, options = {isCritique: false, ethylisme: false}) {
|
||||
|
||||
const sante = duplicate(Misc.templateData(this).sante);
|
||||
let compteur = sante[name];
|
||||
@ -1491,7 +1491,7 @@ export class RdDActor extends Actor {
|
||||
//console.log("New value ", inc, minValue, result.newValue);
|
||||
let fatigue = 0;
|
||||
if (name == "endurance" && !this.isEntiteCauchemar()) {
|
||||
if (result.newValue == 0 && inc < 0 && !isCritique) { // perte endurance et endurance devient 0 (sauf critique) -> -1 vie
|
||||
if (result.newValue == 0 && inc < 0 && !options.isCritique) { // perte endurance et endurance devient 0 (sauf critique) -> -1 vie
|
||||
sante.vie.value--;
|
||||
}
|
||||
result.newValue = Math.max(0, result.newValue);
|
||||
@ -1499,7 +1499,7 @@ export class RdDActor extends Actor {
|
||||
result.newValue = Math.min(result.newValue, this._computeEnduranceMax())
|
||||
}
|
||||
const perte = compteur.value - result.newValue;
|
||||
if (perte > 1) {
|
||||
if (perte > 1 && !options.ethylisme) {
|
||||
// Peut-être sonné si 2 points d'endurance perdus d'un coup
|
||||
const testIsSonne = await this.testSiSonne(sante, result.newValue);
|
||||
result.sonne = testIsSonne.sonne;
|
||||
@ -1669,7 +1669,7 @@ export class RdDActor extends Actor {
|
||||
|
||||
let enduranceLost = new Roll("1d6").roll().total;
|
||||
rollDataView.enduranceLost = enduranceLost;
|
||||
await this.santeIncDec("endurance", -enduranceLost, false);
|
||||
await this.santeIncDec("endurance", -enduranceLost, {ethylisme:true});
|
||||
// Qui a bu boira (p 164)
|
||||
let rollVolonte = await RdDResolutionTable.roll(actorData.data.carac.volonte.value, Math.min(ethylisme.value, 0) + actorData.data.compteurs.moral.value);
|
||||
rollDataView.rollVolonteIsSuccess = rollVolonte.isSuccess;
|
||||
@ -2948,7 +2948,7 @@ export class RdDActor extends Actor {
|
||||
const perteVie = this.isEntiteCauchemar()
|
||||
? { newValue: 0 }
|
||||
: await this.santeIncDec("vie", - encaissement.vie);
|
||||
const perteEndurance = await this.santeIncDec("endurance", -encaissement.endurance, (encaissement.critiques > 0));
|
||||
const perteEndurance = await this.santeIncDec("endurance", -encaissement.endurance, {critiques: encaissement.critiques > 0});
|
||||
|
||||
this.computeEtatGeneral();
|
||||
this.sheet.render(false);
|
||||
|
Loading…
Reference in New Issue
Block a user