FIx spell order and dual rollll for spell damages
Release Creation / build (release) Successful in 1m6s

This commit is contained in:
2026-05-25 12:29:39 +02:00
parent d389a85a9f
commit e45edd60c4
30 changed files with 139 additions and 122 deletions
+3 -14
View File
@@ -375,12 +375,12 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => {
{
action: "cancel",
label: game.i18n.localize("LETHALFANTASY.Combat.proceedNo"),
callback: () => null
callback: () => "cancel"
}
],
rejectClose: false
})
if (manualDR === null) return
if (manualDR === null || manualDR === "cancel") return
const rollOpts = {
type: "spell-damage",
rollType: "spell-damage",
@@ -394,18 +394,7 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => {
actorName: actor.name,
actorImage: actor.img
}
const roll = new documents.LethalFantasyRoll(damageFormula, {}, rollOpts)
await roll.evaluate()
const diceResults = []
for (const term of roll.dice) {
for (const r of term.results) {
diceResults.push({ dice: `1D${term.faces}`, value: r.result })
}
}
roll.options.diceResults = diceResults
roll.options.rollTotal = roll.total
if (game?.dice3d) await game.dice3d.showForRoll(roll, game.user, true)
await roll.toMessage()
await documents.LethalFantasyRoll.rollSpellDamageToMessage(damageFormula, rollOpts)
return
}