Importers ready

This commit is contained in:
2025-06-27 22:38:06 +02:00
parent 0ce629ea49
commit 4b38dc0a1d
36 changed files with 1492 additions and 376 deletions

View File

@@ -62,11 +62,9 @@ export default class FTLNomadRoll extends Roll {
static updateFullFormula(options) {
let fullFormula
if ( options.numericModifier >= 0) {
fullFormula = `${options.formula} + ${options.rollItem.value} + ${options.numericModifier}D`
} else {
fullFormula = `${options.formula} + ${options.rollItem.value} - ${Math.abs(options.numericModifier)}D`
}
fullFormula = `${options.formula} + ${options.rollItem.value} + ${options.skillModifier}D + ${options.rangeModifier}D + ${options.numericModifier}D`
// Replace all the "+ -" with "-"
fullFormula = fullFormula.replace(/\+\s*-/g, "- ")
$('#roll-dialog-full-formula').text(fullFormula)
options.fullFormula = fullFormula
}
@@ -130,14 +128,12 @@ export default class FTLNomadRoll extends Roll {
}
let modifier = "0"
options.numericModifier = rangeModifier
options.skillModifier = 0
options.numericModifier = 0
options.rangeModifier = rangeModifier
let fullFormula = `${formula} + ${options.rollItem.value}`
if (options.isEncumbered) {
options.numericModifier += -1
fullFormula += ` - ${options.numericModifier}D`
} else {
options.numericModifier += 0
fullFormula += ` + ${options.numericModifier}D`
fullFormula += ` - 1D`
}
options.fullFormula = fullFormula
options.formula = formula
@@ -184,16 +180,16 @@ export default class FTLNomadRoll extends Roll {
},
rejectClose: false, // Click on Close button will not launch an error
render: (event, dialog) => {
FTLNomadRoll.updateFullFormula(options)
$(".roll-skill-modifier").change(event => {
options.numericModifier += Number(event.target.value)
options.skillModifier = Number(event.target.value)
FTLNomadRoll.updateFullFormula(options)
})
$(".roll-skill-range-modifier").change(event => {
options.numericModifier += Number(event.target.value)
options.rangeModifier = Number(event.target.value)
FTLNomadRoll.updateFullFormula(options)
})
$(".select-combat-option").change(event => {
console.log(event)
let field = $(event.target).data("field")
let modifier = SYSTEM.ATTACK_MODIFIERS[field]
if ( event.target.checked) {