From 206abb3947a679104514f530f68fa2fa22f867b4 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Fri, 10 Jul 2026 21:01:06 +0200 Subject: [PATCH] fix: message d'initiative sans '1d6', affiche le nom de la carte MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - La formule du roll est remplacée par le nom de la carte de tarot - Plus d'affichage de '1d6' trompeur dans le chat - Valeur de la carte utilisée comme score d'initiative --- fvtt-hamalron.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fvtt-hamalron.mjs b/fvtt-hamalron.mjs index f8ec0cf..4cb9cda 100644 --- a/fvtt-hamalron.mjs +++ b/fvtt-hamalron.mjs @@ -43,7 +43,7 @@ Hooks.once("init", function () { // Override initiative: draw a card from the tarot deck instead of rolling dice Combatant.prototype.getInitiativeRoll = function (formula) { const data = this.actor?.getRollData() ?? {} - const roll = new Roll(CONFIG.Combat.initiative.formula || "1d6", data) + const roll = new Roll("1d6", data) const origEvaluate = roll.evaluate.bind(roll) roll.evaluate = async function (options = {}) { const deckManager = globalThis.HamalronTarotDeckManager?._instance @@ -51,10 +51,10 @@ Hooks.once("init", function () { const drawn = deckManager.drawCards(1) if (drawn.length > 0) { const card = drawn[0] - this._total = SYSTEM.TAROT_VALEURS[card.valeur]?.value ?? 0 + const val = SYSTEM.TAROT_VALEURS[card.valeur]?.value ?? 0 + this._total = val this._evaluated = true - this._dice = [] - this._terms = [{ results: [{ result: this._total }] }] + this._formula = `${card.name} (${val})` deckManager.addToDiscard(card) await deckManager.saveDeckState() return this