diff --git a/src/CharacterSheet.tsx b/src/CharacterSheet.tsx index 32197fb..64d4d3d 100644 --- a/src/CharacterSheet.tsx +++ b/src/CharacterSheet.tsx @@ -329,7 +329,12 @@ export default function CharacterSheet() { b: c.benefits, s: c.skills, })), - oc: otherClasses.map((c) => ({ n: c.name, lv: c.level, b: c.benefits, s: c.skills })), + oc: otherClasses.map((c) => ({ + n: c.name, + lv: c.level, + b: c.benefits, + s: c.skills, + })), sp: spells.map((s) => ({ n: s.name, cl: s.spellClass, @@ -612,7 +617,7 @@ export default function CharacterSheet() {
Fabula Ultima
{["main", "classes", "spells", "manage"].map((tab, i) => ( - - -
- {([ - { label: "Dexterity", base: "dexBase", cur: "dexCur" }, - { label: "Insight", base: "insBase", cur: "insCur" }, - { label: "Might", base: "migBase", cur: "migCur" }, - { label: "Willpower", base: "wlpBase", cur: "wlpCur" }, - ] as const).map(({ label, base, cur }) => ( + {( + [ + { label: "Dexterity", base: "dexBase", cur: "dexCur" }, + { label: "Insight", base: "insBase", cur: "insCur" }, + { label: "Might", base: "migBase", cur: "migCur" }, + { label: "Willpower", base: "wlpBase", cur: "wlpCur" }, + ] as const + ).map(({ label, base, cur }) => (
{label}
@@ -901,7 +908,7 @@ export default function CharacterSheet() { {inCrisis &&
CRISIS
}
-
- - {weaponPickerOpen && (() => { - const allWeapons = (weaponsFile as WeaponsFile).weapons; - const allArmorShields = (armorShieldsFile as ArmorShieldsFile).armor_shields; - type PickerItem = - | { kind: "weapon"; data: WeaponTemplate } - | { kind: "armor"; data: ArmorShieldTemplate }; - const allItems: PickerItem[] = [ - ...allWeapons.map(w => ({ kind: "weapon" as const, data: w })), - ...allArmorShields.map(a => ({ kind: "armor" as const, data: a })), - ]; - const categories = ["all", ...Array.from(new Set(allItems.map(i => i.data.category))).sort()]; - const visible = weaponCategory === "all" ? allItems : allItems.filter(i => i.data.category === weaponCategory); - const formatLine = (item: PickerItem) => { - if (item.kind === "weapon") { - const w = item.data; - return `• ${w.name}: Acc ${w.accuracy}, Dmg ${w.damage}${w.description ? ` | ${w.description}` : ""}${w.cost > 0 ? ` (${w.cost}z)` : ""}`; - } else { - const a = item.data; - const init = a.initiative ?? a.initative ?? 0; - return `• ${a.name}: DEF ${a.defense}, MDEF ${a.magic_defense}, Init ${init}${a.description ? ` | ${a.description}` : ""}${a.cost > 0 ? ` (${a.cost}z)` : ""}`; - } - }; - return ( -
setWeaponPickerOpen(false)}> -
e.stopPropagation()}> -
- Choose equipment - -
-
- {categories.map(cat => ( - - ))} +
+
+ {categories.map((cat) => ( + + ))} +
+
-
- - ); - })()} + ); + })()} @@ -1275,7 +1337,9 @@ export default function CharacterSheet() {