From da6d6584c4a3a93279beaa6bb094bd8517c326fc Mon Sep 17 00:00:00 2001 From: sladecraven Date: Wed, 28 Sep 2022 20:36:54 +0200 Subject: [PATCH] Minor fixes --- modules/mournblade-actor.js | 5 +++++ modules/mournblade-utility.js | 11 ++++++++--- system.json | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/modules/mournblade-actor.js b/modules/mournblade-actor.js index 784d9ee..db3b114 100644 --- a/modules/mournblade-actor.js +++ b/modules/mournblade-actor.js @@ -412,6 +412,11 @@ export class MournbladeActor extends Actor { /* -------------------------------------------- */ async rollRune(runeId) { + let comp = this.items.find(comp => comp.type == "competence" && comp.name.toLowerCase() == "savoir : runes") + if ( !comp) { + ui.notifications.warn("La compétence Savoirs : Runes n'a pas été trouvée, abandon.") + return + } let rollData = this.getCommonRollData("cla", undefined, "Savoir : Runes") rollData.rune = duplicate(this.items.get(runeId) || {}) rollData.difficulte = rollData.rune?.system?.seuil || 0 diff --git a/modules/mournblade-utility.js b/modules/mournblade-utility.js index 7b4771b..7dad81a 100644 --- a/modules/mournblade-utility.js +++ b/modules/mournblade-utility.js @@ -281,10 +281,11 @@ export class MournbladeUtility { } } + //console.log("Result : ", rollData) if (rollData.difficulte > 0 && !rollData.isDramatique) { - rollData.isSuccess = (rollData.roll.finalResult >= rollData.difficulte) - rollData.isHeroique = ((rollData.roll.finalResult - rollData.difficulte) >= 10) - rollData.isDramatique = ((rollData.roll.finalResult - rollData.difficulte) <= -10) + rollData.isSuccess = (rollData.finalResult >= rollData.difficulte) + rollData.isHeroique = ((rollData.finalResult - rollData.difficulte) >= 10) + rollData.isDramatique = ((rollData.finalResult - rollData.difficulte) <= -10) } } @@ -307,6 +308,7 @@ export class MournbladeUtility { actor.changeEclat(-1) } } + //console.log("BEFORE COMP", rollData) if (rollData.competence) { rollData.predilections = duplicate( rollData.competence.system.predilections.filter( pred => !pred.used) || [] ) let compmod = (rollData.competence.system.niveau == 0) ? -3 : 0 @@ -324,6 +326,9 @@ export class MournbladeUtility { if ( rollData.runemode == "inscrire") { rollData.runeduree *= 2 } + if ( rollData.runemode == "prononcer") { + rollData.runeduree = 1 + } } let myRoll = new Roll(rollData.diceFormula).roll({ async: false }) diff --git a/system.json b/system.json index 5298b97..8913833 100644 --- a/system.json +++ b/system.json @@ -1,7 +1,7 @@ { "id": "fvtt-mournblade", "description": "Mournblade RPG for FoundryVTT", - "version": "10.0.6", + "version": "10.0.7", "authors": [ { "name": "Uberwald/LeRatierBretonnien", @@ -15,7 +15,7 @@ "gridUnits": "m", "license": "LICENSE.txt", "manifest": "https://www.uberwald.me/gitea/public/fvtt-mournblade/raw/branch/v10/system.json", - "download": "https://www.uberwald.me/gitea/public/fvtt-mournblade/archive/fvtt-mournblade-10.0.6.zip", + "download": "https://www.uberwald.me/gitea/public/fvtt-mournblade/archive/fvtt-mournblade-10.0.7.zip", "packs": [ { "type": "Item",