From 279138d830b9e6e9baf8a67daca006bcd2470765 Mon Sep 17 00:00:00 2001 From: kvan7 Date: Fri, 31 Jan 2025 18:44:21 -0600 Subject: [PATCH] [Not Recognized Modifier] - Quality (Attribute Modifiers): +20% (augmented) #186 --- renderer/src/parser/Parser.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/renderer/src/parser/Parser.ts b/renderer/src/parser/Parser.ts index 847e5ed9..baf1e174 100644 --- a/renderer/src/parser/Parser.ts +++ b/renderer/src/parser/Parser.ts @@ -70,6 +70,7 @@ const parsers: Array = [ parseArmour, parseWeapon, parseFlask, + parseJewelery, parseCharmSlots, parseSpirit, parsePriceNote, @@ -1068,6 +1069,24 @@ function parseFlask(section: string[], item: ParsedItem) { return isParsed; } +function parseJewelery(section: string[], item: ParsedItem) { + if ( + item.category !== ItemCategory.Amulet && + item.category !== ItemCategory.Ring && + item.category !== ItemCategory.Belt + ) { + return "PARSER_SKIPPED"; + } + + for (const line of section) { + if (line.startsWith(_$.QUALITY.substring(0, _$.QUALITY.indexOf(":")))) { + return "SECTION_PARSED"; + } + } + + return "SECTION_SKIPPED"; +} + function parseCharmSlots(section: string[], item: ParsedItem) { // the purpose of this parser is to "consume" charm slot 1 sections // so they are not recognized as modifiers