diff --git a/src/composables/useFilters.ts b/src/composables/useFilters.ts index 9021230..2c1cf69 100644 --- a/src/composables/useFilters.ts +++ b/src/composables/useFilters.ts @@ -16,7 +16,7 @@ function loadRrr(): number { const filters = ref({ city: loadCity(), - tiers: new Set([4, 5, 6, 7, 8]), + tiers: new Set([2, 3, 4, 5, 6, 7, 8]), selectedItemTypes: null, rrr: loadRrr(), nameFilter: '', diff --git a/src/data/constants.ts b/src/data/constants.ts index 26de46f..ae4ff7b 100644 --- a/src/data/constants.ts +++ b/src/data/constants.ts @@ -19,6 +19,6 @@ export const QUALITIES: { label: string; value: AlbionQuality }[] = [ { label: 'Masterpiece', value: 5 }, ] -export const TIERS: Tier[] = [4, 5, 6, 7, 8] +export const TIERS: Tier[] = [2, 3, 4, 5, 6, 7, 8] export const ENCHANTMENTS: Enchantment[] = [0, 1, 2, 3, 4] export const CATEGORIES: ItemCategory[] = ['Weapons', 'Armor', 'Gathering'] diff --git a/src/data/recipes.ts b/src/data/recipes.ts index 835d0ef..1bec2c6 100644 --- a/src/data/recipes.ts +++ b/src/data/recipes.ts @@ -19,7 +19,40 @@ interface RecipeTemplate { ingredients: IngredientTemplate[] } -const ALL_TIERS: Tier[] = [4, 5, 6, 7, 8] +const ALL_TIERS: Tier[] = [2, 3, 4, 5, 6, 7, 8] + +// Returns the lowest tier at which a given outputId template exists in-game +function minTierFor(outputId: string): Tier { + // Artifacts/special variants: T4+ + if (/_(?:UNDEAD|HELL|MORGANA|KEEPER|FEY|ROYAL|AVALON|CRYSTAL)$|SHAPESHIFTER/.test(outputId)) return 4 + + // SET2/SET3 armor: T4+ + if (/_SET[23]$/.test(outputId)) return 4 + + // Gathering tools: fishing rod starts at T3, rest at T2 + if (outputId.includes('_2H_TOOL_')) return outputId.endsWith('_FISHINGROD') ? 3 : 2 + + // Off-hands: torch at T3, shield and book at T2 + if (outputId.endsWith('_OFF_TORCH')) return 3 + if (/_OFF_(SHIELD|BOOK)$/.test(outputId)) return 2 + + // 2H weapons: bow at T2, crossbow/quarterstaff/knuckles_set1 at T3, rest at T4 + if (outputId.includes('_2H_')) { + if (outputId.endsWith('_2H_BOW')) return 2 + if (/_2H_(CROSSBOW|QUARTERSTAFF|KNUCKLES_SET1)$/.test(outputId)) return 3 + return 4 + } + + // 1H weapons: sword and fire staff at T2, light crossbow at T4, rest at T3 + if (outputId.includes('_MAIN_')) { + if (/_MAIN_(SWORD|FIRESTAFF)$/.test(outputId)) return 2 + if (outputId.endsWith('_MAIN_1HCROSSBOW')) return 4 + return 3 + } + + // SET1 armor (HEAD_, ARMOR_, SHOES_): T2+ + return 2 +} // ─── Journal type inference ──────────────────────────────────────────────────── @@ -53,9 +86,12 @@ for (const entry of rawRecipes) { if (!('outputId' in entry)) continue // skip comment-only entries const template = entry as unknown as RecipeTemplate - const enchants: Enchantment[] = template.enchanted === false ? [0] : ENCHANTMENTS + const minTier = minTierFor(template.outputId) for (const tier of ALL_TIERS) { + if (tier < minTier) continue + + const enchants: Enchantment[] = (template.enchanted === false || tier < 4) ? [0] : ENCHANTMENTS for (const enc of enchants) { const baseOutputId = applyTier(template.outputId, tier) const outputItemId = enc === 0 ? baseOutputId : `${baseOutputId}@${enc}` diff --git a/src/pages/PricesPage.vue b/src/pages/PricesPage.vue index 3552ece..1adc349 100644 --- a/src/pages/PricesPage.vue +++ b/src/pages/PricesPage.vue @@ -51,10 +51,10 @@ {{ activeMaterialDef.name }} - -
+ +
@@ -92,10 +92,10 @@ interface MaterialDef { } const MATERIALS: MaterialDef[] = [ - { name: 'Metal Bar', tiers: [4, 5, 6, 7, 8], baseId: t => `T${t}_METALBAR` }, - { name: 'Planks', tiers: [4, 5, 6, 7, 8], baseId: t => `T${t}_PLANKS` }, - { name: 'Leather', tiers: [4, 5, 6, 7, 8], baseId: t => `T${t}_LEATHER` }, - { name: 'Cloth', tiers: [4, 5, 6, 7, 8], baseId: t => `T${t}_CLOTH` }, + { name: 'Metal Bar', tiers: [2, 3, 4, 5, 6, 7, 8], baseId: t => `T${t}_METALBAR` }, + { name: 'Planks', tiers: [2, 3, 4, 5, 6, 7, 8], baseId: t => `T${t}_PLANKS` }, + { name: 'Leather', tiers: [2, 3, 4, 5, 6, 7, 8], baseId: t => `T${t}_LEATHER` }, + { name: 'Cloth', tiers: [2, 3, 4, 5, 6, 7, 8], baseId: t => `T${t}_CLOTH` }, ] const activeMaterial = ref(localStorage.getItem('albion-prices-material') ?? 'Metal Bar') diff --git a/src/types/crafting.ts b/src/types/crafting.ts index 71b1e8b..99d0a18 100644 --- a/src/types/crafting.ts +++ b/src/types/crafting.ts @@ -1,4 +1,4 @@ -export type Tier = 4 | 5 | 6 | 7 | 8 +export type Tier = 2 | 3 | 4 | 5 | 6 | 7 | 8 export type Enchantment = 0 | 1 | 2 | 3 | 4 export type ItemCategory = 'Weapons' | 'Armor' | 'Gathering' diff --git a/src/utils/formatting.ts b/src/utils/formatting.ts index f5c06af..2eb688c 100644 --- a/src/utils/formatting.ts +++ b/src/utils/formatting.ts @@ -231,6 +231,8 @@ export function tierEnchantStyle(tier: number, enchantment: number): object { export function tierStyle(tier: number): { backgroundColor: string; color: string } { const map: Record = { + 2: ['#635349', '#ffffff'], + 3: ['#495E39', '#ffffff'], 4: ['#355f78', '#ffffff'], 5: ['#77221a', '#ffffff'], 6: ['#c9712c', '#ffffff'], diff --git a/tsconfig.json b/tsconfig.json index 1ffef60..ea9d0cd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,11 @@ { "files": [], "references": [ - { "path": "./tsconfig.app.json" }, - { "path": "./tsconfig.node.json" } + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.node.json" + } ] }