mirror of
https://github.com/Kvan7/Exiled-Exchange-2.git
synced 2026-08-28 16:36:33 +00:00
fix unique items with multiple veiled mods getting price fixed
This commit is contained in:
@@ -458,6 +458,9 @@ export function createFilters(
|
||||
statRefs: item.statsByType
|
||||
.filter((calc) => calc.type === ModifierType.Veiled)
|
||||
.map((calc) => calc.stat.ref),
|
||||
veiledCount: item.newMods.filter(
|
||||
(m) => m.info.type === ModifierType.Veiled,
|
||||
).length,
|
||||
disabled: item.rarity !== ItemRarity.Unique,
|
||||
};
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ export interface ItemFilters {
|
||||
};
|
||||
veiled?: {
|
||||
statRefs: string[];
|
||||
veiledCount: number;
|
||||
disabled: boolean;
|
||||
};
|
||||
areaLevel?: FilterNumeric;
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
INTERNAL_TRADE_IDS,
|
||||
InternalTradeId,
|
||||
ItemIsElementalModifier,
|
||||
FilterTag,
|
||||
} from "../filters/interfaces";
|
||||
import { setProperty as propSet } from "dot-prop";
|
||||
import { DateTime } from "luxon";
|
||||
@@ -890,9 +891,6 @@ export function createTradeRequest(
|
||||
stats = stats.filter(
|
||||
(stat) => !INTERNAL_TRADE_IDS.includes(stat.tradeId[0] as any),
|
||||
);
|
||||
if (filters.veiled && !filters.veiled.disabled) {
|
||||
propSet(query.filters, "misc_filters.filters.veiled.option", String(true));
|
||||
}
|
||||
|
||||
// if (filters.influences) {
|
||||
// for (const influence of filters.influences) {
|
||||
@@ -943,6 +941,31 @@ export function createTradeRequest(
|
||||
}
|
||||
}
|
||||
|
||||
if (filters.veiled && !filters.veiled.disabled) {
|
||||
propSet(query.filters, "misc_filters.filters.veiled.option", String(true));
|
||||
const veiledCount = filters.veiled.veiledCount;
|
||||
|
||||
// HACK: add pseudo stat for veiled count(dont want on my ui though)
|
||||
qAnd.filters.push(
|
||||
tradeIdToQuery("pseudo.pseudo_number_of_unrevealed_mods", {
|
||||
tradeId: ["pseudo.pseudo_number_of_unrevealed_mods"],
|
||||
statRef: "# Unrevealed Modifiers",
|
||||
text: "Unrevealed Modifiers",
|
||||
tag: FilterTag.Pseudo,
|
||||
sources: [],
|
||||
roll: {
|
||||
value: veiledCount,
|
||||
min: veiledCount,
|
||||
max: undefined,
|
||||
default: { min: veiledCount, max: veiledCount },
|
||||
dp: false,
|
||||
isNegated: false,
|
||||
},
|
||||
disabled: false,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
return body;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user