#44 - Gestion sur encombrement corrigée

This commit is contained in:
2020-11-27 15:47:18 +01:00
parent a13d2c7ea9
commit 11e8a64824
6 changed files with 25 additions and 6 deletions

View File

@ -156,6 +156,10 @@ export class RdDRollDialog extends Dialog {
this.rollData.surencMalusApply = event.currentTarget.checked;
updateRollResult(rollData);
});
html.find('#useEncForNatation').change((event) => {
this.rollData.useEncForNatation = event.currentTarget.checked;
updateRollResult(rollData);
});
}
/* -------------------------------------------- */
@ -164,6 +168,7 @@ export class RdDRollDialog extends Dialog {
const diffConditions = Misc.toInt(rollData.diffConditions);
let malusEnc = (rollData.surencMalusApply ) ? rollData.surencMalusValue : 0;
let diffLibre = Misc.toInt(rollData.diffLibre);
let malusEncNatation = (rollData.useEncForNatation) ? -rollData.encValueForNatation : 0;
let diffCompetence = 0;
if (rollData.competence) {
diffCompetence = Misc.toInt(rollData.competence.data.niveau);
@ -172,7 +177,7 @@ export class RdDRollDialog extends Dialog {
diffCompetence = Misc.toInt(rollData.selectedDraconic.data.niveau);
diffLibre = RdDItemSort.getDifficulte(rollData.selectedSort, diffLibre);
}
return etat + diffCompetence + diffLibre + diffConditions + malusEnc;
return etat + diffCompetence + diffLibre + diffConditions + malusEnc + malusEncNatation;
}
/* -------------------------------------------- */