diff --git a/module/rdd-roll-dialog.js b/module/rdd-roll-dialog.js index c434c475..71afc43b 100644 --- a/module/rdd-roll-dialog.js +++ b/module/rdd-roll-dialog.js @@ -71,7 +71,13 @@ export class RdDRollDialog extends Dialog { rollData.finalLevel = rollLevel; rollData.caracValue = caracValue - + + if (RdDRollDialog._isEtatGeneralApplicable(rollData)) { + $(".etat-general").show(); + } + else { + $(".etat-general").hide(); + } // Sort management if ( rollData.selectedSort ) { //console.log("Toggle show/hide", rollData.selectedSort); @@ -167,9 +173,16 @@ export class RdDRollDialog extends Dialog { }); } + static _isEtatGeneralApplicable(rollData) { + if (rollData.selectedCarac.label == 'Chance') return false; + if (rollData.selectedCarac.label == 'Rêve Actuel') return false; + + return true; + } + /* -------------------------------------------- */ static _computeFinalLevel(rollData) { - const etat = Misc.toInt(rollData.etat); + const etat = RdDRollDialog._isEtatGeneralApplicable(rollData) ? Misc.toInt(rollData.etat) : 0; const diffConditions = Misc.toInt(rollData.diffConditions); let malusEnc = (rollData.surencMalusApply ) ? rollData.surencMalusValue : 0; let diffLibre = Misc.toInt(rollData.diffLibre); diff --git a/templates/dialog-competence.html b/templates/dialog-competence.html index dc929b5f..316ef4cb 100644 --- a/templates/dialog-competence.html +++ b/templates/dialog-competence.html @@ -45,7 +45,7 @@ {{/if}} {{>"systems/foundryvtt-reve-de-dragon/templates/dialog-roll-surenc.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/dialog-roll-natation.html"}} -