From 539841c4ffe88ad595d2a9dc9c3cfd48df55bfbe Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Tue, 16 Jun 2026 19:29:07 +0200 Subject: [PATCH] fix: push explosion dice to DieTerm results so DSN displays them Explosion rolls were evaluated as separate Roll instances but never added to the original DieTerm's results array. Dice So Nice reads DieTerm.results to render 3D dice, so explosions were invisible. Now each explosion result is pushed into the DieTerm's results array ({result, active:true}), letting DSN render explosion dice in the correct chronological order alongside the main die. Applies to prompt(), promptRangedDefense(), promptRangedAttack(), and rollSpellDamageToMessage(). --- module/documents/roll.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/module/documents/roll.mjs b/module/documents/roll.mjs index f17be1e..b8ea83a 100644 --- a/module/documents/roll.mjs +++ b/module/documents/roll.mjs @@ -626,6 +626,8 @@ export default class LethalFantasyRoll extends Roll { diceResult = r.dice[0].results[0].result diceResults.push({ dice: `${singleDice.toUpperCase()}-1`, value: diceResult - 1 }) diceSum += (diceResult - 1) + // Add to DieTerm results so DSN/Foundry display shows explosion dice + rollBase.dice[i].results.push({ result: diceResult, active: true }) } } } @@ -1214,6 +1216,7 @@ export default class LethalFantasyRoll extends Roll { diceResult = r.dice[0].results[0].result diceResults.push({ dice: `${dice.toUpperCase()}-1`, value: diceResult - 1 }) diceSum += (diceResult - 1) + rollBase.dice[0].results.push({ result: diceResult, active: true }) } if (fullModifier !== 0) { diceResults.push({ dice: `${rollModifier.formula.toUpperCase()}`, value: rollModifier.total }) @@ -1376,6 +1379,7 @@ export default class LethalFantasyRoll extends Roll { diceResult = r.dice[0].results[0].result diceResults.push({ dice: `${dice.toUpperCase()}-1`, value: diceResult - 1 }) diceSum += (diceResult - 1) + rollBase.dice[0].results.push({ result: diceResult, active: true }) } if (fullModifier !== 0) { @@ -1599,6 +1603,7 @@ export default class LethalFantasyRoll extends Roll { diceResult = xr.dice?.[0]?.results?.[0]?.result ?? (term.faces - 1) diceResults.push({ dice: `${singleDice.toUpperCase()}-1`, value: diceResult - 1 }) diceSum += (diceResult - 1) + term.results.push({ result: diceResult, active: true }) } } }