From b7471e0c978530d2b47b8a93f3cfa609d7c4769c Mon Sep 17 00:00:00 2001 From: sladecraven Date: Sat, 5 Sep 2020 22:56:33 +0200 Subject: [PATCH] Bugfixes --- changelog.md | 8 +++++++- module/actor.js | 17 ++++------------- module/rdd-utility.js | 2 +- system.json | 2 +- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/changelog.md b/changelog.md index ee4e9e0a..aa750b5c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,10 @@ +================================================================== +v0.9.2 - 05/09/2020 + +Erreur de calcul sur points de vie +Gestion différente des compétences "troncs" + +================================================================== v0.9.1 - 03/09/2020 Initial official release -Z diff --git a/module/actor.js b/module/actor.js index 24fdbcd5..284daa92 100644 --- a/module/actor.js +++ b/module/actor.js @@ -298,21 +298,12 @@ export class RdDActor extends Actor { let troncList = RdDUtility.isTronc( compName ); let maxNiveau = compValue; if ( troncList ) { - let troncCompValue = (compValue > 0) ? 0 : compValue; // Clamp it to 0 + let message = "Vous avez modifié une compétence 'tronc'. Vérifiez que les compétences suivantes évoluent ensemble jusqu'au niveau 0 : "; for(let troncName of troncList) { - if ( troncName != compName) { - console.log("Update competence tronc", troncName, compValue); - let comp2 = RdDUtility.findCompetence( this.data.items, troncName); - if (comp2.data.niveau > maxNiveau) maxNiveau = comp2.data.niveau; - if ( comp2.data.niveau <= 0 && comp2.data.niveau < troncCompValue ) { // Update only of below 0 - const update = {_id: comp2._id, 'data.niveau': compValue }; - const updated = await this.updateEmbeddedEntity("OwnedItem", update); // Updates one EmbeddedEntity - } - } - } - if ( compValue < maxNiveau) { // Manage case when someone set a value below - compValue = (maxNiveau > 0) ? 0 : maxNiveau; + message += "
" + troncName; } + ChatMessage.create( { title : "Compétence Tron", + content: message } ); } const update = {_id: comp._id, 'data.niveau': maxNiveau }; const updated = await this.updateEmbeddedEntity("OwnedItem", update); // Updates one EmbeddedEntity diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 7866d57a..c2f76848 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -295,7 +295,7 @@ export class RdDUtility { data.carac.tir.value = Math.floor( (parseInt(data.carac.vue.value) + parseInt(data.carac.dexterite.value)) / 2); data.carac.lancer.value = Math.floor( (parseInt(data.carac.tir.value) + parseInt(data.carac.force.value)) / 2); - data.sante.vie.max = Math.ceil( parseInt(data.carac.taille.value) + parseInt(data.carac.constitution.value) /2 ); + data.sante.vie.max = Math.ceil( (parseInt(data.carac.taille.value) + parseInt(data.carac.constitution.value)) /2 ); if ( data.sante.vie.value > data.sante.vie.max) data.sante.vie.value = data.sante.vie.max; let endurance = Math.max( parseInt(data.carac.taille.value) + parseInt(data.carac.constitution.value), parseInt(data.sante.vie.max) + parseInt(data.carac.volonte.value) ); diff --git a/system.json b/system.json index 2af0624b..7014f9d4 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": "0.9.1", + "version": "0.9.2", "minimumCoreVersion": "0.6.0", "compatibleCoreVersion": "0.6.2", "templateVersion": 28,