mirror of
https://github.com/Kvan7/Exiled-Exchange-2.git
synced 2026-10-09 21:01:30 +00:00
improve pseudo and implicit filters on unique items
This commit is contained in:
1 parent
b3a561e93a
commit
f3fe044fa4
3 files changed
+25
-9
No files matched your search
@@ -150,9 +150,7 @@ export default defineComponent({
|
||||
props.item.info.refName !== 'Mirrored Tablet' &&
|
||||
props.item.info.refName !== 'Filled Coffin' &&
|
||||
props.item.category !== ItemCategory.Gem &&
|
||||
!(props.item.rarity === ItemRarity.Unique && !props.grouped && (
|
||||
props.filter.tag === FilterTag.Explicit ||
|
||||
props.filter.tag === FilterTag.Pseudo))
|
||||
!(props.item.rarity === ItemRarity.Unique && props.filter.tag === FilterTag.Explicit && !props.grouped)
|
||||
)
|
||||
|
||||
const showQ20Notice = computed(() => {
|
||||
|
||||
@@ -480,6 +480,12 @@ function finalFilterTweaks (ctx: FiltersCreationContext) {
|
||||
}
|
||||
} else if (filter.sources[0]?.stat.stat.jewelleryQuality) {
|
||||
filter.hidden = 'hide_jewellery_quality'
|
||||
} else if (filter.tag === FilterTag.Implicit) {
|
||||
if (item.rarity === ItemRarity.Unique) {
|
||||
// hide not Corrupted, Vestigial implicits etc., that were not consumed by pseudo stats
|
||||
filter.hidden = 'hide_unique_base_implicit'
|
||||
filter.disabled = true
|
||||
}
|
||||
} else if (filter.tag === FilterTag.Property) {
|
||||
if (
|
||||
item.rarity === ItemRarity.Unique &&
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { stat, pseudoStatByRef } from '@/assets/data'
|
||||
import { ItemRarity } from '@/parser/ParsedItem'
|
||||
import { ModifierType, StatCalculated, StatSource } from '@/parser/modifiers'
|
||||
import { calculatedStatToFilter, FiltersCreationContext } from '../create-stat-filters'
|
||||
import type { StatFilter } from '../interfaces'
|
||||
@@ -37,6 +38,7 @@ interface PseudoRule {
|
||||
ref: string
|
||||
multiplier?: number
|
||||
required?: boolean
|
||||
keep?: boolean
|
||||
}>
|
||||
mutate?: (filter: StatFilter) => void
|
||||
}
|
||||
@@ -98,21 +100,21 @@ const PSEUDO_RULES: PseudoRule[] = [
|
||||
group: 'to_x_attr',
|
||||
stats:
|
||||
ATTRIBUTES_INFO.filter(info => info.attributes.includes('str'))
|
||||
.map(info => ({ ref: info.ref }))
|
||||
.map(info => ({ ref: info.ref, keep: info.attributes.length > 1 }))
|
||||
},
|
||||
{
|
||||
pseudo: stat('+# total to Dexterity'),
|
||||
group: 'to_x_attr',
|
||||
stats:
|
||||
ATTRIBUTES_INFO.filter(info => info.attributes.includes('dex'))
|
||||
.map(info => ({ ref: info.ref }))
|
||||
.map(info => ({ ref: info.ref, keep: info.attributes.length > 1 }))
|
||||
},
|
||||
{
|
||||
pseudo: stat('+# total to Intelligence'),
|
||||
group: 'to_x_attr',
|
||||
stats:
|
||||
ATTRIBUTES_INFO.filter(info => info.attributes.includes('int'))
|
||||
.map(info => ({ ref: info.ref }))
|
||||
.map(info => ({ ref: info.ref, keep: info.attributes.length > 1 }))
|
||||
},
|
||||
{
|
||||
pseudo: stat('+# total maximum Life'),
|
||||
@@ -120,7 +122,7 @@ const PSEUDO_RULES: PseudoRule[] = [
|
||||
stats: [
|
||||
{ ref: stat('+# to maximum Life'), required: true },
|
||||
...ATTRIBUTES_INFO.filter(info => info.attributes.includes('str'))
|
||||
.map(info => ({ ref: info.ref, multiplier: 5 / 10 }))
|
||||
.map(info => ({ ref: info.ref, multiplier: 5 / 10, keep: true }))
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -128,7 +130,7 @@ const PSEUDO_RULES: PseudoRule[] = [
|
||||
stats: [
|
||||
{ ref: stat('+# to maximum Mana'), required: true },
|
||||
...ATTRIBUTES_INFO.filter(info => info.attributes.includes('int'))
|
||||
.map(info => ({ ref: info.ref, multiplier: 5 / 10 }))
|
||||
.map(info => ({ ref: info.ref, multiplier: 5 / 10, keep: true }))
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -305,6 +307,8 @@ const PSEUDO_RULES: PseudoRule[] = [
|
||||
export function filterPseudo (ctx: FiltersCreationContext) {
|
||||
const filterByGroup = new Map<string, StatFilter[]>()
|
||||
|
||||
const appliedRules: PseudoRule[] = []
|
||||
|
||||
rulesLoop:
|
||||
for (const rule of PSEUDO_RULES) {
|
||||
const sources = filterPseudoSources(ctx.statsByType, ({ stat }, source) => {
|
||||
@@ -332,6 +336,13 @@ export function filterPseudo (ctx: FiltersCreationContext) {
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx.item.rarity === ItemRarity.Unique) {
|
||||
const explicitSources = sources.filter(source => source.modifier.info.type === ModifierType.Explicit)
|
||||
if (explicitSources.length < 2) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
const filter = calculatedStatToFilter({
|
||||
stat: pseudoStatByRef(rule.pseudo)!,
|
||||
type: ModifierType.Pseudo,
|
||||
@@ -345,6 +356,7 @@ export function filterPseudo (ctx: FiltersCreationContext) {
|
||||
}
|
||||
|
||||
ctx.filters.push(filter)
|
||||
appliedRules.push(rule)
|
||||
|
||||
if (rule.replaces && filterByGroup.has(rule.replaces)) {
|
||||
const replacedFilters = filterByGroup.get(rule.replaces)!
|
||||
@@ -361,7 +373,7 @@ export function filterPseudo (ctx: FiltersCreationContext) {
|
||||
}
|
||||
|
||||
ctx.statsByType = ctx.statsByType.filter(m =>
|
||||
!PSEUDO_RULES.some(rule => rule.stats.some(({ ref }) => m.stat.ref === ref)))
|
||||
!appliedRules.some(rule => rule.stats.some(({ ref, keep }) => m.stat.ref === ref && !keep)))
|
||||
|
||||
if (filterByGroup.has('to_x_ele_res')) {
|
||||
const resFilters = filterByGroup.get('to_x_ele_res')!
|
||||
|
||||
Reference in new issue
Block a user