Fixes for damages + vehicle/ship ehancements
All checks were successful
Release Creation / build (release) Successful in 1m21s
All checks were successful
Release Creation / build (release) Successful in 1m21s
This commit is contained in:
@@ -62,10 +62,14 @@ export default class FTLNomadRoll extends Roll {
|
||||
|
||||
static updateFullFormula(options) {
|
||||
let fullFormula
|
||||
let mod = options.rollItem?.value || 0
|
||||
fullFormula = `${options.formula} + ${options.skillModifier}D + ${mod} + ${options.rangeModifier}D + ${options.numericModifier}D`
|
||||
if (options.rollType === "damage") {
|
||||
fullFormula = `${options.formula} + ${options.skillModifier}D6 `
|
||||
} else {
|
||||
let mod = options.rollItem?.value || 0
|
||||
fullFormula = `${options.formula} + ${options.skillModifier}D + ${mod} + ${options.rangeModifier}D + ${options.numericModifier}D`
|
||||
}
|
||||
// Replace all the "+ -" with "-"
|
||||
fullFormula = fullFormula.replace(/\+\s*-/g, "- ")
|
||||
fullFormula = fullFormula.replace(/\+\s*\-/g, "- ")
|
||||
$('#roll-dialog-full-formula').text(fullFormula)
|
||||
options.fullFormula = fullFormula
|
||||
}
|
||||
@@ -229,17 +233,18 @@ export default class FTLNomadRoll extends Roll {
|
||||
// Replace the D6 by the correct number of D6
|
||||
damageFormula = damageFormula.replace(/(\d*)d6/gi, (match, p1) => {
|
||||
let numDice = Number(p1) || 1
|
||||
numDice += Math.abs(options.skillModifier)
|
||||
return `${numDice}d6`
|
||||
numDice += Number(options.skillModifier)
|
||||
//numDice += options?.finalModifier || 0
|
||||
return `${numDice}d6 + ${mod}`
|
||||
})
|
||||
diceFormula = damageFormula
|
||||
} else {
|
||||
diceFormula = `${2 + Math.abs(options.finalModifier)}D6`
|
||||
}
|
||||
if (options.finalModifier > 0) {
|
||||
diceFormula += `kh2 + ${mod}`
|
||||
} else {
|
||||
diceFormula += `kl2 + ${mod}`
|
||||
if (options.finalModifier > 0) {
|
||||
diceFormula += `kh2 + ${mod}`
|
||||
} else {
|
||||
diceFormula += `kl2 + ${mod}`
|
||||
}
|
||||
}
|
||||
|
||||
console.log("FTLNomadRoll | Rolling ", diceFormula, options, rollData)
|
||||
|
||||
Reference in New Issue
Block a user