Merge branch 'bugFixAppelAuMoral' into 'master'

Bugfix Appel au moral.

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!164
This commit is contained in:
2021-03-06 09:09:58 +00:00
2 changed files with 3 additions and 3 deletions

View File

@ -1705,7 +1705,7 @@ export class RdDActor extends Actor {
createCallbackAppelAuMoral() { /* Si l'appel au moral est utilisé, on l'affiche dans le chat et on diminue éventuellement le moral */
return {
condition: r => r.use.appelAuMoral && game.settings.get("core", "rollMode") != 'selfroll',
action: r => { console.log("createCallbackAppelAuMoral"); this.displayAppelAuMoral ; console.log(r.rolled.isEchec); this._appliquerAppelMoral(r, game.settings.get("core", "rollMode") != 'blindroll') }
action: r => { this.displayAppelAuMoral ; this._appliquerAppelMoral(r, game.settings.get("core", "rollMode") != 'blindroll') }
};
}
@ -1784,7 +1784,7 @@ export class RdDActor extends Actor {
async _appliquerAppelMoral(rollData, display = true) {
if (!this.isPersonnage()) return;
if (!rollData.rolled.isEchec) return;
const waitUpdate = this.moralIncDec(-1); /* L'appel au moral a échoué. Le personnage perd un point de moral */
this.moralIncDec(-1); /* L'appel au moral a échoué. Le personnage perd un point de moral */
rollData.jetEchouerMoralDiminuer = true;
}