Fix weapon sheet

This commit is contained in:
2026-03-08 14:48:49 +01:00
parent 317c4990bc
commit 31318317a7
14 changed files with 135 additions and 61 deletions

View File

@@ -54,6 +54,20 @@ export default class OathHammerItemSheet extends HandlebarsApplicationMixin(foun
if (this.document.system.description !== undefined) {
context.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.description ?? "", { async: true })
}
// Armor-specific numeric selects
context.armorValueChoices = Object.fromEntries(
Array.from({ length: 13 }, (_, i) => [i, String(i)])
)
context.penaltyChoices = Object.fromEntries(
Array.from({ length: 6 }, (_, i) => [-i, String(-i)])
)
// Weapon-specific numeric selects
context.damageModChoices = Object.fromEntries(
Array.from({ length: 10 }, (_, i) => [i - 4, i - 4 >= 0 ? `+${i - 4}` : String(i - 4)])
)
context.apChoices = Object.fromEntries(
Array.from({ length: 7 }, (_, i) => [i, String(i)])
)
return context
}