From 956fecdd82f79f083598fb60e0987f479ab318d9 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 27 Mar 2026 01:09:06 +0100 Subject: [PATCH 1/5] =?UTF-8?q?Demi-r=C3=AAve=20masqu=C3=A9,=20masquer=20l?= =?UTF-8?q?es=20rencontres?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pour éviter de trahir l'emplacement du demi-rêve... --- module/rdd-tmr-dialog.js | 6 +++--- module/tmr/draconique.js | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/module/rdd-tmr-dialog.js b/module/rdd-tmr-dialog.js index 99a22cbf..413bd33a 100644 --- a/module/rdd-tmr-dialog.js +++ b/module/rdd-tmr-dialog.js @@ -1137,12 +1137,12 @@ export class RdDTMRDialog extends Dialog { if (!token) { return } - if (this.demiReve === token && this.isDemiReveCache()) { + if (this.isDemiReveCache() && [EffetsDraconiques.rencontre.code(), EffetsDraconiques.demiReve.code()].includes(token.code)) { return } - this.pixiTMR.positionToken(token); + this.pixiTMR.positionToken(token) if (!this.allTokens.includes(token)) { - this.allTokens.push(token); + this.allTokens.push(token) } } } diff --git a/module/tmr/draconique.js b/module/tmr/draconique.js index 1a157fb3..6c0fbc08 100644 --- a/module/tmr/draconique.js +++ b/module/tmr/draconique.js @@ -90,21 +90,22 @@ export class Draconique { */ token(pixiTMR, linkData, coordTMR, type = undefined) { const tooltip = this.tooltip(linkData); - return this._createToken(pixiTMR, linkData, coordTMR, type, tooltip); + return this._createToken(pixiTMR, linkData, coordTMR, type, tooltip) } - tokens(pixiTMR, linkData, coordTMR, type = undefined) { + tokens(pixiTMR, linkData, coordTMR, code = undefined) { const tooltip = this.tooltip(linkData); - return [this._createToken(pixiTMR, linkData, coordTMR, type, tooltip)]; + return [this._createToken(pixiTMR, linkData, coordTMR, code, tooltip)] } - _createToken(pixiTMR, linkData, coordTMR, type, tooltip) { + _createToken(pixiTMR, linkData, coordTMR, code, tooltip) { const token = { sprite: this.createSprite(pixiTMR), coordTMR: coordTMR, - tooltip: tooltip + tooltip: tooltip, + code: code ?? this.code() }; - token[type ?? this.code()] = linkData; + token[code ?? this.code()] = linkData; return token; } From e6c4f7990a9cdf487c1d8560bfeb92d8cdcf0f87 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 28 Mar 2026 19:39:33 +0100 Subject: [PATCH 2/5] =?UTF-8?q?Correction:=20qualit=C3=A9=20des=20improvis?= =?UTF-8?q?ations=20de=20cuisine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 4 ++++ module/roll/roll-part-cuisine.mjs | 23 ++++++++++++++--------- module/roll/roll-type-cuisine.mjs | 5 ++--- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/changelog.md b/changelog.md index 47dfc3bb..aab900cd 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # 13.0 +## 13.0.34 - La saumuche d'Illysis + +- la qualité des "improvisations du moment" se base sur le niveau du cuisinier + ## 13.0.33 - L'ébriété d'Illysis - le stade éméché ne cause plus de perte d'endurance diff --git a/module/roll/roll-part-cuisine.mjs b/module/roll/roll-part-cuisine.mjs index f84ccb96..ebe132ed 100644 --- a/module/roll/roll-part-cuisine.mjs +++ b/module/roll/roll-part-cuisine.mjs @@ -39,18 +39,17 @@ export class RollPartCuisine extends RollPartSelect { loadRefs(rollData) { const refs = this.getRefs(rollData) const actor = rollData.active.actor - refs.cuisine = actor.getCompetence('Cuisine') + const cuisine = actor.getCompetence('Cuisine') const recettes = actor.items .filter(it => it.type == ITEM_TYPES.recettecuisine) - .map(RollPartCuisine.$extractPreparationRecette) + .map(it => RollPartCuisine.$extractPreparationRecette(cuisine, it)) const ingredientsBruts = actor.items .filter(it => it.getUtilisationCuisine() == 'brut') - .map(RollPartCuisine.$extractPreparationBrut) + .map(it => RollPartCuisine.$extractPreparationBrut(cuisine, it)) - refs.preparations = [RollPartCuisine.$preparationBasique(), ...recettes, ...ingredientsBruts] - refs.preparations.forEach(p => p.comp = refs.cuisine) + refs.preparations = [RollPartCuisine.$preparationBasique(cuisine), ...recettes, ...ingredientsBruts] if (refs.preparations.length > 0) { this.$selectPreparation(rollData) this.$restoreSavedOptions(rollData) @@ -73,7 +72,7 @@ export class RollPartCuisine extends RollPartSelect { choices(refs) { return refs.preparations } - static $preparationBasique() { + static $preparationBasique(cuisine) { return { key: '', label: "Improvisation du moment", @@ -85,10 +84,12 @@ export class RollPartCuisine extends RollPartSelect { proportionsMax: 50, value: 0, fabriquer: false, + qualite: cuisine.system.niveau, + comp: cuisine, } } - static $extractPreparationRecette(recette) { + static $extractPreparationRecette(cuisine, recette) { const proportions = recette.system.sust ?? 1 return { key: recette.id, @@ -102,10 +103,12 @@ export class RollPartCuisine extends RollPartSelect { value: -recette.system.niveau, recette: recette, fabriquer: true, + qualite: recette.system.niveau, + comp: cuisine, } } - static $extractPreparationBrut(ingredient) { + static $extractPreparationBrut(cuisine, ingredient) { return { key: ingredient.id, label: ingredient.name + ' cuisiné', @@ -118,6 +121,8 @@ export class RollPartCuisine extends RollPartSelect { value: 0, ingredient: ingredient, fabriquer: true, + qualite: cuisine.system.niveau, + comp: cuisine, } } @@ -150,7 +155,7 @@ export class RollPartCuisine extends RollPartSelect { this.$selectPreparation(rollDialog.rollData, selectOptions[index]?.value) rollDialog.render() }) - + checkboxFabriquer?.addEventListener("change", e => { current.fabriquer = e.currentTarget.checked }) diff --git a/module/roll/roll-type-cuisine.mjs b/module/roll/roll-type-cuisine.mjs index e6c60f03..6480f731 100644 --- a/module/roll/roll-type-cuisine.mjs +++ b/module/roll/roll-type-cuisine.mjs @@ -21,9 +21,7 @@ export class RollTypeCuisine extends RollType { getResult(rollData, impacts) { const current = rollData.current[PART_CUISINE] - const diff = -current.value - const cuisine = rollData.refs[PART_CUISINE].cuisine - const qualite = rollData.rolled.ptQualite + (rollData.rolled.isSuccess ? diff : Math.min(diff, cuisine.system.niveau)) + const qualite = rollData.rolled.ptQualite + current.qualite const result = { qualite: qualite, @@ -49,6 +47,7 @@ export class RollTypeCuisine extends RollType { } return result } + onApplyImpacts(roll, impacts) { if (roll.result.plat) { // le plat n'est pas créé immédiatement, il faut donc retrouver l'id From 9934fe91913e54658315bf71046137c1688c57a3 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 28 Mar 2026 20:15:05 +0100 Subject: [PATCH 3/5] Le pluriel de jeu est jeux --- module/item.js | 12 ++++++++++++ module/rdd-utility.js | 4 ++-- templates/actor-sheet.hbs | 2 +- templates/actor/{jeus.hbs => jeux.hbs} | 0 4 files changed, 15 insertions(+), 3 deletions(-) rename templates/actor/{jeus.hbs => jeux.hbs} (100%) diff --git a/module/item.js b/module/item.js index 4a3ac55c..238f455a 100644 --- a/module/item.js +++ b/module/item.js @@ -85,6 +85,10 @@ export const defaultItemImg = { munition: "systems/foundryvtt-reve-de-dragon/icons/objets/fleche.webp" } +const ITEM_TYPES_PLURIEL = { + [ITEM_TYPES.jeu]: 'jeux' +} + /* -------------------------------------------- */ export class RdDItem extends Item { @@ -112,6 +116,14 @@ export class RdDItem extends Item { return true; } + + static itemTypePluriel(type) { + if (ITEM_TYPES[type]) { + return ITEM_TYPES_PLURIEL[type] ?? (type + 's') + } + console.error(`Item type ${type} is undefined`) + return type + } static async getCorrespondingItem(itemRef) { if (itemRef.pack) { return await SystemCompendiums.loadDocument(itemRef) diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 265f73e8..66f36836 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -147,7 +147,7 @@ export class RdDUtility { 'systems/foundryvtt-reve-de-dragon/templates/actor/taches.hbs', 'systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.hbs', 'systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.hbs', - 'systems/foundryvtt-reve-de-dragon/templates/actor/jeus.hbs', + 'systems/foundryvtt-reve-de-dragon/templates/actor/jeux.hbs', 'systems/foundryvtt-reve-de-dragon/templates/actor/alchimie.hbs', 'systems/foundryvtt-reve-de-dragon/templates/actor/astrologie.hbs', 'systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.hbs', @@ -483,7 +483,7 @@ export class RdDUtility { static filterItemsPerTypeForSheet(formData, itemTypes) { Object.values(ITEM_TYPES).forEach(t => { - formData[t + 's'] = Misc.arrayOrEmpty(itemTypes[t]) + formData[RdDItem.itemTypePluriel(t)] = Misc.arrayOrEmpty(itemTypes[t]) itemTypes[t].forEach(item => item.actions = item.itemActions()) }) diff --git a/templates/actor-sheet.hbs b/templates/actor-sheet.hbs index e1c471c6..967c23c2 100644 --- a/templates/actor-sheet.hbs +++ b/templates/actor-sheet.hbs @@ -122,7 +122,7 @@ {{> "systems/foundryvtt-reve-de-dragon/templates/actor/taches.hbs"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.hbs"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.hbs"}} - {{> "systems/foundryvtt-reve-de-dragon/templates/actor/jeus.hbs"}} + {{> "systems/foundryvtt-reve-de-dragon/templates/actor/jeux.hbs"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/alchimie.hbs"}} {{/if}} diff --git a/templates/actor/jeus.hbs b/templates/actor/jeux.hbs similarity index 100% rename from templates/actor/jeus.hbs rename to templates/actor/jeux.hbs From eebca509bdfc302e2db1bf220fa9a1a47bbd430f Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 3 Apr 2026 22:12:43 +0200 Subject: [PATCH 4/5] Fix: affichage appel moral sur sorts --- changelog.md | 1 + module/roll/roll-dialog.mjs | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/changelog.md b/changelog.md index aab900cd..4c6a03e5 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,7 @@ ## 13.0.34 - La saumuche d'Illysis - la qualité des "improvisations du moment" se base sur le niveau du cuisinier +- l'appel au moral n'est pas affiché à l'ouverture d'une fenêtre de jets de sorts (ou de tâche intellectuelle) ## 13.0.33 - L'ébriété d'Illysis diff --git a/module/roll/roll-dialog.mjs b/module/roll/roll-dialog.mjs index 1d7131a4..1253c545 100644 --- a/module/roll/roll-dialog.mjs +++ b/module/roll/roll-dialog.mjs @@ -479,16 +479,13 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2 RollBasicParts.loadSurprises(rollData, this.getSelectedType().code) rollData.type.label = this.getSelectedType()?.title(rollData) - const visibleRollParts = this.getActiveParts() - visibleRollParts.forEach(p => p.applyExternalImpacts(visibleRollParts, rollData)) - - this.setSpecialComp(visibleRollParts); - - visibleRollParts.forEach(p => p.prepareContext(rollData)) + this.getActiveParts().forEach(p => p.applyExternalImpacts(this.getActiveParts(), rollData)) + this.setSpecialComp(this.getActiveParts()); + this.getActiveParts().forEach(p => p.prepareContext(rollData)) RollDialog.calculAjustement(rollData) - const templates = visibleRollParts.map(p => p.toTemplateData()) + const templates = this.getActiveParts().map(p => p.toTemplateData()) const context = await super._prepareContext() return foundry.utils.mergeObject( { From 6062d0428c2441ab5cdde645d51d40a0d5b4b909 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 3 Apr 2026 22:14:09 +0200 Subject: [PATCH 5/5] =?UTF-8?q?Fix:=20difficult=C3=A9=20d'annulation=20de?= =?UTF-8?q?=20magie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + module/roll/roll-part-sort.mjs | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 4c6a03e5..bd466999 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ - la qualité des "improvisations du moment" se base sur le niveau du cuisinier - l'appel au moral n'est pas affiché à l'ouverture d'une fenêtre de jets de sorts (ou de tâche intellectuelle) +- la difficulté variable de l'annulation de magie est bien prise en compte ## 13.0.33 - L'ébriété d'Illysis diff --git a/module/roll/roll-part-sort.mjs b/module/roll/roll-part-sort.mjs index b01e7764..824c9dc2 100644 --- a/module/roll/roll-part-sort.mjs +++ b/module/roll/roll-part-sort.mjs @@ -28,7 +28,8 @@ export class RollPartSort extends RollPartSelect { this.setCurrent(rollData, { key: saved.key, isReserve: saved.isReserve, - ptreve: saved.ptreve + ptreve: saved.ptreve, + value: saved.value, }) } @@ -37,7 +38,8 @@ export class RollPartSort extends RollPartSelect { this.setSaved(targetData, { key: current.key, isReserve: current.isReserve, - ptreve: current.ptreve + ptreve: current.ptreve, + value: current.value, }) } @@ -98,7 +100,7 @@ export class RollPartSort extends RollPartSelect { const sort = { label: current.label, value: current.value } const reserve = current.isReserve ? [{ label: `Mise en réserve en ${this.getCoord(rollData)}` }] : [] const bonusCase = current.bonusCase ? [{ label: `Bonus case +${current.bonusCase}%` }] : [] - const reve = { label: `Rêve ${current.ptreve}` } + const reve = { label: `Dépense de rêve ${current.ptreve}` } return [sort, ...bonusCase, reve, ...reserve] } return [] @@ -106,9 +108,12 @@ export class RollPartSort extends RollPartSelect { $selectSort(rollData, values) { const current = this.selectByKey(rollData, values.key) - if (values.ptreve) { + if (values.ptreve != undefined) { current.ptreve = values.ptreve } + if (current.isDiffVariable && values.value != undefined) { + current.value = values.value + } if (values.isReserve != undefined) { current.isReserve = values.isReserve }