forked from public/foundryvtt-reve-de-dragon
#44 - Gestion sur encombrement corrigée
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
Reference in New Issue
Block a user