Chiffre astral ajuste la chance

This commit is contained in:
2020-12-11 03:23:34 +01:00
parent 02f04791b9
commit a75157226e
4 changed files with 28 additions and 15 deletions

View File

@ -40,7 +40,8 @@ export class RdDRoll extends Dialog {
surencMalusApply: false,
isNatation: rollData.competence ? rollData.competence.name.toLowerCase().includes("natation") : false,
useEncForNatation: false,
encValueForNatation: actor.encombrementTotal ? Math.floor(actor.encombrementTotal) : 0
encValueForNatation: actor.encombrementTotal ? Math.floor(actor.encombrementTotal) : 0,
ajustementAstrologique: actor.ajustementAstrologique()
},
{ overwrite: false });
}
@ -199,7 +200,7 @@ export class RdDRoll extends Dialog {
let malusEnc = (rollData.surencMalusApply) ? rollData.surencMalusValue : 0;
let diffLibre = Misc.toInt(rollData.diffLibre);
let malusEncNatation = (rollData.useEncForNatation) ? -rollData.encValueForNatation : 0;
let ajustementChance = rollData.selectedCarac.label.toLowerCase().includes('chance') ? rollData.ajustementAstrologique : 0;
// Gestion malus armure
let malusArmureValue = 0;
if (rollData.malusArmureValue != 0 && (rollData.selectedCarac.label == "Agilité" || rollData.selectedCarac.label == "Dérobée")) {
@ -209,6 +210,7 @@ export class RdDRoll extends Dialog {
$("#addon-message").text("");
}
let diffCompetence = 0;
if (rollData.competence) {
diffCompetence = Misc.toInt(rollData.competence.data.niveau);
@ -218,7 +220,7 @@ export class RdDRoll extends Dialog {
diffLibre = RdDItemSort.getDifficulte(rollData.selectedSort, diffLibre);
}
return etat + diffCompetence + diffLibre + diffConditions + malusEnc + malusEncNatation + malusArmureValue;
return etat + diffCompetence + diffLibre + diffConditions + malusEnc + malusEncNatation + malusArmureValue + ajustementChance;
}
/* -------------------------------------------- */