From fa75828bc1dfdcafb3b4090828dff7d15c7aa478 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 14 Oct 2022 00:40:56 +0200 Subject: [PATCH 1/7] =?UTF-8?q?Fix:=20r=C3=A9gression=20lancer=20de=20sort?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A cause du duplicate, les voies n'étaient plus des RdDItem, du coup, la méthode isCompetence de la recherche de compétences ne marche pas... Et le duplicate était inutile de toutes façons. --- module/actor.js | 7 +------ module/item-competence.js | 15 +++++++++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/module/actor.js b/module/actor.js index e21d8d0c..e7de17ce 100644 --- a/module/actor.js +++ b/module/actor.js @@ -2293,12 +2293,7 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ computeDraconicAndSortIndex(sortList) { - let draconicList = this.getDraconicList() - .map(it => { - it = duplicate(it) - it.system.defaut_carac = "reve"; - return it; - }); + let draconicList = this.getDraconicList(); for (let sort of sortList) { let draconicsSort = this.getDraconicsSort(draconicList, sort).map(it => it.name); for (let index = 0; index < draconicList.length && sort.system.listIndex == undefined; index++) { diff --git a/module/item-competence.js b/module/item-competence.js index 9530f0c9..c2cdcb78 100644 --- a/module/item-competence.js +++ b/module/item-competence.js @@ -84,7 +84,10 @@ export class RdDItemCompetence extends Item { /* -------------------------------------------- */ static getVoieDraconic(competences, voie) { - return RdDItemCompetence.findCompetence(competences.filter(it => RdDItemCompetence.isDraconic(it)), voie); + return RdDItemCompetence.findFirstItem(competences, voie, { + preFilter: it => it.isCompetence() && RdDItemCompetence.isDraconic(it), + description: 'Draconic', + }); } /* -------------------------------------------- */ @@ -219,9 +222,8 @@ export class RdDItemCompetence extends Item { if (idOrName == undefined) { return undefined; } - options = mergeObject(options, { preFilter: it => it.isCompetence(), description: 'compétence', }); - return list.find(it => it.id == idOrName && it.isCompetence()) - ?? Misc.findFirstLike(idOrName, list, options); + options = mergeObject(options, { preFilter: it => it.isCompetence(), description: 'compétence' }, {overwrite: false}); + return RdDItemCompetence.findFirstItem(list, idOrName, options); } /* -------------------------------------------- */ @@ -229,6 +231,11 @@ export class RdDItemCompetence extends Item { return Misc.findAllLike(name, list, { filter: it => it.isCompetence(), description: 'compétence' }); } + static findFirstItem(list, idOrName, options) { + return list.find(it => it.id == idOrName && options.preFilter(it)) + ?? Misc.findFirstLike(idOrName, list, options); + } + /* -------------------------------------------- */ static getCompetenceNextXp(niveau) { return RdDItemCompetence.getCompetenceXp(niveau + 1); -- 2.35.3 From d1be24279158eadda4af24084d2fcc94ffd74b41 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 14 Oct 2022 00:43:37 +0200 Subject: [PATCH 2/7] Minor: optimisation de monnaies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pas d'updates pour les monnaies non affectées --- module/item-monnaie.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/module/item-monnaie.js b/module/item-monnaie.js index b1a57e66..d79c049d 100644 --- a/module/item-monnaie.js +++ b/module/item-monnaie.js @@ -71,9 +71,12 @@ export class Monnaie { let updates = []; let parValeur = Misc.classifyFirst(monnaies, it => it.system.valeur_deniers); for (let valeur of [1000, 100, 10, 1]) { - if (parValeur[valeur]) { - const piecesDeCetteValeur = Math.floor(reste / valeur); - updates.push({ _id: parValeur[valeur].id, 'system.quantite': piecesDeCetteValeur }); + const itemPiece = parValeur[valeur]; + const piecesDeCetteValeur = Math.floor(reste / valeur); + if (itemPiece) { + if (piecesDeCetteValeur != itemPiece.system.quantite) { + updates.push({ _id: parValeur[valeur].id, 'system.quantite': piecesDeCetteValeur }); + } reste -= piecesDeCetteValeur*valeur; } } -- 2.35.3 From 00b3b7f9b36e86095d3edd2ff545acd8c0db7a51 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 14 Oct 2022 00:45:53 +0200 Subject: [PATCH 3/7] Fix: Affichage ajustement encaissement Pour les encaissements hors combat, rappel de l'ajustement d'encaissement choisi --- module/rdd-roll-encaisser.js | 1 + templates/dialog-validation-encaissement.html | 3 +++ 2 files changed, 4 insertions(+) diff --git a/module/rdd-roll-encaisser.js b/module/rdd-roll-encaisser.js index 109e6fbf..b791a5f2 100644 --- a/module/rdd-roll-encaisser.js +++ b/module/rdd-roll-encaisser.js @@ -51,6 +51,7 @@ export class RdDEncaisser extends Dialog { this.actor.encaisserDommages({ dmg: { total: Number(this.modifier), + ajustement: Number(this.modifier), encaisserSpecial: this.encaisserSpecial, loc: { result: 0, label: "" }, mortalite: mortalite diff --git a/templates/dialog-validation-encaissement.html b/templates/dialog-validation-encaissement.html index a0c9a10f..380c1329 100644 --- a/templates/dialog-validation-encaissement.html +++ b/templates/dialog-validation-encaissement.html @@ -19,6 +19,9 @@
Pénétration: -{{rollData.dmg.penetration}}
{{/if}}
+ {{#if encaissement.dmg.total}} +
+dom encaissement: {{numberFormat rollData.dmg.total decimals=0 sign=true}}
+ {{/if}} {{#if rollData.dmg.dmgArme}}
+dom arme: {{numberFormat rollData.dmg.dmgArme decimals=0 sign=true}}
{{/if}} -- 2.35.3 From 21ec043e98953cce0fc3a81a1ed9a2a290c02cda Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 14 Oct 2022 00:46:42 +0200 Subject: [PATCH 4/7] Fix: alignement des queues avec le reste MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sans l'onglet Haut rêve, les queues n'étaient pas bien alignées. --- templates/actor/dragon-queues.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/actor/dragon-queues.html b/templates/actor/dragon-queues.html index 3e246c66..c04ef0ff 100644 --- a/templates/actor/dragon-queues.html +++ b/templates/actor/dragon-queues.html @@ -4,7 +4,7 @@ {{#if (and queues.length ombres.length)}} et {{/if}} {{#if ombres.length}}Ombres de Thanatos{{/if}} -
    +
      {{#each queues as |queue key|}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/dragon-queue.html" queue=queue key=key}} {{/each}} -- 2.35.3 From 168127d8fe4e757b5402746c9dad3f43e8424b41 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 14 Oct 2022 00:48:05 +0200 Subject: [PATCH 5/7] Fix: tirage dans une table ne fonctionnait plus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Régression bête, qui empêchait aussi d'afficher le résultat d'un échec contre un rêve de dragon --- module/rdd-rolltables.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/rdd-rolltables.js b/module/rdd-rolltables.js index 3f90a5bd..9ba058c5 100644 --- a/module/rdd-rolltables.js +++ b/module/rdd-rolltables.js @@ -2,14 +2,14 @@ export class RdDRollTables { /* -------------------------------------------- */ static async genericGetTableResult(tableName, toChat) { - let table = RdDRollTables.getWorldTable() ?? (await RdDRollTables.getSystemTable(tableName)); + let table = RdDRollTables.getWorldTable(tableName) ?? (await RdDRollTables.getSystemTable(tableName)); const draw = await table.draw({ displayChat: toChat, rollMode: "gmroll"}); //console.log("RdDRollTables", tableName, toChat, ":", draw); return draw.results.length > 0 ? draw.results[0] : undefined; } - static getWorldTable() { + static getWorldTable(tableName) { return game.tables.find(table => table.name.toLowerCase() == tableName.toLowerCase()); } -- 2.35.3 From e1aecb05c35709c50a0c05fde33849a934582a1f Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 14 Oct 2022 00:58:26 +0200 Subject: [PATCH 6/7] =?UTF-8?q?Fix:=20Organisation=20boutons/messages=20d'?= =?UTF-8?q?=C3=A9quipement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le message de surencombrement rendait la présentation moche --- templates/actor/inventaire.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/actor/inventaire.html b/templates/actor/inventaire.html index cd44fe0a..01896200 100644 --- a/templates/actor/inventaire.html +++ b/templates/actor/inventaire.html @@ -2,15 +2,15 @@

      Equipement

      - Encombrement: {{numberFormat calc.encTotal decimals=2}} (max: {{system.attributs.encombrement.value}}){{#if calc.surEncombrementMessage}}{{calc.surEncombrementMessage}}{{/if}} - {{#if (regle-optionnelle 'afficher-prix-joueurs')}} - ‐ Valeur: {{numberFormat calc.prixTotalEquipement decimals=2}} Sols - {{/if}} - ‐ Nouvel objet {{#if options.isGM}} Tout vider {{/if}} + {{#if calc.surEncombrementMessage}}{{calc.surEncombrementMessage}} ‐{{/if}} + Encombrement: {{numberFormat calc.encTotal decimals=2}} (max: {{system.attributs.encombrement.value}}) + {{#if (regle-optionnelle 'afficher-prix-joueurs')}} + ‐ Valeur: {{numberFormat calc.prixTotalEquipement decimals=2}} Sols + {{/if}}
      • -- 2.35.3 From 37e5b3c0aa3b28d363255a55ab775a75945a1004 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 14 Oct 2022 21:47:34 +0200 Subject: [PATCH 7/7] Version 10.0.28 --- system.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/system.json b/system.json index f9aed920..4689c221 100644 --- a/system.json +++ b/system.json @@ -1,6 +1,13 @@ { "id": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", + "version": "10.0.28", + "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.0.28.zip", + "manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json", + "compatibility": { + "minimum": "10", + "verified": "10.288" + }, "description": "Rêve de Dragon RPG for FoundryVTT", "authors": [ { @@ -34,11 +41,6 @@ ], "url": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/", "license": "LICENSE.txt", - "version": "10.0.27", - "compatibility": { - "minimum": "10", - "verified": "10.287" - }, "esmodules": [ "module/rdd-main.js" ], @@ -332,8 +334,6 @@ } ], "socket": true, - "manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json", - "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.0.27.zip", "gridDistance": 1, "gridUnits": "m", "primaryTokenAttribute": "sante.vie", -- 2.35.3