Fix: etat général sur Haut rêve

This commit is contained in:
Vincent Vandemeulebrouck 2021-01-13 17:30:44 +01:00
parent 55ee2ebad5
commit d1a8c13b84
3 changed files with 4 additions and 4 deletions

View File

@ -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);
}
/**

View File

@ -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

View File

@ -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()
},