Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Relic Item Support #205

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class EvaluateQueryItemProvider {
unidentified: item.unidentified,
veiled: item.veiled,
blighted: item.blighted,
relic: item.relic,
influences: item.influences || {},
damage: {},
stats: [],
Expand Down Expand Up @@ -107,7 +108,7 @@ export class EvaluateQueryItemProvider {
}

if (item.stats) {
if (item.rarity === ItemRarity.Unique && settings.evaluateQueryDefaultStatsUnique) {
if ((item.rarity === ItemRarity.Unique || item.rarity === ItemRarity.UniqueRelic) && settings.evaluateQueryDefaultStatsUnique) {
queryItem.stats = item.stats
} else {
queryItem.stats = item.stats.map((stat) => {
Expand Down
5 changes: 4 additions & 1 deletion src/app/modules/evaluate/service/evaluate-dialog.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,16 @@ export class EvaluateDialogService {
}
}

if (item.veiled || item.corrupted) {
if (item.veiled || item.corrupted || item.relic) {
if (item.veiled) {
height += DIALOG_LINE_HEIGHT
}
if (item.corrupted) {
height += DIALOG_LINE_HEIGHT
}
if (item.relic) {
height += DIALOG_LINE_HEIGHT
}
height += DIALOG_DIVIDER_HEIGHT
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,22 @@
}
}

&.uniquefoil {
background: url(../../../../../../assets/poe/item/header-relic-left.png) top left no-repeat,
url(../../../../../../assets/poe/item/header-relic-right.png) top right no-repeat,
url(../../../../../../assets/poe/item/header-relic-middle.png) top center repeat-x;

&.double {
background: url(../../../../../../assets/poe/item/header-double-relic-left.png) top left no-repeat,
url(../../../../../../assets/poe/item/header-double-relic-right.png) top right no-repeat,
url(../../../../../../assets/poe/item/header-double-relic-middle.png) top center repeat-x;
}

> .name {
color: $green;
}
}

&.currency {
background: url(../../../../../../assets/poe/item/header-currency-left.png) top left no-repeat,
url(../../../../../../assets/poe/item/header-currency-right.png) top right no-repeat,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Gradients generated using https://www.colorzilla.com/gradient-editor/

.separator {
height: 2px;
width: 220px;
Expand Down Expand Up @@ -138,6 +140,64 @@
);
}

&.uniquefoil {
background: linear-gradient(
to right,
rgba(0,0,0,0) 0%,
rgba(0,0,0,0.04) 6%,
rgba(0,0,0,0.06) 7%,
rgba(16,16,0,0.08) 8%,
rgba(19,19,0,0.11) 10%,
rgba(25,16,0,0.12) 11%,
rgba(28,21,0,0.14) 12%,
rgba(26,20,0,0.16) 13%,
rgba(32,27,0,0.19) 14%,
rgba(36,25,5,0.21) 15%,
rgba(46,39,4,0.26) 17%,
rgba(56,42,3,0.29) 18%,
rgba(57,44,6,0.31) 19%,
rgba(103,80,9,0.56) 25%,
rgba(103,81,9,0.6) 26%,
rgba(109,86,9,0.64) 27%,
rgba(115,91,9,0.67) 28%,
rgba(123,96,12,0.72) 30%,
rgba(127,99,13,0.74) 31%,
rgba(129,108,25,0.81) 35%,
rgba(123,106,35,0.85) 37%,
rgba(119,107,39,0.87) 38%,
rgba(102,109,54,0.9) 42%,
rgba(91,111,61,0.93) 45%,
rgba(87,111,63,0.93) 46%,
rgba(87,116,68,0.93) 50%,
rgba(84,111,77,0.93) 54%,
rgba(81,109,84,0.93) 55%,
rgba(74,104,97,0.92) 57%,
rgba(48,88,130,0.87) 63%,
rgba(43,83,133,0.85) 64%,
rgba(38,80,134,0.8) 66%,
rgba(35,79,135,0.78) 67%,
rgba(29,72,129,0.72) 70%,
rgba(30,68,119,0.68) 72%,
rgba(31,66,114,0.64) 73%,
rgba(28,49,67,0.46) 78%,
rgba(30,45,62,0.42) 79%,
rgba(25,37,46,0.35) 81%,
rgba(23,33,44,0.31) 82%,
rgba(22,30,37,0.28) 83%,
rgba(24,27,35,0.25) 84%,
rgba(20,24,24,0.22) 85%,
rgba(17,22,22,0.19) 86%,
rgba(13,19,19,0.17) 87%,
rgba(15,15,15,0.14) 88%,
rgba(16,16,16,0.12) 89%,
rgba(9,9,9,0.11) 90%,
rgba(13,13,13,0.09) 91%,
rgba(0,0,0,0.08) 92%,
rgba(0,0,0,0.03) 95%,
rgba(0,0,0,0) 100%
);
}

&.currency {
background: linear-gradient(
to right,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@
<div class="unidentified">{{ 'ItemPopupUnidentified' | clientString: language }}</div>
</app-item-frame-query>
</ng-container>
<ng-container *ngIf="item.relic !== undefined">
<app-item-frame-query [(property)]="queryItem.relic" [value]="item.relic">
<div class="relic">{{ 'ItemPopupRelicUnique' | clientString: language }}</div>
</app-item-frame-query>
</ng-container>
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@
}
}
}

.relic {
color: $green;
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export class ItemFrameComponent implements OnInit {
this.state = !!(
this.item.corrupted !== undefined ||
this.item.veiled !== undefined ||
this.item.unidentified !== undefined
this.item.unidentified !== undefined ||
this.item.relic !== undefined
)
this.influences = !!this.item.influences

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class ItemCategoryValuesProvider {
): Observable<ItemCategoryValues> {
switch (category) {
case ItemCategory.Map: {
if (rarity === ItemRarity.Unique) {
if (rarity === ItemRarity.Unique || rarity === ItemRarity.UniqueRelic) {
const key = `${leagueId}_${ItemCategory.Map}_${ItemRarity.Unique}`
return this.fetch(key, () => this.fetchItem(leagueId, ItemOverviewType.UniqueMap))
} else {
Expand Down Expand Up @@ -122,13 +122,13 @@ export class ItemCategoryValuesProvider {
case ItemCategory.JewelBase:
case ItemCategory.JewelAbyss:
case ItemCategory.JewelCluster:
if (rarity === ItemRarity.Unique) {
if (rarity === ItemRarity.Unique || rarity === ItemRarity.UniqueRelic) {
const key = `${leagueId}_${ItemCategory.Jewel}`
return this.fetch(key, () => this.fetchItem(leagueId, ItemOverviewType.UniqueJewel))
}
return of({ values: [] })
case ItemCategory.Flask:
if (rarity === ItemRarity.Unique) {
if (rarity === ItemRarity.Unique || rarity === ItemRarity.UniqueRelic) {
const key = `${leagueId}_${ItemCategory.Flask}`
return this.fetch(key, () => this.fetchItem(leagueId, ItemOverviewType.UniqueFlask))
}
Expand All @@ -152,7 +152,7 @@ export class ItemCategoryValuesProvider {
case ItemCategory.WeaponTwoSword:
case ItemCategory.WeaponWand:
case ItemCategory.WeaponRod:
if (rarity === ItemRarity.Unique) {
if (rarity === ItemRarity.Unique || rarity === ItemRarity.UniqueRelic) {
const key = `${leagueId}_${ItemCategory.Weapon}`
return this.fetch(key, () => this.fetchItem(leagueId, ItemOverviewType.UniqueWeapon))
}
Expand All @@ -164,7 +164,7 @@ export class ItemCategoryValuesProvider {
case ItemCategory.ArmourHelmet:
case ItemCategory.ArmourShield:
case ItemCategory.ArmourQuiver:
if (rarity === ItemRarity.Unique) {
if (rarity === ItemRarity.Unique || rarity === ItemRarity.UniqueRelic) {
const key = `${leagueId}_${ItemCategory.Armour}`
return this.fetch(key, () => this.fetchItem(leagueId, ItemOverviewType.UniqueArmour))
}
Expand All @@ -173,7 +173,7 @@ export class ItemCategoryValuesProvider {
case ItemCategory.AccessoryAmulet:
case ItemCategory.AccessoryBelt:
case ItemCategory.AccessoryRing:
if (rarity === ItemRarity.Unique) {
if (rarity === ItemRarity.Unique || rarity === ItemRarity.UniqueRelic) {
const key = `${leagueId}_${ItemCategory.Accessory}`
return this.fetch(key, () => this.fetchItem(leagueId, ItemOverviewType.UniqueAccessory))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export class ItemExchangeRateService {
if (item.typeId && !item.nameId) {
results = results.filter((x) => filterName(x, type))
} else {
results = results.filter((x) => filterName(x, name) && x.type === type && !x.relic)
results = results.filter((x) => filterName(x, name) && x.type === type && ((!item.relic && !x.relic) || (x.relic === item.relic)))
}
// Apply generic filters
results = results.filter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { ItemSectionFlaskParserService } from './item-section-flask-parser.servi
import { ItemSectionProphecyParserService } from './item-section-prophecy-parser.service'
import { ItemSectionGemExperienceParserService } from './item-section-gem-experience-parser.service'
import { ItemSectionUltimatumParserService } from './item-section-ultimatum-parser.service'
import { ItemSectionRelicParserService } from './item-section-relic-parser.service'

@Injectable({
providedIn: 'root',
Expand All @@ -38,6 +39,7 @@ export class ItemParserService {
itemSectionProphecyParserService: ItemSectionProphecyParserService,
itemSectionGemExperienceParserService: ItemSectionGemExperienceParserService,
itemSectionUltimatumParserService: ItemSectionUltimatumParserService,
itemSectionRelicParserService: ItemSectionRelicParserService,
) {
this.parsers = [
itemSectionRarityParser,
Expand All @@ -46,6 +48,7 @@ export class ItemParserService {
itemSectionItemLevelParserService,
itemSectionSocketsParserService,
itemSectionUltimatumParserService, // Parse prior to Properties
itemSectionRelicParserService, // Parse prior to Properties
itemSectionPropertiesParserService,
itemSectionFlaskParserService, // Properties have to be parsed first in case the Flask Parser contains Quality.
itemSectionProphecyParserService, // Properties have to be parsed first in case the Prophecy Parser needs to adjust some properties.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class ItemSectionPropertiesParserService implements ItemSectionParserServ
case ItemRarity.Magic:
case ItemRarity.Rare:
case ItemRarity.Unique:
case ItemRarity.UniqueRelic:
case ItemRarity.NonUnique:
props.weaponPhysicalDamage = this.parseValueProperty(
line,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Injectable } from '@angular/core'
import {
ExportedItem,
Item,
ItemRarity,
ItemSection,
ItemSectionParserService,
Section,
} from '@shared/module/poe/type'
import { ClientStringService } from '../../client-string/client-string.service'

@Injectable({
providedIn: 'root',
})
export class ItemSectionRelicParserService implements ItemSectionParserService {
constructor(private readonly clientString: ClientStringService) {}

public optional = true
public section = ItemSection.Relic

public parse(item: ExportedItem, target: Item): Section {
const phrase = new RegExp(`^${this.clientString.translate('ItemPopupRelicUnique')}$`)

const relicSection = item.sections.find((x) => phrase.test(x.content))
if (!relicSection) {
return null
}

target.rarity = ItemRarity.UniqueRelic
target.relic = true
return relicSection
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export class ItemSectionStatsParserService implements ItemSectionParserService {
case ItemRarity.Magic:
case ItemRarity.Rare:
case ItemRarity.Unique:
case ItemRarity.UniqueRelic:
break
case ItemRarity.Currency:
if (target.properties?.ultimatum) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export class ItemPseudoProcessorService {
if (
stat.type !== StatType.Pseudo && // Never remove pseudo stats
item.rarity !== ItemRarity.Unique && // Never remove stats from unique items
item.rarity !== ItemRarity.UniqueRelic && // Never remove stats from unique relic items
stat.type !== StatType.Fractured && // Never remove fractured stats
// Never remove synthesized implicit stats
(!item.influences || !item.influences.synthesized || stat.type !== StatType.Implicit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,27 @@ export class ItemSearchFiltersTypeService implements ItemSearchFiltersService {
case ItemCategory.AccessoryBelt:
case ItemCategory.AccessoryRing:
case ItemCategory.AccessoryTrinket:
if (item.rarity === ItemRarity.Unique) {
query.filters.type_filters.filters.rarity = {
option: ItemRarity.Unique,
}
} else {
query.filters.type_filters.filters.rarity = {
option: ItemRarity.NonUnique,
}
switch (item.rarity) {
case ItemRarity.Unique:
query.filters.type_filters.filters.rarity = {
option: item.rarity,
}
break
case ItemRarity.UniqueRelic:
query.filters.type_filters.filters.rarity = {
option: item.relic ? item.rarity : ItemRarity.Unique,
}
break
default:
query.filters.type_filters.filters.rarity = {
option: ItemRarity.NonUnique,
}

if (query.name) {
query.term = `${query.name.option || ''} ${query.type.option || ''}`.trim()
query.name = query.type = undefined
}
if (query.name) {
query.term = `${query.name.option || ''} ${query.type.option || ''}`.trim()
query.name = query.type = undefined
}
break
}
query.filters.type_filters.filters.category = {
option: item.category,
Expand All @@ -100,8 +108,22 @@ export class ItemSearchFiltersTypeService implements ItemSearchFiltersService {
case ItemCategory.MonsterBeast:
// watchstones
case ItemCategory.Watchstone:
query.filters.type_filters.filters.rarity = {
option: item.rarity === ItemRarity.Unique ? ItemRarity.Unique : ItemRarity.NonUnique,
switch (item.rarity) {
case ItemRarity.Unique:
query.filters.type_filters.filters.rarity = {
option: item.rarity,
}
break
case ItemRarity.UniqueRelic:
query.filters.type_filters.filters.rarity = {
option: item.relic ? item.rarity : ItemRarity.Unique,
}
break
default:
query.filters.type_filters.filters.rarity = {
option: ItemRarity.NonUnique,
}
break
}
query.filters.type_filters.filters.category = {
option: item.category,
Expand Down Expand Up @@ -150,7 +172,7 @@ export class ItemSearchFiltersTypeService implements ItemSearchFiltersService {
query.filters.type_filters.filters.category = {
option: item.category,
}
if (item.rarity === ItemRarity.Unique) {
if (item.rarity === ItemRarity.Unique || item.rarity === ItemRarity.UniqueRelic) {
query.name = undefined
}
break
Expand Down
3 changes: 3 additions & 0 deletions src/app/shared/module/poe/type/item.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface Item {
unidentified?: boolean
veiled?: boolean
blighted?: boolean
relic?: boolean
damage?: ItemWeaponDamage
sockets?: ItemSocket[]
properties?: ItemProperties
Expand Down Expand Up @@ -42,6 +43,7 @@ export enum ItemRarity {
Magic = 'magic',
Rare = 'rare',
Unique = 'unique',
UniqueRelic = 'uniquefoil',
Currency = 'currency',
Gem = 'gem',
DivinationCard = 'divinationcard',
Expand Down Expand Up @@ -277,6 +279,7 @@ export enum ItemSection {
Prophecy,
Experience,
Ultimatum,
Relic,
}

export interface ItemSectionParserService {
Expand Down
Binary file added src/assets/poe/item/header-double-relic-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/poe/item/header-double-relic-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/poe/item/header-relic-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/poe/item/header-relic-middle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/poe/item/header-relic-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading