diff --git a/src/lib/utils/element.ts b/src/lib/utils/element.ts new file mode 100644 index 00000000..f077089b --- /dev/null +++ b/src/lib/utils/element.ts @@ -0,0 +1,27 @@ +export const ELEMENT_LABELS: Record = { + 1: 'Wind', + 2: 'Fire', + 3: 'Water', + 4: 'Earth', + 5: 'Dark', + 6: 'Light' +} + +export function getElementLabel(element?: number): string { + if (element === undefined || element === null) return '—' + return ELEMENT_LABELS[element] || '—' +} + +export function getElementClass(element?: number): string { + if (element === undefined || element === null) return '' + const label = ELEMENT_LABELS[element] + return label ? `element-${label.toLowerCase()}` : '' +} + +export function getElementIcon(element?: number): string { + const label = getElementLabel(element) + if (label === '—') return '' + // Capitalize first letter for filename + const capitalizedLabel = label.charAt(0).toUpperCase() + label.slice(1) + return `/images/labels/element/Label_Element_${capitalizedLabel}.png` +} \ No newline at end of file diff --git a/src/lib/utils/proficiency.ts b/src/lib/utils/proficiency.ts new file mode 100644 index 00000000..a080c518 --- /dev/null +++ b/src/lib/utils/proficiency.ts @@ -0,0 +1,24 @@ +export const PROFICIENCY_LABELS: Record = { + 1: 'Sabre', + 2: 'Dagger', + 3: 'Axe', + 4: 'Spear', + 5: 'Bow', + 6: 'Staff', + 7: 'Melee', + 8: 'Harp', + 9: 'Gun', + 10: 'Katana' +} + +export function getProficiencyLabel(proficiency: number): string { + return PROFICIENCY_LABELS[proficiency] || '—' +} + +export function getProficiencyIcon(proficiency: number): string { + const label = PROFICIENCY_LABELS[proficiency] + if (!label) return '' + // Capitalize first letter for filename + const capitalizedLabel = label.charAt(0).toUpperCase() + label.slice(1) + return `/images/labels/proficiency/Label_Weapon_${capitalizedLabel}.png` +} \ No newline at end of file diff --git a/src/lib/utils/rarity.ts b/src/lib/utils/rarity.ts new file mode 100644 index 00000000..b2f2acf4 --- /dev/null +++ b/src/lib/utils/rarity.ts @@ -0,0 +1,22 @@ +export const RARITY_LABELS: Record = { + 1: 'R', + 2: 'SR', + 3: 'SSR' +} + +export function getRarityLabel(rarity: number): string { + return RARITY_LABELS[rarity] || '—' +} + +export function getRarityClass(rarity: number): string { + switch (rarity) { + case 1: + return 'rarity-r' + case 2: + return 'rarity-sr' + case 3: + return 'rarity-ssr' + default: + return '' + } +} \ No newline at end of file