Fix damage rolls

This commit is contained in:
LeRatierBretonnien 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 })

BIN
packs/lf-equipment/CURRENT (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-equipment/LOG (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-equipment/LOG.old (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-equipment/MANIFEST-000082 (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-equipment/MANIFEST-000086 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
packs/lf-gifts/CURRENT (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-gifts/LOG (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-gifts/LOG.old (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-gifts/MANIFEST-000078 (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-gifts/MANIFEST-000082 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
packs/lf-skills/CURRENT (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-skills/LOG (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-skills/LOG.old (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-skills/MANIFEST-000082 (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-skills/MANIFEST-000086 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
packs/lf-vulnerabilities/CURRENT (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-vulnerabilities/LOG (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-vulnerabilities/LOG.old (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-vulnerabilities/MANIFEST-000078 (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-vulnerabilities/MANIFEST-000082 (Stored with Git LFS) Normal file

Binary file not shown.