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.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user