From 43e069cc9b002a795b905880f82d9c1f96bcac68 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sun, 13 Jun 2021 21:29:14 +0200 Subject: [PATCH 1/3] =?UTF-8?q?Fix:=20Maladresse=20non-arm=C3=A9e=20pour?= =?UTF-8?q?=20l'esquive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/rdd-combat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/rdd-combat.js b/module/rdd-combat.js index cacc3dd1..3f67425d 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -911,7 +911,7 @@ export class RdDCombat { console.log("RdDCombat._onEchecTotal >>>", rollData); const arme = rollData.arme; - const avecArme = arme?.data.categorie_parade != 'sans-armes'; + const avecArme = arme && arme.data.categorie_parade != 'sans-armes'; const action = (rollData.attackerRoll ? (arme ? "la parade" : "l'esquive") : "l'attaque"); ChatUtility.createChatWithRollMode(this.defender.name, { content: `Maladresse à ${action}! ` + await RdDRollTables.getMaladresse({ arme: avecArme }) From 094632734f563f3a397b18d38e1ce1027dc5d41a Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sun, 13 Jun 2021 21:56:01 +0200 Subject: [PATCH 2/3] Fix: Jets d'astrologies invisibles pour joueur --- module/rdd-calendrier.js | 3 ++- module/rdd-dice.js | 4 +--- module/rdd-resolution-table.js | 19 ++++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js index 26d7715c..aba59b4e 100644 --- a/module/rdd-calendrier.js +++ b/module/rdd-calendrier.js @@ -298,7 +298,8 @@ export class RdDCalendrier extends Application { let rollData = { caracValue: request.carac_vue, finalLevel: niveau, - showDice: false + showDice: false, + rollMode: "blindroll" }; await RdDResolutionTable.rollData(rollData); let nbAstral = this.getNombreAstral(request.date); diff --git a/module/rdd-dice.js b/module/rdd-dice.js index 0b77bf57..ec3afc10 100644 --- a/module/rdd-dice.js +++ b/module/rdd-dice.js @@ -134,9 +134,7 @@ export class RdDDice { static async roll(formula, options = { showDice: false, rollMode: undefined }) { const roll = new Roll(formula); await roll.evaluate({ async: true }); - if (options.showDice) { - roll.showDice = options.showDice; - } + roll.showDice = options.showDice; await RdDDice.show(roll, options.rollMode ?? game.settings.get("core", "rollMode")); return roll; } diff --git a/module/rdd-resolution-table.js b/module/rdd-resolution-table.js index 3367b6a2..2649d1fc 100644 --- a/module/rdd-resolution-table.js +++ b/module/rdd-resolution-table.js @@ -102,22 +102,23 @@ export class RdDResolutionTable { /* -------------------------------------------- */ static async rollData(rollData) { - rollData.rolled = await this.roll(rollData.caracValue, rollData.finalLevel, rollData.bonus, rollData.diviseurSignificative, rollData.showDice); + rollData.rolled = await this.roll(rollData.caracValue, rollData.finalLevel, rollData); return rollData; } /* -------------------------------------------- */ - static async roll(caracValue, finalLevel, bonus = undefined, diviseur = undefined, showDice = true) { + static async roll(caracValue, finalLevel, rollData = {}){ let chances = this.computeChances(caracValue, finalLevel); - this._updateChancesWithBonus(chances, bonus); - this._updateChancesFactor(chances, diviseur); - chances.showDice = showDice; + this._updateChancesWithBonus(chances, rollData.bonus); + this._updateChancesFactor(chances, rollData.diviseurSignificative); + chances.showDice = rollData.showDice; + chances.rollMode = rollData.rollMode; - let rolled = await this.rollChances(chances, diviseur); + let rolled = await this.rollChances(chances, rollData.diviseurSignificative); rolled.caracValue = caracValue; rolled.finalLevel = finalLevel; - rolled.bonus = bonus; - rolled.factorHtml = Misc.getFractionHtml(diviseur); + rolled.bonus = rollData.bonus; + rolled.factorHtml = Misc.getFractionHtml(rollData.diviseurSignificative); rolled.niveauNecessaire = this.findNiveauNecessaire(caracValue, rolled.roll ); rolled.ajustementNecessaire = rolled.niveauNecessaire - finalLevel; return rolled; @@ -163,7 +164,7 @@ export class RdDResolutionTable { /* -------------------------------------------- */ static async rollChances(chances, diviseur) { - chances.roll = await RdDDice.rollTotal("1d100", {showDice:chances.showDice}); + chances.roll = await RdDDice.rollTotal("1d100", chances); mergeObject(chances, this.computeReussite(chances, chances.roll, diviseur), { overwrite: true }); return chances; } From 72dedcca58cdeaf988479b0f74dbb393bed990c3 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sun, 13 Jun 2021 21:57:30 +0200 Subject: [PATCH 3/3] Version 1.4.32 --- system.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system.json b/system.json index 6753aeae..137f7ff0 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", "description": "Rêve de Dragon RPG for FoundryVTT", - "version": "1.4.31", + "version": "1.4.32", "manifestPlusVersion": "1.0.0", "minimumCoreVersion": "0.8.0", "compatibleCoreVersion": "0.8.99",