Various fixes and changes based on tester feedback
This commit is contained in:
@@ -68,9 +68,10 @@ export default class OathHammerRollDialog {
|
||||
const rollModes = foundry.utils.duplicate(CONFIG.Dice.rollModes)
|
||||
|
||||
// Build select option arrays
|
||||
const dvOptions = Array.from({ length: 10 }, (_, i) => {
|
||||
const v = i + 1
|
||||
return { value: v, label: String(v), selected: v === 2 }
|
||||
const dvOptions = Array.from({ length: 11 }, (_, i) => {
|
||||
const v = i // 0..10
|
||||
const label = v === 0 ? "0 (opposed)" : String(v)
|
||||
return { value: v, label, selected: v === 2 }
|
||||
})
|
||||
|
||||
const bonusOptions = Array.from({ length: 13 }, (_, i) => {
|
||||
@@ -130,7 +131,8 @@ export default class OathHammerRollDialog {
|
||||
callback: (_event, button) => {
|
||||
const out = {}
|
||||
for (const el of button.form.elements) {
|
||||
if (el.name) out[el.name] = el.value
|
||||
if (!el.name) continue
|
||||
out[el.name] = el.type === "checkbox" ? String(el.checked) : el.value
|
||||
}
|
||||
return out
|
||||
},
|
||||
@@ -143,10 +145,11 @@ export default class OathHammerRollDialog {
|
||||
const attrOverride = result.attrOverride || defaultAttrKey
|
||||
|
||||
return {
|
||||
dv: Math.max(1, parseInt(result.dv) || 2),
|
||||
dv: Math.max(0, parseInt(result.dv) ?? 2),
|
||||
bonus: parseInt(result.bonus) || 0,
|
||||
luckSpend: Math.min(Math.max(0, parseInt(result.luckSpend) || 0), availableLuck),
|
||||
supporters: Math.max(0, parseInt(result.supporters) || 0),
|
||||
explodeOn5: result.explodeOn5 === "true",
|
||||
attrOverride,
|
||||
visibility: result.visibility ?? game.settings.get("core", "rollMode"),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user