* Should empty rune sockets be disabled by default? #223

* fix table format (#216)

* Features/onlineFilterAlert #220 (#238)

* Add custom sort for ex/div ratio

* Add tooltip

* Adds warning banner

* done

* fix: added armour tag to focus (#241)

Co-authored-by: Your Name <your.email@example.com>

* Features/sockets (#244)

* Start of work to change items mods

* push stuff

* console

* kinda works?

* Works enough

* Fix unique ref name #232 #239

* Fix unique hiding mods

* enable unique by default

* Fix damage not always correctly selected

* add rune tag style, update warning banner

* update banner again

* fix note add auto fill

* fix quality

* Revert "fix note add auto fill"

This reverts commit 106e5a8978.

* fix config stuff

* version bump

* fix excess querys

* Fix empty runes and not fake
This commit is contained in:
Kvan7
2025-01-04 10:50:47 -06:00
committed by GitHub
parent 1afe3ebf0f
commit ad10eb5f64
33 changed files with 890 additions and 147 deletions

View File

@@ -889,7 +889,7 @@ Item Level: 39
*
*/
function parseModifiersPoe2(section: string[], item: ParsedItem) {
export function parseModifiersPoe2(section: string[], item: ParsedItem) {
if (
item.rarity !== ItemRarity.Normal &&
item.rarity !== ItemRarity.Magic &&
@@ -1011,10 +1011,16 @@ function applyRuneSockets(item: ParsedItem) {
if (potentialEmptySockets > 0) {
for (let i = 0; i < potentialEmptySockets; i++) {
item.runeSockets.runes.push({
index: i + runes.length,
isEmpty: true,
});
}
}
// reset indices just to be safe
for (let i = 0; i < item.runeSockets.runes.length; i++) {
item.runeSockets.runes[i].index = i;
}
}
}
@@ -1457,7 +1463,7 @@ function getMaxSockets(category: ItemCategory | undefined) {
}
}
function isArmourOrWeapon(
export function isArmourOrWeapon(
category: ItemCategory | undefined,
): "armour" | "weapon" | undefined {
switch (category) {
@@ -1466,6 +1472,7 @@ function isArmourOrWeapon(
case ItemCategory.Gloves:
case ItemCategory.Helmet:
case ItemCategory.Shield:
case ItemCategory.Focus:
return "armour";
case ItemCategory.OneHandedAxe:
case ItemCategory.OneHandedMace:
@@ -1499,12 +1506,13 @@ function statToRune(mod: ParsedModifier, statCalc: StatCalculated): Rune[] {
const totalRunes = Math.floor(runeAppliedValue / runeSingleValue);
// Get original mod ref text
const modRef = runeSingle.baseStat;
const modRef = replaceHashWithValues(runeSingle.baseStat, runeSingle.values);
// Return one rune for each rune in the item
const runes: Rune[] = [];
for (let i = 0; i < totalRunes; i++) {
runes.push({
index: i,
isEmpty: false,
rune: runeSingle.rune,
text: modRef,
@@ -1513,3 +1521,11 @@ function statToRune(mod: ParsedModifier, statCalc: StatCalculated): Rune[] {
return runes;
}
export function replaceHashWithValues(template: string, values: number[]) {
let result = template;
values.forEach((value: number) => {
result = result.replace("#", value.toString()); // Replace the first occurrence of #
});
return result;
}