Merge pull request #1037 from Kvan7:dev

v0.16.1
This commit is contained in:
Kvan7
2026-09-04 07:34:50 -05:00
committed by GitHub
8 changed files with 184 additions and 11 deletions
+2 -1
View File
@@ -58,6 +58,7 @@ body:
label: Version
description: What version of EE2 are you running? You can see this in Settings -> About
options:
- 0.16.1
- 0.16.0
- 0.15.8
- 0.15.7
@@ -69,7 +70,7 @@ body:
- 0.15.1
- 0.15.0
- Change me
default: 10
default: 11
validations:
required: true
- type: textarea
+1 -1
View File
@@ -1,6 +1,6 @@
# ![Perfect Jewelers Orb](./renderer/public/images/jeweler.png) Exiled Exchange 2
[![GitHub Downloads (specific asset, latest release)](https://img.shields.io/github/downloads/kvan7/exiled-exchange-2/latest/Exiled-Exchange-2-Setup-0.16.0.exe?style=plastic&link=https%3A%2F%2Ftooomm.github.io%2Fgithub-release-stats%2F%3Fusername%3Dkvan7%26repository%3DExiled-Exchange-2)](https://tooomm.github.io/github-release-stats/?username=kvan7&repository=Exiled-Exchange-2)
[![GitHub Downloads (specific asset, latest release)](https://img.shields.io/github/downloads/kvan7/exiled-exchange-2/latest/Exiled-Exchange-2-Setup-0.16.1.exe?style=plastic&link=https%3A%2F%2Ftooomm.github.io%2Fgithub-release-stats%2F%3Fusername%3Dkvan7%26repository%3DExiled-Exchange-2)](https://tooomm.github.io/github-release-stats/?username=kvan7&repository=Exiled-Exchange-2)
[![GitHub Tag](https://img.shields.io/github/v/tag/kvan7/exiled-exchange-2?style=plastic&label=latest%20version)](https://github.com/Kvan7/Exiled-Exchange-2/releases/latest)
[![GitHub commits since latest release (branch)](https://img.shields.io/github/commits-since/kvan7/exiled-exchange-2/latest/dev?style=plastic)](https://github.com/Kvan7/Exiled-Exchange-2/commits/dev/)
[![Translation status](https://translate.codeberg.org/widget/exiled-exchange-2/svg-badge.svg)](https://translate.codeberg.org/engage/exiled-exchange-2/)
+1 -1
View File
@@ -20,7 +20,7 @@ export default defineConfig({
},
themeConfig: {
// logo: 'TODO', https://github.com/vuejs/vitepress/issues/1401
appVersion: '0.16.0',
appVersion: '0.16.1',
github: {
releasesUrl: 'https://github.com/Kvan7/Exiled-Exchange-2/releases'
},
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "exiled-exchange-2",
"version": "0.16.0",
"version": "0.16.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "exiled-exchange-2",
"version": "0.16.0",
"version": "0.16.1",
"dependencies": {
"electron-overlay-window": "4.0.2",
"uiohook-napi": "1.5.x"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "exiled-exchange-2",
"version": "0.16.0",
"version": "0.16.1",
"private": true,
"scripts": {
"dev": "node build/script.mjs",
+167 -1
View File
@@ -1,7 +1,7 @@
import { init } from "@/assets/data";
import { ItemCategory } from "@/parser";
import { ParsedModifier } from "@/parser/advanced-mod-desc";
import { ModifierType } from "@/parser/modifiers";
import { ModifierType, StatCalculated } from "@/parser/modifiers";
import { __testExports } from "@/parser/Parser";
import { createTestItem, makeCalcStat } from "@specs/helper";
import { setupTests } from "@specs/vitest.setup";
@@ -42,6 +42,160 @@ describe("determineAugments", () => {
expect(result.map((augment) => augment.refName)).toEqual(expectedRef);
});
it("handles range mods correctly", () => {
const mod = {
info: {
type: "rune",
tags: [],
},
stats: [
{
stat: {
ref: "Adds # to # Lightning Damage",
better: 1,
matchers: [
{
string: "Adds # to # Lightning Damage",
},
],
trade: {
ids: {
explicit: ["explicit.stat_3336890334"],
fractured: ["fractured.stat_3336890334"],
enchant: ["enchant.stat_3336890334"],
rune: ["rune.stat_3336890334"],
desecrated: ["desecrated.stat_3336890334"],
crafted: ["crafted.stat_3336890334"],
},
},
id: "local_minimum_added_lightning_damage",
},
translation: {
string: "Adds # to # Lightning Damage",
},
roll: {
unscalable: false,
dp: false,
value: 15.5,
min: 15.5,
max: 15.5,
},
},
],
} as unknown as ParsedModifier;
const statCalcs = [
{
stat: {
ref: "Adds # to # Lightning Damage",
better: 1,
matchers: [
{
string: "Adds # to # Lightning Damage",
},
],
trade: {
ids: {
explicit: ["explicit.stat_3336890334"],
fractured: ["fractured.stat_3336890334"],
enchant: ["enchant.stat_3336890334"],
rune: ["rune.stat_3336890334"],
desecrated: ["desecrated.stat_3336890334"],
crafted: ["crafted.stat_3336890334"],
},
},
id: "local_minimum_added_lightning_damage",
},
type: "rune",
sources: [
{
modifier: {
info: {
type: "rune",
tags: [],
},
stats: [
{
stat: {
ref: "Adds # to # Lightning Damage",
better: 1,
matchers: [
{
string: "Adds # to # Lightning Damage",
},
],
trade: {
ids: {
explicit: ["explicit.stat_3336890334"],
fractured: ["fractured.stat_3336890334"],
enchant: ["enchant.stat_3336890334"],
rune: ["rune.stat_3336890334"],
desecrated: ["desecrated.stat_3336890334"],
crafted: ["crafted.stat_3336890334"],
},
},
id: "local_minimum_added_lightning_damage",
},
translation: {
string: "Adds # to # Lightning Damage",
},
roll: {
unscalable: false,
dp: false,
value: 15.5,
min: 15.5,
max: 15.5,
},
},
],
},
stat: {
stat: {
ref: "Adds # to # Lightning Damage",
better: 1,
matchers: [
{
string: "Adds # to # Lightning Damage",
},
],
trade: {
ids: {
explicit: ["explicit.stat_3336890334"],
fractured: ["fractured.stat_3336890334"],
enchant: ["enchant.stat_3336890334"],
rune: ["rune.stat_3336890334"],
desecrated: ["desecrated.stat_3336890334"],
crafted: ["crafted.stat_3336890334"],
},
},
id: "local_minimum_added_lightning_damage",
},
translation: {
string: "Adds # to # Lightning Damage",
},
roll: {
unscalable: false,
dp: false,
value: 15.5,
min: 15.5,
max: 15.5,
},
},
contributes: {
value: 15.5,
min: 15.5,
max: 15.5,
},
},
],
},
] as unknown as StatCalculated[];
const result = __testExports.determineAugments(mod, statCalcs);
expect(result).toHaveLength(1);
expect(result[0].refName).toEqual("Greater Storm Rune");
});
});
describe("BFS", () => {
@@ -73,6 +227,18 @@ describe("BFS", () => {
expect(result).toEqual(expected);
},
);
it("should not infinite loop", () => {
const result = __testExports.modifiedBfs(100, [], Array(100).fill(0));
expect(result).toHaveLength(0);
}, 50);
it("should not infinite loop2", () => {
const result = __testExports.modifiedBfs(15.5, [], Array(4).fill(1));
expect(result).toHaveLength(0);
}, 50);
});
describe("parseAugmentSockets", () => {
+6 -4
View File
@@ -44,7 +44,7 @@ import { calcPropPercentile, QUALITY_STATS } from "./calc-q20";
import { AppConfig } from "@/web/Config";
import { buildEditorItems, getSavedAugments } from "./augment-builder";
import { useAugment } from "@/web/price-check/item-editor/augment";
import { combinations } from "./utils";
import { avg, combinations } from "./utils";
type SectionParseResult =
| "SECTION_PARSED"
@@ -2116,6 +2116,7 @@ function modifiedBfs(
available: number[],
): number[] | null {
if (remaining === 0) return [...combo];
if (combo.length >= 7 || available.length > 8) return [];
let best: number[] | null = null;
for (const augValue of available) {
@@ -2209,7 +2210,7 @@ function determineAugments(
if (augment.values.length === 1) return augment.values[0];
// stats like "# to # added Lightning Damage"
if ((augment.baseStat.match(/#/) || []).length > 1) {
if ((augment.baseStat.match(/#/g) || []).length > 1) {
const sum = augment.values.reduce((a, b) => a + b, 0);
return sum / augment.values.length || 0;
}
@@ -2224,8 +2225,9 @@ function determineAugments(
modifiedBfs(augmentAppliedValue[0], [], availableAugmentValues) ?? [];
return likelyValues.map((v) => {
const augment = possibleAugments.find((aug) =>
aug.values.some((augVal) => augVal === v),
const augment = possibleAugments.find(
(aug) =>
aug.values.some((augVal) => augVal === v) || avg(aug.values) === v,
)!;
return ITEM_BY_REF("ITEM", augment.refName)![0];
});
+4
View File
@@ -4,3 +4,7 @@ export function combinations<T>(arr: T[]): T[][] {
[[]],
);
}
export function avg(arr: number[]): number {
return arr.reduce((a, b) => a + b, 0) / arr.length;
}