From 3ac9f487d0ec64089e4dca7d90aad2995d9cf0d6 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 22 Dec 2023 20:12:45 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Fix:=20perte=20de=20r=C3=AAve=20potions=20e?= =?UTF-8?q?nchant=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit La perte de rêve des potions enchantées bloquait le processus de récupération de château dormant --- module/actor.js | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/module/actor.js b/module/actor.js index d687af52..7f33f5a4 100644 --- a/module/actor.js +++ b/module/actor.js @@ -152,23 +152,26 @@ export class RdDActor extends RdDBaseActorSang { /* -------------------------------------------- */ async $perteRevePotionsEnchantees() { let potions = this.itemTypes[TYPES.potion] - .filter(it => it.system.categorie.toLowerCase().includes('enchant') && !potion.system.prpermanent) + .filter(it => Grammar.includesLowerCaseNoAccent(it.system.categorie, 'enchanté') && !it.system.prpermanent) - const potionUpdates = await Promise.all(potions.map(async potion => { - console.log(potion) - let nouveauReve = (potion.system.pr > 0) ? potion.system.pr - 1 : 0; - const message = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-potionenchantee-chateaudormant.html`, { - pr: nouveauReve, - alias: this.name, - potionName: potion.name, - potionImg: potion.img - }) + const potionUpdates = await Promise.all(potions.map(async it => { + const nouveauReve = Math.max(it.system.pr - 1, 0) ChatMessage.create({ whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name), - content: message - }); - return { _id: potion._id, 'system.pr': nouveauReve }; + content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-potionenchantee-chateaudormant.html`, { + pr: nouveauReve, + alias: this.name, + potionName: it.name, + potionImg: it.img + }) + }) + return { + _id: it._id, + 'system.pr': nouveauReve, + 'system.quantite': nouveauReve > 0 ? it.system.quantite : 0 + } })) + await this.updateEmbeddedDocuments('Item', potionUpdates); } -- 2.35.3 From 7f64cd03f952fde49d71b15876c6ded02a0b1468 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 22 Dec 2023 23:55:21 +0100 Subject: [PATCH 2/2] Version 11.2.12 --- changelog.md | 3 +++ system.json | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index e00adc3f..12c5d0fd 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,7 @@ # 11.2 +## 11.2.12 - Le somnifère d'Akarlikarlikar +- Fix: les potions enchantées n'empêchent plus de finir correctement Château Dormant + ## 11.2.11 - Le miroir d'Akarlikarlikar - Changement des images de compétence de créatures morsure/pinces pour être dans le thème - Suppression de la bordure autour des portraits d'acteurs, remplacés par un légèr éclaircissement du fond diff --git a/system.json b/system.json index 55979dcc..bd83e1cf 100644 --- a/system.json +++ b/system.json @@ -1,8 +1,8 @@ { "id": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", - "version": "11.2.11", - "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-11.2.11.zip", + "version": "11.2.12", + "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-11.2.12.zip", "manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v11/system.json", "changelog": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md", "compatibility": { -- 2.35.3