forked from public/foundryvtt-reve-de-dragon
Fix des malus encombrement
This commit is contained in:
@ -50,14 +50,16 @@ export class RdDRoll extends Dialog {
|
||||
diffConditions: 0,
|
||||
diffLibre: rollData.competence?.system.default_diffLibre ?? 0,
|
||||
malusArmureValue: actor.getMalusArmure(),
|
||||
surencMalusFlag: actor.isPersonnage() ? (actorData.compteurs.surenc.value < 0) : false,
|
||||
surencMalusValue: actor.computeMalusSurEncombrement(),
|
||||
useMalusSurenc: false,
|
||||
useMoral: false, /* Est-ce que le joueur demande d'utiliser le moral ? Utile si le joueur change plusieurs fois de carac associée. */
|
||||
perteMoralEchec: false, /* Pour l'affichage dans le chat */
|
||||
use: { libre: true, conditions: true, surenc: false, encTotal: false },
|
||||
use: {
|
||||
libre: true,
|
||||
conditions: true,
|
||||
surenc: false,
|
||||
encTotal: false
|
||||
},
|
||||
isMalusEncombrementTotal: rollData.competence ? RdDItemCompetence.isMalusEncombrementTotal(rollData.competence) : 0,
|
||||
useMalusEncTotal: false,
|
||||
encTotal: actor.getEncTotal(),
|
||||
ajustementAstrologique: actor.ajustementAstrologique(),
|
||||
surprise: actor.getSurprise(false),
|
||||
@ -244,6 +246,14 @@ export class RdDRoll extends Dialog {
|
||||
this.rollData[attribute] = event.currentTarget.checked;
|
||||
this.updateRollResult();
|
||||
});
|
||||
html.find('input.use-encTotal').change((event) => {
|
||||
this.rollData.use.encTotal = event.currentTarget.checked;
|
||||
this.updateRollResult();
|
||||
});
|
||||
html.find('input.use-surenc').change((event) => {
|
||||
this.rollData.use.surenc = event.currentTarget.checked;
|
||||
this.updateRollResult();
|
||||
});
|
||||
html.find('.appel-moral').click((event) => { /* l'appel au moral, qui donne un bonus de +1 */
|
||||
this.rollData.useMoral = !this.rollData.useMoral;
|
||||
const appelMoral = html.find('.icon-appel-moral')[0];
|
||||
@ -286,6 +296,7 @@ export class RdDRoll extends Dialog {
|
||||
$(".div-sort-ptreve-fixe").text(sort.system.ptreve);
|
||||
const diffVariable = RdDItemSort.isDifficulteVariable(sort);
|
||||
const coutVariable = RdDItemSort.isCoutVariable(sort);
|
||||
|
||||
HtmlUtility._showControlWhen($(".div-sort-non-rituel"), !sort.system.isrituel);
|
||||
HtmlUtility._showControlWhen($(".div-sort-difficulte-var"), diffVariable);
|
||||
HtmlUtility._showControlWhen($(".div-sort-difficulte-fixe"), !diffVariable);
|
||||
@ -318,6 +329,8 @@ export class RdDRoll extends Dialog {
|
||||
RollDataAjustements.calcul(rollData, this.actor);
|
||||
rollData.finalLevel = this._computeFinalLevel(rollData);
|
||||
|
||||
HtmlUtility._showControlWhen($(".use-encTotal"), rollData.ajustements.encTotal.visible);
|
||||
HtmlUtility._showControlWhen($(".use-surenc"), rollData.ajustements.surenc.visible);
|
||||
HtmlUtility._showControlWhen($(".diffMoral"), rollData.ajustements.moralTotal.used);
|
||||
HtmlUtility._showControlWhen($(".divAppelAuMoral"), rollData.use.appelAuMoral);
|
||||
HtmlUtility._showControlWhen($("#etat-general"), !RdDCarac.isIgnoreEtatGeneral(rollData));
|
||||
|
Reference in New Issue
Block a user