Fix ajustements visible
This commit is contained in:
parent
a9d49d793c
commit
77f0a93eb6
@ -95,7 +95,7 @@ export class RdDCarac {
|
||||
* ainsi que de Perception active et volontaire.
|
||||
*/
|
||||
static isActionPhysique(selectedCarac) {
|
||||
return Grammar.toLowerCaseNoAccent(selectedCarac?.label).match(/(apparence|force|agilite|dexterite|vue|ouie|odorat|empathie|melee|tir|lancer|derobee)/);
|
||||
return Grammar.toLowerCaseNoAccent(selectedCarac?.label)?.match(/(apparence|force|agilite|dexterite|vue|ouie|odorat|empathie|melee|tir|lancer|derobee)/);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -55,7 +55,7 @@ export const referenceAjustements = {
|
||||
getValue: (rollData, actor) => actor.getEtatGeneral()
|
||||
},
|
||||
malusArmure: {
|
||||
isVisible: (rollData, actor) => RdDCarac.isAgiliteOuDerivee(rollData.competence),
|
||||
isVisible: (rollData, actor) => RdDCarac.isAgiliteOuDerivee(rollData.selectedCarac),
|
||||
isUsed: (rollData, actor) => RdDCarac.isAgiliteOuDerivee(rollData.selectedCarac),
|
||||
getLabel: (rollData, actor) => 'Malus armure',
|
||||
getValue: (rollData, actor) => actor.getMalusArmure()
|
||||
@ -131,6 +131,7 @@ export class RollDataAjustements {
|
||||
for (var key in referenceAjustements) {
|
||||
const reference = referenceAjustements[key];
|
||||
rollData.ajustements[key] = {
|
||||
visible: reference.isVisible && reference.isVisible(rollData, actor),
|
||||
used: reference.isUsed(rollData, actor),
|
||||
label: reference.getLabel && reference.getLabel(rollData, actor),
|
||||
value: reference.getValue && reference.getValue(rollData, actor),
|
||||
|
Loading…
Reference in New Issue
Block a user