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