diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js index 91cf416c..2fe78f6b 100644 --- a/module/rdd-calendrier.js +++ b/module/rdd-calendrier.js @@ -247,21 +247,19 @@ export class RdDCalendrier extends Application { console.log(request); let jourDiff = this.getLectureAstrologieDifficulte(request.date); let niveau = Number(request.astrologie.data.niveau) + Number(request.conditions) + Number(jourDiff) + Number(request.etat); - let rolled = await RdDResolutionTable.rollData({ + let rollData= { caracValue: request.carac_vue, finalLevel: niveau, showDice: false - }); + }; + await RdDResolutionTable.rollData(rollData); let nbAstral = this.getNombreAstral(request.date); - let nbAstralFaux = nbAstral; + request.rolled = rollData.rolled; request.isValid = true; - request.rolled = rolled; - if (!rolled.isSuccess) { + if (!request.rolled.isSuccess) { request.isValid = false; - while (nbAstralFaux == nbAstral) { - nbAstralFaux = new Roll("1d12").roll().total; - } - nbAstral = nbAstralFaux; + let nbAstralFaux = new Roll("1d11").evaluate().total; + nbAstral = nbAstral==nbAstralFaux ? 12 : nbAstralFaux; // Mise à jour des nombres astraux du joueur let astralData = this.listeNombreAstral.find((nombreAstral, i) => nombreAstral.index == request.date); astralData.valeursFausses.push({ actorId: request.id, nombreAstral: nbAstralFaux }); diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index e3b57b5c..89d92f4a 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -461,8 +461,19 @@ {{!-- Connaissances Tab --}}