Fix: etat général sur Haut rêve
This commit is contained in:
parent
55ee2ebad5
commit
d1a8c13b84
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user