From a0f234ba645269bdc112706711b3e6c277ec0f67 Mon Sep 17 00:00:00 2001 From: David Medgyesy Date: Fri, 27 Nov 2026 15:51:26 +0100 Subject: [PATCH 1/2] Recognise Twice Corrupted and tiered Unidentified item text Items corrupted a second time show "Twice Corrupted" and unidentified tiered items show "Unidentified (Tier N)" since 3.30. Treat the first as corrupted and keep the label on save, and skip both unidentified lines instead of reading them as mods. --- spec/System/TestItemParse_spec.lua | 110 +++++++++++++++++++++++++++++ src/Classes/CompareTab.lua | 2 +- src/Classes/Item.lua | 16 ++++- src/Classes/ItemsTab.lua | 2 +- 4 files changed, 126 insertions(+), 4 deletions(-) diff --git a/spec/System/TestItemParse_spec.lua b/spec/System/TestItemParse_spec.lua index 15df122391c..ed5ca65e520 100644 --- a/spec/System/TestItemParse_spec.lua +++ b/spec/System/TestItemParse_spec.lua @@ -607,6 +607,116 @@ Implicits: 1 assert.truthy(item.unreleased) end) + it("Twice Corrupted", function() + local item = new("Item"):Item([[ + Item Class: Body Armours + Rarity: Unique + Tabula Rasa + Simple Robe + -------- + Sockets: W-W-W-W-W-W + -------- + Item Level: 68 + -------- + Twice Corrupted + ]]) + assert.truthy(item.corrupted) + assert.truthy(item.twiceCorrupted) + assert.are.equals(0, #item.explicitModLines) + + item = new("Item"):Item([[ + Item Class: Rings + Rarity: Rare + Doom Loop + Two-Stone Ring + -------- + Item Level: 84 + -------- + +12% to Fire and Cold Resistances (implicit) + -------- + +40 to maximum Life + +30% to Fire Resistance + -------- + Twice Corrupted + ]]) + assert.truthy(item.corrupted) + assert.truthy(item.twiceCorrupted) + assert.are.equals(2, #item.explicitModLines) + + item = new("Item"):Item(item:BuildRaw()) + assert.truthy(item.corrupted) + assert.truthy(item.twiceCorrupted) + assert.are.equals(2, #item.explicitModLines) + + item = new("Item"):Item(raw("Corrupted")) + assert.truthy(item.corrupted) + assert.falsy(item.twiceCorrupted) + end) + + it("unidentified tiered items", function() + local item = new("Item"):Item([[ + Item Class: Rings + Rarity: Rare + Geodesic Ring + -------- + Item Level: 86 + -------- + { Implicit Modifier } + +1 Prefix Modifier allowed + -1 Suffix Modifier allowed + -------- + Unidentified (Tier 5) + ]]) + assert.are.equals("Geodesic Ring", item.baseName) + assert.are.equals(86, item.itemLevel) + assert.are.equals(2, #item.implicitModLines) + assert.are.equals(0, #item.explicitModLines) + item = new("Item"):Item(item:BuildRaw()) + assert.are.equals("Geodesic Ring", item.baseName) + assert.are.equals(0, #item.explicitModLines) + + item = new("Item"):Item([[ + Item Class: Boots + Rarity: Magic + Shagreen Boots + -------- + Evasion Rating: 186 + -------- + Requirements: + Level: 62 + Dex: 117 + -------- + Sockets: G-G + -------- + Item Level: 75 + -------- + Unidentified (Tier 4) + ]]) + assert.are.equals("Shagreen Boots", item.baseName) + assert.are.equals(0, #item.explicitModLines) + + -- Once identified the tier is no longer shown + item = new("Item"):Item([[ + Item Class: Boots + Rarity: Magic + Shagreen Boots of the Tempest + -------- + Evasion Rating: 186 + -------- + Requirements: + Level: 62 + Dex: 117 + -------- + Sockets: G-G + -------- + Item Level: 75 + -------- + +42% to Lightning Resistance + ]]) + assert.are.equals("Shagreen Boots", item.baseName) + assert.are.equals(1, #item.explicitModLines) + end) + it("long flags", function() local item = new("Item"):Item(raw("This item can be anointed by Cassia")) assert.truthy(item.canBeAnointed) diff --git a/src/Classes/CompareTab.lua b/src/Classes/CompareTab.lua index ad5a5dca697..bde431eff52 100644 --- a/src/Classes/CompareTab.lua +++ b/src/Classes/CompareTab.lua @@ -3651,7 +3651,7 @@ function CompareTabClass:DrawItemExpanded(item, x, startY, colWidth, otherModMap -- Corrupted/Split/Mirrored if item.corrupted then - emit(x, drawY, "LEFT", fontSize, "VAR", colorCodes.NEGATIVE .. "Corrupted") + emit(x, drawY, "LEFT", fontSize, "VAR", colorCodes.NEGATIVE .. (item.twiceCorrupted and "Twice Corrupted" or "Corrupted")) drawY = drawY + lineHeight end if item.split then diff --git a/src/Classes/Item.lua b/src/Classes/Item.lua index 01c44c0bb50..2f5ecced5e8 100644 --- a/src/Classes/Item.lua +++ b/src/Classes/Item.lua @@ -420,6 +420,11 @@ end ---@field variantGroupList table? ---@field modId string? +-- Game text for unidentified items. Since 3.30 a tiered item shows its tier, e.g. "Unidentified (Tier 5)" +local function isUnidentifiedLine(line) + return line == "Unidentified" or line:match("^Unidentified %(Tier %d+%)$") ~= nil +end + -- Parse raw item data and extract item name, base type, quality, and modifiers function ItemClass:ParseRaw(raw, rarity, highQuality) self.raw = raw @@ -475,7 +480,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) -- Determine if "Unidentified" item local unidentified = false for _, line in ipairs(self.rawLines) do - if line == "Unidentified" then + if isUnidentifiedLine(line) then unidentified = true break end @@ -559,6 +564,11 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) self.mirrored = true elseif line == "Corrupted" then self.corrupted = true + elseif line == "Twice Corrupted" then + self.corrupted = true + self.twiceCorrupted = true + elseif isUnidentifiedLine(line) then + -- Unidentified items have no modifiers to parse elseif line == "Fractured Item" then self.fractured = true elseif line == "Synthesised Item" then @@ -2066,7 +2076,9 @@ function ItemClass:BuildRaw() if self.fractured then t_insert(rawLines, "Fractured Item") end - if self.corrupted or self.scourge then + if self.twiceCorrupted then + t_insert(rawLines, "Twice Corrupted") + elseif self.corrupted or self.scourge then t_insert(rawLines, "Corrupted") end if self.foilType then diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index 4c40b333e4a..fdfd4d8a51b 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -4711,7 +4711,7 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode, maxWidth) tooltip:AddLine(fontSizeBig, colorCodes.NEGATIVE.."Mirrored", "FONTIN SC") end if item.corrupted then - tooltip:AddLine(fontSizeBig, colorCodes.NEGATIVE.."Corrupted", "FONTIN SC") + tooltip:AddLine(fontSizeBig, colorCodes.NEGATIVE..(item.twiceCorrupted and "Twice Corrupted" or "Corrupted"), "FONTIN SC") end tooltip:AddSeparator(14) end From 2db9b96ddf68495859f4277af47820602b5e5285 Mon Sep 17 00:00:00 2001 From: David Medgyesy Date: Fri, 27 Nov 2026 16:59:48 +0100 Subject: [PATCH 2/2] Recognise Fated item names on import Since 3.30 an unidentified rare dropped by a Fate-empowered boss shows "Fated " before its base name (client string "Fated {0}"), so the base was not found and the pasted item was rejected. Strip the label when resolving the base, like Superior, Synthesised and Vestigial. --- spec/System/TestItemParse_spec.lua | 91 ++++++++++++++++++++++++++++++ src/Classes/Item.lua | 3 +- 2 files changed, 93 insertions(+), 1 deletion(-) diff --git a/spec/System/TestItemParse_spec.lua b/spec/System/TestItemParse_spec.lua index ed5ca65e520..0c653023db2 100644 --- a/spec/System/TestItemParse_spec.lua +++ b/spec/System/TestItemParse_spec.lua @@ -717,6 +717,97 @@ Implicits: 1 assert.are.equals(1, #item.explicitModLines) end) + it("Fated items", function() + -- Copied in 3.30.0.4: unidentified rares from Fate-empowered bosses show "Fated " before the base name + local item = new("Item"):Item([[ + Item Class: Rings + Rarity: Rare + Fated Geodesic Ring + -------- + Item Level: 86 + -------- + { Implicit Modifier } + +1 Prefix Modifier allowed + -1 Suffix Modifier allowed + Implicit Modifiers Cannot Be Changed — Unscalable Value + 25% increased Prefix Modifier magnitudes — Unscalable Value + -------- + Unidentified (Tier 5) + ]]) + assert.are.equals("Geodesic Ring", item.baseName) + assert.are.equals("Ring", item.type) + assert.are.equals("Fated Geodesic Ring", item.title) + assert.are.equals(86, item.itemLevel) + assert.are.equals(4, #item.implicitModLines) + assert.are.equals(0, #item.explicitModLines) + item = new("Item"):Item(item:BuildRaw()) + assert.are.equals("Geodesic Ring", item.baseName) + assert.are.equals("Fated Geodesic Ring", item.title) + assert.are.equals(4, #item.implicitModLines) + assert.are.equals(0, #item.explicitModLines) + + -- With quality + for _, name in ipairs({ "Superior Fated Astral Plate", "Fated Superior Astral Plate" }) do + item = new("Item"):Item(([[ + Item Class: Body Armours + Rarity: Rare + %s + -------- + Quality: +12% (augmented) + Armour: 797 (augmented) + -------- + Item Level: 84 + -------- + Unidentified (Tier 3) + ]]):gsub("%%s", name)) + assert.are.equals("Astral Plate", item.baseName) + assert.are.equals(12, item.quality) + item = new("Item"):Item(item:BuildRaw()) + assert.are.equals("Astral Plate", item.baseName) + assert.are.equals(12, item.quality) + end + + -- Base name on its own line below a rare name + item = new("Item"):Item([[ + Item Class: Rings + Rarity: Rare + Vengeance Band + Fated Geodesic Ring + -------- + Item Level: 80 + -------- + +40 to maximum Life + ]]) + assert.are.equals("Geodesic Ring", item.baseName) + assert.are.equals("Vengeance Band", item.title) + assert.are.equals(1, #item.explicitModLines) + + -- Magic and normal items keep the label as a name prefix + item = new("Item"):Item([[ + Item Class: Rings + Rarity: Magic + Fated Geodesic Ring + -------- + Item Level: 86 + -------- + Unidentified (Tier 2) + ]]) + assert.are.equals("Geodesic Ring", item.baseName) + assert.are.equals("Fated ", item.namePrefix) + item = new("Item"):Item(item:BuildRaw()) + assert.are.equals("Geodesic Ring", item.baseName) + assert.are.equals("Fated ", item.namePrefix) + + -- A unique whose name starts with the same word is left alone + item = new("Item"):Item([[ + Rarity: Unique + Fated End + Paua Ring + ]]) + assert.are.equals("Fated End", item.title) + assert.are.equals("Paua Ring", item.baseName) + end) + it("long flags", function() local item = new("Item"):Item(raw("This item can be anointed by Cassia")) assert.truthy(item.canBeAnointed) diff --git a/src/Classes/Item.lua b/src/Classes/Item.lua index 2f5ecced5e8..2837c097111 100644 --- a/src/Classes/Item.lua +++ b/src/Classes/Item.lua @@ -1015,7 +1015,8 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) self.name = self.name:gsub(" %(.+%)","") end if not baseName then - baseName = line:gsub("^Superior ", ""):gsub("^Synthesised ", ""):gsub("^Vestigial ", "") + -- "Fated" is the 3.30 label on unidentified rares dropped by Fate-empowered bosses + baseName = line:gsub("^Fated ", ""):gsub("^Superior ", ""):gsub("^Fated ", ""):gsub("^Synthesised ", ""):gsub("^Vestigial ", "") end if baseName == "Two-Toned Boots" then baseName = "Two-Toned Boots (Armour/Energy Shield)"