diff --git a/module/rdd-carac.js b/module/rdd-carac.js index 921bbb6e..ae9cdf26 100644 --- a/module/rdd-carac.js +++ b/module/rdd-carac.js @@ -13,10 +13,10 @@ export class RdDCarac { return selectedCarac?.label?.toLowerCase()?.match(/r(e|ê)ve(( |-)actuel)?/); } - static isIgnoreEtatGeneral(selectedCarac) { + static isIgnoreEtatGeneral(selectedCarac, competence) { return !selectedCarac || RdDCarac.isChance(selectedCarac) || - RdDCarac.isReve(selectedCarac); + (RdDCarac.isReve(selectedCarac) && !competence); } /** diff --git a/module/rdd-roll.js b/module/rdd-roll.js index 6b998e44..de2f3b05 100644 --- a/module/rdd-roll.js +++ b/module/rdd-roll.js @@ -210,7 +210,7 @@ export class RdDRoll extends Dialog { rollData.finalLevel = this._computeFinalLevel(rollData); HtmlUtility._showControlWhen($(".diffMoral"), rollData.ajustements.moralTotal.used); - HtmlUtility._showControlWhen($("#etat-general"), !RdDCarac.isIgnoreEtatGeneral(rollData.selectedCarac)); + HtmlUtility._showControlWhen($("#etat-general"), !RdDCarac.isIgnoreEtatGeneral(rollData.selectedCarac, rollData.competence)); HtmlUtility._showControlWhen($("#ajust-astrologique"), RdDResolutionTable.isAjustementAstrologique(rollData)); // Sort management diff --git a/module/rolldata-ajustements.js b/module/rolldata-ajustements.js index 5eff690d..1929f7ef 100644 --- a/module/rolldata-ajustements.js +++ b/module/rolldata-ajustements.js @@ -49,7 +49,7 @@ export const referenceAjustements = { getValue: (rollData, actor) => RdDBonus.find(rollData.surpriseDefenseur).attaque, }, etat: { - isUsed: (rollData, actor) => !RdDCarac.isIgnoreEtatGeneral(rollData.selectedCarac), + isUsed: (rollData, actor) => !RdDCarac.isIgnoreEtatGeneral(rollData.selectedCarac, rollData.competence), getLabel: (rollData, actor) => 'Etat général', getValue: (rollData, actor) => actor.getEtatGeneral() },