Skip to content

Commit

Permalink
Feature/crucible league support (#324)
Browse files Browse the repository at this point in the history
* Added support for the 'Crucible' stat type

* Updated the PoE Assets using PoE Asset Updater (commit 834cd29) and PoE Client v3.21.0 (hotfix 8)
  • Loading branch information
WhiteFang5 committed Apr 9, 2023
1 parent 03c1c7e commit 0741422
Show file tree
Hide file tree
Showing 20 changed files with 528,623 additions and 329,295 deletions.
1 change: 1 addition & 0 deletions src/app/data/poe/schema/poe-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export enum TradeStatsResultLabel {
Delve = 'Delve',
Ultimatum = 'Ultimatum',
Scourge = 'Scourge',
Crucible = 'Crucible',
}

export interface TradeStatsResultResultEntry {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ label {
&.scourge {
background-color: $scourge;
}

&.crucible {
background-color: $crucible;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ export class EvaluateSettingsComponent implements UserSettingsComponent {
StatType.Monster,
StatType.Ultimatum,
StatType.Scourge,
StatType.Crucible,
]
types.forEach((type) => {
const stats = this.statsProvider.provide(type)
Expand Down
3 changes: 3 additions & 0 deletions src/app/modules/evaluate/service/evaluate-dialog.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ export class EvaluateDialogService {
) {
height += DIALOG_DIVIDER_HEIGHT
}
if (unique[StatType.Crucible]) {
height += DIALOG_DIVIDER_HEIGHT
}
if (unique[StatType.Pseudo]) {
height += DIALOG_DIVIDER_HEIGHT
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@
<ng-container *ngIf="groups.fractured || groups.explicit || groups.monster || groups.ultimatum || groups.crafted">
<app-item-frame-separator [item]="item" *ngIf="groups.pseudo"></app-item-frame-separator>
</ng-container>
<ng-container *ngIf="groups.crucible">
<ng-container *ngFor="let stat of groups.crucible; let last = last">
<div class="crucible">
<ng-container *ngTemplateOutlet="statQuery; context: { stat: stat }"></ng-container>
</div>
<app-item-frame-separator [item]="item" *ngIf="last && groups.pseudo"></app-item-frame-separator>
</ng-container>
</ng-container>
<ng-container *ngIf="groups.pseudo">
<ng-container *ngFor="let stat of groups.pseudo">
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
color: $scourge;
}

.crucible {
color: $crucible;
}

::ng-deep {
app-item-frame-stats {
.cold {
Expand Down
3 changes: 3 additions & 0 deletions src/app/shared/module/poe/provider/stats-local.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
veiled,
ultimatum,
scourge,
crucible,
} from '../../../../../assets/poe/stats-local.json'
import { StatLocalMap, StatType } from '../type'

Expand Down Expand Up @@ -39,6 +40,8 @@ export class StatsLocalProvider {
return ultimatum
case StatType.Scourge:
return scourge
case StatType.Crucible:
return crucible
}
}
}
3 changes: 3 additions & 0 deletions src/app/shared/module/poe/provider/stats.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
veiled,
ultimatum,
scourge,
crucible,
} from '../../../../../assets/poe/stats.json'
import { StatMap, StatType } from '../type'

Expand Down Expand Up @@ -39,6 +40,8 @@ export class StatsProvider {
return ultimatum
case StatType.Scourge:
return scourge
case StatType.Crucible:
return crucible
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,11 @@ export class ItemPseudoProcessorService {
item.rarity !== ItemRarity.UniqueRelic && // Never remove stats from unique relic items
stat.type !== StatType.Fractured && // Never remove fractured stats
stat.type !== StatType.Scourge && // Never remove scourged stats
stat.type !== StatType.Crucible && // Never remove crucible stats
// Never remove synthesised implicit stats
(!item.influences || !item.influences.synthesised || stat.type !== StatType.Implicit) &&
// Never remove stats if the pseudo grouping occured with a scourged stat
stats.findIndex(x => x.type === StatType.Scourge) === -1
// Never remove stats if the pseudo grouping occured with a scourged or crucible stat
stats.findIndex(x => x.type === StatType.Scourge || x.type === StatType.Crucible) === -1
) {
item.stats = item.stats.filter((y) => y !== stat)
}
Expand Down
27 changes: 22 additions & 5 deletions src/app/shared/module/poe/service/stats/stats.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ interface StatMatch {

const REVERSE_REGEX = /\\[.*+?^${}()|[\]\\]/g
const VALUE_PLACEHOLDER = '(\\S+)'
const TYPE_PLACEHOLDER_REGEX = / \(implicit\)| \(fractured\)| \(crafted\)| \(enchant\)| \(scourge\)/
const TYPE_PLACEHOLDER_REGEX = / \(implicit\)| \(fractured\)| \(crafted\)| \(enchant\)| \(scourge\)| \(crucible\)/
const SCOURGE_PLACEHOLDER_REGEX = / \(scourge\)$/
const CRUCIBLE_PLACEHOLDER_REGEX = / \(crucible\)$/

@Injectable({
providedIn: 'root',
Expand Down Expand Up @@ -152,7 +153,7 @@ export class StatsService {
language = language || this.context.get().gameLanguage || this.context.get().language
options = options || {}

const { scourgedSearch, implicitsSearch, explicitsSearch } = this.buildSearch(texts, options)
const { scourgedSearch, implicitsSearch, explicitsSearch, crucibleSearch } = this.buildSearch(texts, options)

const results: StatsSearchResult[] = []
if (scourgedSearch.sections.length > 0) {
Expand All @@ -167,6 +168,10 @@ export class StatsService {
this.executeSearch(explicitsSearch, options, language, results)
}

if (crucibleSearch.sections.length > 0) {
this.executeSearch(crucibleSearch, options, language, results)
}

return results
}

Expand Down Expand Up @@ -457,6 +462,7 @@ export class StatsService {
scourgedSearch: StatsSectionsSearch
implicitsSearch: StatsSectionsSearch
explicitsSearch: StatsSectionsSearch
crucibleSearch: StatsSectionsSearch
} {
const implicitPhrase = ` (${StatType.Implicit})`
const implicitsSearch: StatsSectionsSearch = {
Expand All @@ -481,13 +487,24 @@ export class StatsService {
if (options.ultimatum) {
explicitsSearch.types.push(StatType.Ultimatum)
}
const cruciblePhrase = ` (${StatType.Crucible})`
const crucibleSearch: StatsSectionsSearch = {
types: [StatType.Crucible],
sections: [],
}
texts.forEach((text, index) => {
if (text.indexOf(scourgePhrase) !== -1) {
// scourge stats have there own section
// scourge stats have their own section
scourgedSearch.sections.push({
index: index,
index,
text: text.split('\n').map(x => x.replace(SCOURGE_PLACEHOLDER_REGEX, '')).join('\n')
})
} else if (text.indexOf(cruciblePhrase) !== -1) {
// crucible stats have their own section
crucibleSearch.sections.push({
index,
text,
})
} else {
const section: StatsSectionText = {
index,
Expand Down Expand Up @@ -522,6 +539,6 @@ export class StatsService {
}
}
})
return { scourgedSearch, implicitsSearch, explicitsSearch }
return { scourgedSearch, implicitsSearch, explicitsSearch, crucibleSearch }
}
}
1 change: 1 addition & 0 deletions src/app/shared/module/poe/type/stat.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export enum StatType {
Monster = 'monster',
Ultimatum = 'ultimatum',
Scourge = 'scourge',
Crucible = 'crucible',
}

export interface Stat {
Expand Down
94 changes: 92 additions & 2 deletions src/assets/poe/annointments.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,16 @@
"Mushrune3",
"Mushrune7"
],
"59423": [
"Mushrune4",
"Mushrune4",
"Mushrune6b"
],
"60781": [
"Mushrune3",
"Mushrune5",
"Mushrune6b"
],
"56207": [
"Mushrune1",
"Mushrune5",
Expand Down Expand Up @@ -380,11 +390,21 @@
"Mushrune6",
"Mushrune6"
],
"28034": [
"Mushrune1",
"Mushrune6b",
"Mushrune6b"
],
"59866": [
"Mushrune2",
"Mushrune6",
"Mushrune7"
],
"45657": [
"Mushrune2",
"Mushrune6b",
"Mushrune6b"
],
"35436": [
"Mushrune3",
"Mushrune6",
Expand Down Expand Up @@ -415,11 +435,36 @@
"Mushrune6",
"Mushrune6"
],
"55002": [
"Mushrune4",
"Mushrune6b",
"Mushrune6b"
],
"52789": [
"Mushrune1",
"Mushrune6b",
"Mushrune7"
],
"60619": [
"Mushrune1",
"Mushrune2",
"Mushrune8"
],
"63453": [
"Mushrune5",
"Mushrune6b",
"Mushrune6b"
],
"28449": [
"Mushrune3",
"Mushrune6b",
"Mushrune7"
],
"62802": [
"Mushrune4",
"Mushrune6b",
"Mushrune7"
],
"6237": [
"Mushrune2",
"Mushrune2",
Expand Down Expand Up @@ -455,7 +500,7 @@
"Mushrune4",
"Mushrune8"
],
"51881": [
"48823": [
"Mushrune2",
"Mushrune4",
"Mushrune8"
Expand Down Expand Up @@ -550,6 +595,11 @@
"Mushrune7",
"Mushrune7"
],
"41870": [
"Mushrune1",
"Mushrune6b",
"Mushrune8"
],
"25738": [
"Mushrune2",
"Mushrune6b",
Expand All @@ -570,6 +620,11 @@
"Mushrune6",
"Mushrune8"
],
"62849": [
"Mushrune4",
"Mushrune6b",
"Mushrune8"
],
"24858": [
"Mushrune5",
"Mushrune6b",
Expand Down Expand Up @@ -735,6 +790,11 @@
"Mushrune6",
"Mushrune9"
],
"29522": [
"Mushrune6b",
"Mushrune8",
"Mushrune8"
],
"19730": [
"Mushrune1",
"Mushrune6b",
Expand All @@ -750,6 +810,11 @@
"Mushrune5",
"Mushrune9"
],
"32681": [
"Mushrune2",
"Mushrune6b",
"Mushrune9"
],
"6967": [
"Mushrune4",
"Mushrune6",
Expand All @@ -765,6 +830,11 @@
"Mushrune8",
"Mushrune8"
],
"45945": [
"Mushrune4",
"Mushrune6b",
"Mushrune9"
],
"49621": [
"Mushrune1",
"Mushrune7",
Expand Down Expand Up @@ -965,6 +1035,11 @@
"Mushrune5",
"Mushrune10"
],
"34284": [
"Mushrune3",
"Mushrune6b",
"Mushrune10"
],
"24324": [
"Mushrune4",
"Mushrune6",
Expand Down Expand Up @@ -1105,6 +1180,11 @@
"Mushrune8",
"Mushrune10"
],
"30974": [
"Mushrune6b",
"Mushrune9",
"Mushrune9"
],
"6615": [
"Mushrune1",
"Mushrune1",
Expand Down Expand Up @@ -1330,7 +1410,7 @@
"Mushrune8",
"Mushrune11"
],
"48823": [
"51881": [
"Mushrune2",
"Mushrune8",
"Mushrune11"
Expand Down Expand Up @@ -1480,6 +1560,11 @@
"Mushrune5",
"Mushrune12"
],
"53652": [
"Mushrune2",
"Mushrune6b",
"Mushrune12"
],
"53759": [
"Mushrune1",
"Mushrune6",
Expand Down Expand Up @@ -1585,6 +1670,11 @@
"Mushrune6",
"Mushrune12"
],
"13375": [
"Mushrune6b",
"Mushrune9",
"Mushrune11"
],
"55485": [
"Mushrune5",
"Mushrune7",
Expand Down

0 comments on commit 0741422

Please sign in to comment.