Skip to content

Commit

Permalink
Feature/initial heist items and stats (#143)
Browse files Browse the repository at this point in the history
* Updated the PoE Assets for the Heist league

* Updated placeholder-replacing as per Heist API and string-formatting changes

* Added support for the newly added trade-API categories
  • Loading branch information
WhiteFang5 authored Sep 24, 2020
1 parent 776484f commit fd03294
Show file tree
Hide file tree
Showing 13 changed files with 647,136 additions and 600,255 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,16 @@ export class ItemCategoryValuesProvider {
case ItemCategory.MonsterSample:
case ItemCategory.CurrencyPiece:
case ItemCategory.CurrencySeedBooster:
case ItemCategory.AccessoryTrinket:
case ItemCategory.CurrencyHeistTarget:
case ItemCategory.HeistEquipment:
case ItemCategory.HeistGear:
case ItemCategory.HeistTool:
case ItemCategory.HeistCloak:
case ItemCategory.HeistUtility:
case ItemCategory.HeistMission:
case ItemCategory.HeistContract:
case ItemCategory.HeistBlueprint:
return of({ values: [] })
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class ItemSectionFlaskParserService implements ItemSectionParserService {
public section = ItemSection.Flask

public parse(item: ExportedItem, target: Item): Section {
const phrase = `${this.clientString.translate('ItemDisplayChargesNCharges').replace('%0', '0')}`
const phrase = `${this.clientString.translate('ItemDisplayChargesNCharges').replace('{0}', '0')}`

const flaskSection = item.sections.find((x) => x.content.indexOf(phrase) !== -1)
if (!flaskSection) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class ItemSectionItemLevelParserService implements ItemSectionParserServi
case ItemCategory.CurrencyVividSeed:
case ItemCategory.CurrencyPrimalSeed:
const seedMonsterLevelPhrase = new RegExp(
this.clientString.translate('ItemDisplayHarvestMonsterLevel').replace('%0', '(\\S+)')
this.clientString.translate('ItemDisplayHarvestMonsterLevel').replace('{0}', '(\\S+)')
)

itemLevelSection = item.sections.find((x) => seedMonsterLevelPhrase.test(x.content))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class ItemSectionPropertiesParserService implements ItemSectionParserServ
.slice(phrase.length)
.split(',')
.map((text) => {
const max = this.clientString.translate('ItemDisplaySkillGemMaxLevel').replace('%1%', '')
const max = this.clientString.translate('ItemDisplaySkillGemMaxLevel').replace('{0}', '')
text = text.replace(max, '')
const property: ItemProperty = {
augmented: text.indexOf(AUGMENTED_PHRASE) !== -1,
Expand Down Expand Up @@ -134,7 +134,7 @@ export class ItemSectionPropertiesParserService implements ItemSectionParserServ
.slice(phrase.length)
.split(',')
.map((text) => {
const max = this.clientString.translate('ItemDisplaySkillGemMaxLevel').replace('%1%', '')
const max = this.clientString.translate('ItemDisplaySkillGemMaxLevel').replace('{0}', '')
text = text.replace(max, '')
const augmented = text.indexOf(AUGMENTED_PHRASE) !== -1
text = text.replace(AUGMENTED_PHRASE, '')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ export class ItemSectionRarityParserService implements ItemSectionParserService
// Determine the body part and update the item base type (typeId) accordingly.
const metamorphItemNameDisplay = this.clientString
.translate('MetamorphosisItemisedBossDisplayText')
.replace('%1%', this.baseItemTypesService.translate(target.typeId))
.replace('{0}', this.baseItemTypesService.translate(target.typeId))
const metamorphBodyParts = this.getMetamorphBodyParts()
for (const metamorphBodyPart of metamorphBodyParts) {
if (metamorphItemNameDisplay.replace('%2%', metamorphBodyPart.key) === target.type) {
if (metamorphItemNameDisplay.replace('{1}', metamorphBodyPart.key) === target.type) {
target.name = target.type
target.typeId = metamorphBodyPart.value
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class ItemSearchFiltersTypeService implements ItemSearchFiltersService {
case ItemCategory.AccessoryAmulet:
case ItemCategory.AccessoryBelt:
case ItemCategory.AccessoryRing:
case ItemCategory.AccessoryTrinket:
if (item.rarity === ItemRarity.Unique) {
query.filters.type_filters.filters.rarity = {
option: ItemRarity.Unique,
Expand All @@ -88,6 +89,7 @@ export class ItemSearchFiltersTypeService implements ItemSearchFiltersService {
break
// jewel
case ItemCategory.Jewel:
case ItemCategory.JewelBase:
case ItemCategory.JewelAbyss:
case ItemCategory.JewelCluster:
// flasks
Expand Down Expand Up @@ -116,6 +118,7 @@ export class ItemSearchFiltersTypeService implements ItemSearchFiltersService {
case ItemCategory.CurrencyResonator:
case ItemCategory.CurrencyFossil:
case ItemCategory.CurrencyIncubator:
case ItemCategory.CurrencyHeistTarget:
// seed
case ItemCategory.CurrencySeed:
case ItemCategory.CurrencyWildSeed:
Expand All @@ -127,6 +130,15 @@ export class ItemSearchFiltersTypeService implements ItemSearchFiltersService {
case ItemCategory.MapScarab:
// divination card
case ItemCategory.Card:
// heist
case ItemCategory.HeistEquipment:
case ItemCategory.HeistGear:
case ItemCategory.HeistTool:
case ItemCategory.HeistCloak:
case ItemCategory.HeistUtility:
case ItemCategory.HeistMission:
case ItemCategory.HeistContract:
case ItemCategory.HeistBlueprint:
query.filters.type_filters.filters.category = {
option: item.category,
}
Expand Down
10 changes: 10 additions & 0 deletions src/app/shared/module/poe/type/item.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export enum ItemCategory {
AccessoryAmulet = 'accessory.amulet',
AccessoryBelt = 'accessory.belt',
AccessoryRing = 'accessory.ring',
AccessoryTrinket = 'accessory.trinket',
Gem = 'gem',
GemActivegem = 'gem.activegem',
GemSupportGem = 'gem.supportgem',
Expand All @@ -96,11 +97,20 @@ export enum ItemCategory {
Card = 'card',
MonsterBeast = 'monster.beast',
MonsterSample = 'monster.sample',
HeistEquipment = 'heistequipment',
HeistGear = 'heistequipment.heistweapon',
HeistTool = 'heistequipment.heisttool',
HeistCloak = 'heistequipment.heistutility',
HeistUtility = 'heistequipment.heistreward',
HeistMission = 'heistmission',
HeistContract = 'heistmission.contract',
HeistBlueprint = 'heistmission.blueprint',
Currency = 'currency',
CurrencyPiece = 'currency.piece',
CurrencyResonator = 'currency.resonator',
CurrencyFossil = 'currency.fossil',
CurrencyIncubator = 'currency.incubator',
CurrencyHeistTarget = 'currency.heistobjective',
CurrencySeed = 'currency.seed',
CurrencyWildSeed = 'currency.wildseed',
CurrencyVividSeed = 'currency.vividseed',
Expand Down
Loading

0 comments on commit fd03294

Please sign in to comment.