Fix damage rolls
This commit is contained in:
@@ -328,16 +328,22 @@ 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
|
||||
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: `${dice}-1`, value: diceResult - 1 })
|
||||
diceResults.push({ dice: `${singleDice}-1`, value: diceResult - 1 })
|
||||
diceSum += (diceResult - 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fullModifier !== 0) {
|
||||
diceResults.push({ dice: `${rollModifier.formula}`, value: rollModifier.total })
|
||||
if (fullModifier < 0) {
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
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.
Reference in New Issue
Block a user