Fix damage rolls

This commit is contained in:
2025-01-08 15:39:49 +01:00
parent e6dbf48bba
commit 067d3d066b
25 changed files with 38 additions and 32 deletions

View File

@@ -328,15 +328,21 @@ export default class LethalFantasyRoll extends Roll {
let rollTotal = -1
let diceResults = []
let resultType
let diceSum = 0
let diceResult = rollBase.dice[0].results[0].result
diceResults.push({ dice: `${dice}`, value: diceResult })
let diceSum = diceResult
while (diceResult === maxValue) {
let r = await new Roll(baseFormula).evaluate()
diceResult = r.dice[0].results[0].result
diceResults.push({ dice: `${dice}-1`, value: diceResult - 1 })
diceSum += (diceResult - 1)
let singleDice = `1D${maxValue}`
for (let i = 0; i < rollBase.dice.length; i++) {
for (let j = 0; j < rollBase.dice[i].results.length; j++) {
let diceResult = rollBase.dice[i].results[j].result
diceResults.push({ dice: `${singleDice}`, value: diceResult })
diceSum += diceResult
while (diceResult === maxValue) {
let r = await new Roll(baseFormula).evaluate()
diceResult = r.dice[0].results[0].result
diceResults.push({ dice: `${singleDice}-1`, value: diceResult - 1 })
diceSum += (diceResult - 1)
}
}
}
if (fullModifier !== 0) {
diceResults.push({ dice: `${rollModifier.formula}`, value: rollModifier.total })

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
packs/lf-gifts/MANIFEST-000082 LFS Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
packs/lf-skills/MANIFEST-000086 LFS Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.