#54 Gestion complète du malus armure

This commit is contained in:
2020-12-02 14:00:54 +01:00
parent d614206859
commit 18c7eb767d
7 changed files with 37 additions and 11 deletions

View File

@ -86,11 +86,11 @@ export class RdDRollDialog extends Dialog {
}
}
// Mise à jour valeurs
$("#roll-param").text(rollData.selectedCarac.value + " / " + Misc.toSignedString(rollData.finalLevel));
$("#compdialogTitle").text(RdDRollDialog._getTitle(rollData));
$(".table-resolution").remove();
$("#resolutionTable").append(RdDResolutionTable.buildHTMLTableExtract(caracValue, rollLevel));
}
// Setup everything onload
@ -170,6 +170,16 @@ export class RdDRollDialog extends Dialog {
let malusEnc = (rollData.surencMalusApply ) ? rollData.surencMalusValue : 0;
let diffLibre = Misc.toInt(rollData.diffLibre);
let malusEncNatation = (rollData.useEncForNatation) ? -rollData.encValueForNatation : 0;
// Gestion malus armure
let malusArmureValue = 0;
if ( rollData.malusArmureValue != 0 && (rollData.selectedCarac.label == "Agilité" || rollData.selectedCarac.label == "Dérobée" )) {
$("#addon-message").text("Malus armure appliqué : " + rollData.malusArmureValue );
malusArmureValue = rollData.malusArmureValue;
} else {
$("#addon-message").text("" );
}
let diffCompetence = 0;
if (rollData.competence) {
diffCompetence = Misc.toInt(rollData.competence.data.niveau);
@ -178,7 +188,8 @@ export class RdDRollDialog extends Dialog {
diffCompetence = Misc.toInt(rollData.selectedDraconic.data.niveau);
diffLibre = RdDItemSort.getDifficulte(rollData.selectedSort, diffLibre);
}
return etat + diffCompetence + diffLibre + diffConditions + malusEnc + malusEncNatation;
return etat + diffCompetence + diffLibre + diffConditions + malusEnc + malusEncNatation + malusArmureValue;
}
/* -------------------------------------------- */