Add initiative rolls

This commit is contained in:
2026-03-18 16:51:10 +01:00
parent 000bf348a6
commit b2befe039e
30 changed files with 512 additions and 144 deletions

View File

@@ -91,9 +91,14 @@ export default class OathHammerSpellDialog {
rejectClose: false,
buttons: [{
label: game.i18n.localize("OATHHAMMER.Dialog.CastSpell"),
callback: (_ev, btn) => Object.fromEntries(
[...btn.form.elements].filter(e => e.name).map(e => [e.name, e.value])
),
callback: (_ev, btn) => {
const out = {}
for (const el of btn.form.elements) {
if (!el.name) continue
out[el.name] = el.type === "checkbox" ? String(el.checked) : el.value
}
return out
},
}],
})
@@ -113,6 +118,7 @@ export default class OathHammerSpellDialog {
bonus: parseInt(result.bonus) || 0,
grimPenalty: parseInt(result.noGrimoire) || 0,
visibility: result.visibility ?? game.settings.get("core", "rollMode"),
explodeOn5: result.explodeOn5 === "true",
}
}
}