From 5d942e7c4cfa40fea79a52e78cd0d45587aeaf5b Mon Sep 17 00:00:00 2001 From: Alexander Drozdov Date: Tue, 8 Feb 2022 14:07:15 +0200 Subject: [PATCH] remove Watchstones, generalize Invitations --- src/parser/meta.ts | 3 +-- src/parser/stat-translations.ts | 4 ++-- src/web/background/Prices.ts | 1 - src/web/item-check/WidgetItemCheck.vue | 2 +- src/web/price-check/CheckedItem.vue | 2 +- src/web/price-check/filters/create-item-filters.ts | 2 +- src/web/price-check/filters/create-stat-filters.ts | 2 +- src/web/price-check/trade/common.ts | 2 +- src/web/price-check/trends/getDetailsId.ts | 5 ----- 9 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/parser/meta.ts b/src/parser/meta.ts index 83b623e6..839ca7b2 100644 --- a/src/parser/meta.ts +++ b/src/parser/meta.ts @@ -30,7 +30,6 @@ export enum ItemCategory { OneHandedSword = 'One-Handed Sword', TwoHandedSword = 'Two-Handed Sword', ClusterJewel = 'Cluster Jewel', - Watchstone = 'Watchstone', HeistBlueprint = 'Heist Blueprint', HeistContract = 'Heist Contract', HeistTool = 'Heist Tool', @@ -38,7 +37,7 @@ export enum ItemCategory { HeistGear = 'Heist Gear', HeistCloak = 'Heist Cloak', Trinket = 'Trinket', - MavenInvitation = 'Maven\'s Invitation', + Invitation = 'Invitation', Gem = 'Gem', Currency = 'Currency', DivinationCard = 'Divination Card' diff --git a/src/parser/stat-translations.ts b/src/parser/stat-translations.ts index dc7657f5..4e44fa1b 100644 --- a/src/parser/stat-translations.ts +++ b/src/parser/stat-translations.ts @@ -82,7 +82,7 @@ function * _statPlaceholderGenerator (stat: string) { const withPlaceholders = stat .replace(/(?(?.[^)-]*)(?:-(?[^)]+))?\))?/gm, (_, roll: string, min?: string, max?: string) => { if (min != null && max == null) { - // example: Watchstone "# uses remaining" + // example: Sextant "# uses remaining" max = min } @@ -139,7 +139,7 @@ export function tryParseTranslation (stat: StatString, modType: ModifierType): P } } - if (found.stat.ref === '# uses remaining') { + if (found.stat.ref === '# uses remaining' || found.stat.ref === '# use remaining') { const uses = combination.values[0] uses.bounds = { min: 1, diff --git a/src/web/background/Prices.ts b/src/web/background/Prices.ts index e3fe6899..96641443 100644 --- a/src/web/background/Prices.ts +++ b/src/web/background/Prices.ts @@ -77,7 +77,6 @@ const priceQueue = (() => { return [ { overview: 'currency', type: 'Currency', loaded: 0 }, { overview: 'currency', type: 'Fragment', loaded: 0 }, - { overview: 'item', type: 'Watchstone', loaded: 0, key: (item: NinjaItemInfo) => `ITEM::${item.name} // ${item.variant}` }, { overview: 'item', type: 'Oil', loaded: 0 }, { overview: 'item', type: 'Incubator', loaded: 0 }, { overview: 'item', type: 'Scarab', loaded: 0 }, diff --git a/src/web/item-check/WidgetItemCheck.vue b/src/web/item-check/WidgetItemCheck.vue index 99373ff0..ad3b0854 100644 --- a/src/web/item-check/WidgetItemCheck.vue +++ b/src/web/item-check/WidgetItemCheck.vue @@ -73,7 +73,7 @@ export default defineComponent({ category === ItemCategory.Map || category === ItemCategory.HeistContract || category === ItemCategory.HeistBlueprint || - category === ItemCategory.MavenInvitation) + category === ItemCategory.Invitation) }) return { diff --git a/src/web/price-check/CheckedItem.vue b/src/web/price-check/CheckedItem.vue index 7a870cf3..478fdb11 100644 --- a/src/web/price-check/CheckedItem.vue +++ b/src/web/price-check/CheckedItem.vue @@ -170,7 +170,7 @@ export default defineComponent({ props.item.category !== ItemCategory.CapturedBeast && props.item.category !== ItemCategory.HeistContract && props.item.category !== ItemCategory.HeistBlueprint && - props.item.category !== ItemCategory.MavenInvitation && + props.item.category !== ItemCategory.Invitation && !props.item.isUnidentified }) diff --git a/src/web/price-check/filters/create-item-filters.ts b/src/web/price-check/filters/create-item-filters.ts index d93f9eeb..ae70b57f 100644 --- a/src/web/price-check/filters/create-item-filters.ts +++ b/src/web/price-check/filters/create-item-filters.ts @@ -44,7 +44,7 @@ export function createFilters ( disabled: !(item.stackSize && item.stackSize.value > 1 && opts.activateStockFilter) } } - if (item.category === ItemCategory.MavenInvitation) { + if (item.category === ItemCategory.Invitation) { filters.searchExact = { baseType: item.info.name } diff --git a/src/web/price-check/filters/create-stat-filters.ts b/src/web/price-check/filters/create-stat-filters.ts index da717007..a1ee9b2d 100644 --- a/src/web/price-check/filters/create-stat-filters.ts +++ b/src/web/price-check/filters/create-stat-filters.ts @@ -22,7 +22,7 @@ export function initUiModFilters ( ): StatFilter[] { if ( (item.rarity === ItemRarity.Unique && item.category === ItemCategory.Map) || - item.category === ItemCategory.MavenInvitation || + item.category === ItemCategory.Invitation || item.category === ItemCategory.HeistContract || item.category === ItemCategory.HeistBlueprint ) { diff --git a/src/web/price-check/trade/common.ts b/src/web/price-check/trade/common.ts index bbf919a0..8befc811 100644 --- a/src/web/price-check/trade/common.ts +++ b/src/web/price-check/trade/common.ts @@ -34,7 +34,7 @@ export function apiToSatisfySearch (item: ParsedItem, stats: StatFilter[], filte if (filters.stackSize) { if ( item.category === ItemCategory.DivinationCard || - item.category === ItemCategory.MavenInvitation || + item.category === ItemCategory.Invitation || item.category === ItemCategory.Map ) { return filters.stackSize.disabled ? 'trade' : 'bulk' diff --git a/src/web/price-check/trends/getDetailsId.ts b/src/web/price-check/trends/getDetailsId.ts index 2f9a61c8..412ede57 100644 --- a/src/web/price-check/trends/getDetailsId.ts +++ b/src/web/price-check/trends/getDetailsId.ts @@ -95,11 +95,6 @@ function forUniqueItem (item: ParsedItem) { if (item.sockets?.linked) { id += ` // ${item.sockets.linked}L` } - if (item.info.unique.base === 'Ivory Watchstone') { - const uses = item.statsByType.find(m => m.type === 'explicit' && m.stat.ref === '# uses remaining')! - const roll = uses.sources[0].contributes!.value - id += ` // ${roll}` - } return id }