Connect battle rewards to campaign equipment

This commit is contained in:
2026-07-03 23:39:27 +09:00
parent 0c4e358284
commit 42a596bd8b
4 changed files with 419 additions and 56 deletions

View File

@@ -239,10 +239,28 @@ export const itemCatalog: Record<string, ItemDefinition> = {
}
};
export const itemCatalogEntries = Object.values(itemCatalog);
export function getItem(itemId: string) {
return itemCatalog[itemId] ?? itemCatalog['training-sword'];
}
export function findItemByName(name: string) {
return itemCatalogEntries.find((item) => item.name === name);
}
export function itemInventoryLabel(itemId: string) {
return getItem(itemId).name;
}
export function equipmentItemIdForInventoryLabel(label: string) {
return findItemByName(label)?.id;
}
export function isEquipmentInventoryLabel(label: string) {
return Boolean(findItemByName(label));
}
export function equipmentExpToNext(level: number) {
return 50 + Math.min(level, 9) * 20;
}