forked from public/foundryvtt-reve-de-dragon
#54 Gestion complète du malus armure
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
Reference in New Issue
Block a user