forked from SnosMe/awakened-poe-trade
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: sithrebel15 <[email protected]>
- Loading branch information
1 parent
cf321af
commit 2beef00
Showing
6 changed files
with
99 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
renderer/src/web/price-check/filters/pseudo/reflection-rules.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { stat } from '@/assets/data' | ||
import type { StatFilter } from '../interfaces' | ||
|
||
interface FilterRule { | ||
ref: string | ||
disabled?: boolean | ||
difficulty?: 'any' | ||
} | ||
|
||
const RULES: FilterRule[] = [ | ||
{ ref: stat('Reflection of the Breachlord (Difficulty #)') }, | ||
{ ref: stat('Reflection of Delirium (Difficulty #)'), difficulty: 'any' }, | ||
{ ref: stat('Reflection of Tyranny (Difficulty #)') }, | ||
{ ref: stat('Reflection of the Trove (Difficulty #)') }, | ||
{ ref: stat('Reflection of Thralldom (Difficulty #)') }, | ||
{ ref: stat('Reflection of Phaaryl (Difficulty #)') }, | ||
{ ref: stat('Reflection of Perverted Faith (Difficulty #)') }, | ||
{ ref: stat('Reflection of Kalandra (Difficulty #)'), disabled: false }, | ||
{ ref: stat('Reflection of Experimentation (Difficulty #)') }, | ||
{ ref: stat('Reflection of the Sun (Difficulty #)'), disabled: false }, | ||
{ ref: stat('Reflection of the Monolith (Difficulty #)') }, | ||
{ ref: stat('Reflection of the Nightmare (Difficulty #)') }, | ||
{ ref: stat('Reflection of Azurite (Difficulty #)') }, | ||
{ ref: stat('Reflection of Paradise (Difficulty #)'), disabled: false }, | ||
{ ref: stat('Reflection of Angling (Difficulty #)'), disabled: false }, | ||
] | ||
|
||
export function applyRules (filters: StatFilter[]) { | ||
for (let i = 0; i < filters.length;) { | ||
const filter = filters[i] | ||
const rule = RULES.find(rule => rule.ref === filter.statRef) | ||
if (!rule) { | ||
const difficulty = filter.roll!.value | ||
if (difficulty < 8) { | ||
filters.splice(i, 1) | ||
continue | ||
} else { | ||
filter.hidden = 'low_tier_reflection' | ||
} | ||
} else { | ||
if (rule.difficulty === 'any') { | ||
filter.roll = undefined | ||
} | ||
if (rule.disabled !== undefined) { | ||
filter.disabled = rule.disabled | ||
} | ||
} | ||
i += 1 | ||
} | ||
} |