add is modifiable

This commit is contained in:
kvan7
2025-09-06 15:15:40 -05:00
parent 94aadc8a7f
commit 07a0840c79
9 changed files with 52 additions and 21 deletions

View File

@@ -19,6 +19,7 @@ import {
ParsedItem,
ItemInfluence,
ItemRarity,
itemIsModifiable,
} from "./ParsedItem";
import { magicBasetype } from "./magic-name";
import {
@@ -93,6 +94,7 @@ const parsers: Array<ParserFn | { virtual: VirtualParserFn }> = [
parseMirroredTablet,
parseFilledCoffin,
parseMirrored,
parseSanctified,
parseSentinelCharge,
parseLogbookArea,
parseLogbookArea,
@@ -626,7 +628,7 @@ function parseRuneSockets(section: string[], item: ParsedItem) {
if (section[0].startsWith(_$.SOCKETS)) {
const sockets = section[0].slice(_$.SOCKETS.length).trimEnd();
const current = sockets.split("S").length - 1;
if (item.isCorrupted) {
if (!itemIsModifiable(item)) {
item.runeSockets = {
empty: 0,
current,
@@ -642,7 +644,7 @@ function parseRuneSockets(section: string[], item: ParsedItem) {
return "SECTION_PARSED";
}
if (categoryMax && !item.isCorrupted) {
if (categoryMax && itemIsModifiable(item)) {
item.runeSockets = {
empty: categoryMax,
current: 0,
@@ -1077,6 +1079,16 @@ function parseMirrored(section: string[], item: ParsedItem) {
return "SECTION_SKIPPED";
}
function parseSanctified(section: string[], item: ParsedItem) {
if (section.length === 1) {
if (section[0] === _$.SANCTIFIED) {
item.isSanctified = true;
return "SECTION_PARSED";
}
}
return "SECTION_SKIPPED";
}
function parseFlask(section: string[], item: ParsedItem) {
// the purpose of this parser is to "consume" flask buffs
// so they are not recognized as modifiers