diff --git a/module/rdd-alchimie.js b/module/rdd-alchimie.js index 4028bc1d..9cdc8f64 100644 --- a/module/rdd-alchimie.js +++ b/module/rdd-alchimie.js @@ -49,20 +49,13 @@ export class RdDAlchimie { } /* -------------------------------------------- */ - static getDifficulte( aspects ) { - let aspectsArray = aspects.split('-'); - let diff = 0; - let nbDifferent = 0; - let aspectsHash = {} - for (let colconst of aspectsArray) { - if ( aspectsHash[colconst] ){ // Deja present, augmente difficulté de 1 - diff -= 1; - } else { - nbDifferent++; - aspectsHash[colconst] = colconst; // Keep track - } + static getDifficulte(aspects) { + let elements = aspects.split('-'); + let composantes = elements.length; + let distincts = Object.keys(Misc.classifyFirst(elements, it => it)).length; + if (distincts == 1) { + composantes--; } - diff = diff - ((nbDifferent>1) ? nbDifferent : 0); // Ca doit marcher .... - return Math.min(0, diff); // Pour être sur + return Math.min(0, -composantes); } } diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js index 15f69467..2fe78f6b 100644 --- a/module/rdd-calendrier.js +++ b/module/rdd-calendrier.js @@ -199,7 +199,7 @@ export class RdDCalendrier extends Application { /* -------------------------------------------- */ syncPlayerTime(calendrier) { this.calendrier = duplicate(calendrier); // Local copy update - this.updateDisplay(); // Then update + this.updateDisplay(); } /* -------------------------------------------- */ @@ -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 }); @@ -338,7 +336,7 @@ export class RdDCalendrier extends Application { if (game.user.isGM) { dateHTML = dateHTML + " - NA: " + this.getCurrentNombreAstral(); } - for (let handle of document.getElementsByClassName("calendar-move-handle")) { + for (let handle of document.getElementsByClassName("calendar-date-rdd")) { handle.innerHTML = dateHTML; } for (let heure of document.getElementsByClassName("calendar-heure-texte")) { diff --git a/styles/simple.css b/styles/simple.css index 8f14b3aa..7b875ce2 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -1093,12 +1093,7 @@ ul, li { .calendar-date-rdd { font-family: "GoudyAcc"; color: #CCC; - font-weight: bold; - font-size: 1.10rem; opacity: 90; -} -#calendar-move-handle { - font-family: "GoudyAcc"; font-size: 13px; line-height: 1; text-align: center; 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 --}}