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

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.