Fix dissolution

La dissolution n'est que de 1 point
This commit is contained in:
Vincent Vandemeulebrouck 2022-12-15 00:01:27 +01:00
parent a58f701ca6
commit 0f7f609a2a
1 changed files with 3 additions and 2 deletions

View File

@ -1884,13 +1884,14 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async moralIncDec(ajustementMoral) {
if (ajustementMoral != 0) {
ajustementMoral = Math.sign(ajustementMoral)
let moral = Misc.toInt(this.system.compteurs.moral.value) + ajustementMoral
if (moral > 3) { // exaltation
const exaltation = Misc.toInt(this.system.compteurs.exaltation.value) + moral - 3;
const exaltation = Misc.toInt(this.system.compteurs.exaltation.value) + ajustementMoral;
await this.updateCompteurValue('exaltation', exaltation);
}
if (moral < -3) { // dissolution
const dissolution = Misc.toInt(this.system.compteurs.dissolution.value) + 3 - moral;
const dissolution = Misc.toInt(this.system.compteurs.dissolution.value) - ajustementMoral;
await this.updateCompteurValue('dissolution', dissolution);
}
moral = Math.max(-3, Math.min(moral, 3));