Fix damage rolls
This commit is contained in:
@@ -328,15 +328,21 @@ 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++) {
|
||||||
while (diceResult === maxValue) {
|
let diceResult = rollBase.dice[i].results[j].result
|
||||||
let r = await new Roll(baseFormula).evaluate()
|
diceResults.push({ dice: `${singleDice}`, value: diceResult })
|
||||||
diceResult = r.dice[0].results[0].result
|
diceSum += diceResult
|
||||||
diceResults.push({ dice: `${dice}-1`, value: diceResult - 1 })
|
while (diceResult === maxValue) {
|
||||||
diceSum += (diceResult - 1)
|
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) {
|
if (fullModifier !== 0) {
|
||||||
diceResults.push({ dice: `${rollModifier.formula}`, value: rollModifier.total })
|
diceResults.push({ dice: `${rollModifier.formula}`, value: rollModifier.total })
|
||||||
|
|||||||
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