From fa5c4cc9ce90f476087fb7ab4026be04b3653eec Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Mon, 22 Jun 2026 22:33:00 +0200 Subject: [PATCH] debug: log favor/disfavor dice totals and results for RNG investigation 9/12 identical d20 results under disfavor suggests RNG issue. Add structured logging of both roll totals, per-die results, and baseFormula. Enable debug mode in system settings to see output in browser console. --- module/documents/roll.mjs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/module/documents/roll.mjs b/module/documents/roll.mjs index 6ec817a..a81cc89 100644 --- a/module/documents/roll.mjs +++ b/module/documents/roll.mjs @@ -555,7 +555,13 @@ export default class LethalFantasyRoll extends Roll { if (rollContext.favor === "favor") { rollFavor = new this(baseFormula, options.data, rollData) await rollFavor.evaluate() - log("Rolling with favor", rollFavor) + log("Favor dice", { + rollBaseTotal: rollBase.total, + rollFavorTotal: rollFavor.total, + rollBaseResults: rollBase.dice.map(d => d.results.map(r => r.result)), + rollFavorResults: rollFavor.dice.map(d => d.results.map(r => r.result)), + baseFormula + }) if (game?.dice3d) { game.dice3d.showForRoll(rollFavor, game.user, true) } @@ -571,6 +577,13 @@ export default class LethalFantasyRoll extends Roll { if (rollContext.favor === "disfavor") { rollFavor = new this(baseFormula, options.data, rollData) await rollFavor.evaluate() + log("Disfavor dice", { + rollBaseTotal: rollBase.total, + rollFavorTotal: rollFavor.total, + rollBaseResults: rollBase.dice.map(d => d.results.map(r => r.result)), + rollFavorResults: rollFavor.dice.map(d => d.results.map(r => r.result)), + baseFormula + }) if (game?.dice3d) { game.dice3d.showForRoll(rollFavor, game.user, true) }