Skip to content
5 changes: 5 additions & 0 deletions spec/System/TestImport_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ describe("TestImport", function()
typeLine = "Rawhide Gloves",
inventoryId = "Gloves",
ilvl = 10,
vestigial = true,
properties = { },
implicitMods = {
{ description = "+20 to maximum Life" },
Expand All @@ -86,6 +87,7 @@ describe("TestImport", function()
{ description = "+10 to maximum Life", flags = { crafted = true } },
{ description = "+11 to maximum Mana", flags = { fractured = true } },
{ description = "+12 to Strength", flags = { mutated = true } },
{ description = "+13 to Dexterity", flags = { vestigial = true } },
},
})

Expand All @@ -100,6 +102,9 @@ describe("TestImport", function()
assert.is_true(explicitMods["+10 to maximum Life"].crafted)
assert.is_true(explicitMods["+11 to maximum Mana"].fractured)
assert.is_true(explicitMods["+12 to Strength"].mutated)
assert.is_true(item.vestigial)
assert.is_true(explicitMods["+13 to Dexterity"].vestigial)
assert.is_truthy(item:BuildRaw():find("{vestigial}", 1, true))
end)

function importAndReimportWithOldJewel(shouldDelete)
Expand Down
2 changes: 2 additions & 0 deletions spec/System/TestItemParse_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,8 @@ describe("TestAdvancedItemParse #item", function()

assert.are.equals(70, item.memoryStrands)
assert.are.equals(1, #item.explicitModLines)
local _, memoryStrandsCount = item:BuildRaw():gsub("Memory Strands:", "")
assert.are.equals(1, memoryStrandsCount)

item:BuildAndParseRaw()
assert.are.equals(70, item.memoryStrands)
Expand Down
Binary file added src/Assets/intangibilitybg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/memorybg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/memoryicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/vestigialicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 18 additions & 11 deletions src/Classes/ImportTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ local ImportTabClass = newClass("ImportTab", "ControlHost", "Control", function(
end)
self.controls.enablePartyExportBuffs = new("CheckBoxControl", {"LEFT",self.controls.generateCode,"RIGHT"}, {100, 0, 18}, "Export Support", function(state)
self.build.partyTab.enableExportBuffs = state
self.build.buildFlag = true
self.build.buildFlag = true
end, "This is for party play, to export support character, it enables the exporting of auras, curses and modifiers to the enemy", false)
self.controls.generateCodeOut = new("EditControl", {"TOPLEFT",self.controls.generateCodeLabel,"BOTTOMLEFT"}, {0, 8, 250, 20}, "", "Code", "%Z")
self.controls.generateCodeOut.enabled = function()
Expand Down Expand Up @@ -726,7 +726,7 @@ local ImportTabClass = newClass("ImportTab", "ControlHost", "Control", function(
end
end)
end

end)

-- attempt to fetch the last realm's character list once per instance, if there
Expand Down Expand Up @@ -769,7 +769,7 @@ function ImportTabClass:Save(xml)
xml.attrib.importLink = self.build.importLink
end
-- Gets rid of erroneous, potentially infinitely nested full base64 XML stored as an import link
xml.attrib.importLink = (xml.attrib.importLink and xml.attrib.importLink:len() < 100) and xml.attrib.importLink or nil
xml.attrib.importLink = (xml.attrib.importLink and xml.attrib.importLink:len() < 100) and xml.attrib.importLink or nil
end

function ImportTabClass:Draw(viewPort, inputEvents)
Expand Down Expand Up @@ -1194,8 +1194,8 @@ function ImportTabClass:ImportPassiveTreeAndJewels(charData, deleteJewels)
local ruthlessSuffix = charData.league:match("Ruthless") and "_ruthless" or ""
local phreciaSuffix = isAscendancyInTree(charData.class, latestTreeVersion) and "" or "_alternate"
self.build.spec:ImportFromNodeList(charData.class,
nil,
nil,
nil,
nil,
alternateAscendancyId,
charPassives.hashes,
skillOverrides,
Expand All @@ -1213,14 +1213,14 @@ function ImportTabClass:ImportPassiveTreeAndJewels(charData, deleteJewels)
local resistancePenaltyIndex = 3
if self.build.Act then -- Estimate resistance penalty setting based on act progression estimate
if type(self.build.Act) == "string" and self.build.Act == "Endgame" then resistancePenaltyIndex = 3
elseif type(self.build.Act) == "number" then
elseif type(self.build.Act) == "number" then
if self.build.Act < 5 then resistancePenaltyIndex = 1
elseif self.build.Act > 5 and self.build.Act < 11 then resistancePenaltyIndex = 2
elseif self.build.Act > 10 then resistancePenaltyIndex = 3 end
end
end
self.build.configTab.varControls["resistancePenalty"]:SetSel(resistancePenaltyIndex)

local function setSelByVal(dropdown, val)
for i, v in ipairs(dropdown.list) do
if v.val == val then
Expand Down Expand Up @@ -1483,7 +1483,7 @@ function ImportTabClass:ImportItemsAndSkills(charData, clearItems, clearSkills,
end

local rarityMap = { [0] = "NORMAL", "MAGIC", "RARE", "UNIQUE", [9] = "RELIC", [10] = "RELIC" }
local slotMap = { ["Weapon"] = "Weapon 1", ["Offhand"] = "Weapon 2", ["Weapon2"] = "Weapon 1 Swap", ["Offhand2"] = "Weapon 2 Swap", ["Helm"] = "Helmet", ["BodyArmour"] = "Body Armour", ["Gloves"] = "Gloves", ["Boots"] = "Boots",
local slotMap = { ["Weapon"] = "Weapon 1", ["Offhand"] = "Weapon 2", ["Weapon2"] = "Weapon 1 Swap", ["Offhand2"] = "Weapon 2 Swap", ["Helm"] = "Helmet", ["BodyArmour"] = "Body Armour", ["Gloves"] = "Gloves", ["Boots"] = "Boots",
["Amulet"] = "Amulet", ["Ring"] = "Ring 1", ["Ring2"] = "Ring 2", ["Ring3"] = "Ring 3", ["Belt"] = "Belt", ["BrequelGrafts"] = "Graft 1", ["BrequelGrafts2"] = "Graft 2", }

function ImportTabClass:ImportItem(itemData, slotName, ignoreWeaponSwap, itemSetId)
Expand Down Expand Up @@ -1616,6 +1616,10 @@ function ImportTabClass:ImportItem(itemData, slotName, ignoreWeaponSwap, itemSet
item.baseName = "Two-Toned Boots (Evasion/Energy Shield)"
item.base = self.build.data.itemBases[item.baseName]
end
elseif property.name:find("Intangibility") then
item.intangibility = tonumber(property.values[1][1]:match("%d+"))
elseif property.name == "Memory Strands" then
item.memoryStrands = tonumber(property.values[1][1])
end
if property.name == "Energy Shield" or property.name == "Ward" or property.name == "Armour" or property.name == "Evasion Rating" then
item.armourData = item.armourData or { }
Expand All @@ -1630,6 +1634,7 @@ function ImportTabClass:ImportItem(itemData, slotName, ignoreWeaponSwap, itemSet
item.corrupted = itemData.corrupted
item.fractured = itemData.fractured
item.synthesised = itemData.synthesised
item.vestigial = itemData.vestigial
if itemData.sockets and itemData.sockets[1] then
item.sockets = { }
for i, socket in pairs(itemData.sockets) do
Expand Down Expand Up @@ -1681,9 +1686,10 @@ function ImportTabClass:ImportItem(itemData, slotName, ignoreWeaponSwap, itemSet
if itemData.implicitMods then
for _, itemMod in ipairs(itemData.implicitMods) do
local modLine = itemMod.description or itemMod
local flags = itemMod.flags or itemMod
for line in modLine:gmatch("[^\n]+") do
local modList, extra = modLib.parseMod(line)
t_insert(item.implicitModLines, { line = line, extra = extra, mods = modList or { } })
t_insert(item.implicitModLines, { line = line, extra = extra, mods = modList or { }, vestigial = flags.vestigial })
end
end
end
Expand All @@ -1705,7 +1711,8 @@ function ImportTabClass:ImportItem(itemData, slotName, ignoreWeaponSwap, itemSet
t_insert(item.explicitModLines, { line = line, extra = extra, mods = modList or { },
fractured = flags.fractured,
crafted = flags.crafted,
mutated = flags.mutated })
mutated = flags.mutated,
vestigial = flags.vestigial })
end
end
end
Expand Down Expand Up @@ -1817,7 +1824,7 @@ function ImportTabClass:ImportSocketedItems(item, socketedItems, slotName)
local normalizedBasename = sanitiseText(socketedItem.typeLine)
local gemId = self.build.data.gemForBaseName[normalizedBasename:lower()]
if socketedItem.hybrid then
-- Used by transfigured gems and dual-skill gems (currently just Stormbind)
-- Used by transfigured gems and dual-skill gems (currently just Stormbind)
normalizedBasename = sanitiseText(socketedItem.hybrid.baseTypeName)
gemId = self.build.data.gemForBaseName[normalizedBasename:lower()]
if gemId and socketedItem.hybrid.isVaalGem then
Expand Down
20 changes: 11 additions & 9 deletions src/Classes/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ local influenceInfo = itemLib.influenceInfo.all
local ItemClass = newClass("Item", function(self, raw, rarity, highQuality)
if raw then
self:ParseRaw(sanitiseText(raw), rarity, highQuality)
end
end
end)

-- Reset all influence keys to false
Expand Down Expand Up @@ -494,6 +494,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
self.requirements.int = 0
self.baseLines = { }
self.foulborn = false
self.vestigial = false
self.mutatedLines = nil
---@type RareLikeUniqueDescription?
self.rareLikeUnique = nil
Expand All @@ -506,7 +507,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
local linePrefix = ""
local linePostfix = ""

while self.rawLines[l] do
while self.rawLines[l] do
local line = self.rawLines[l]
if line == "Veiled Prefix" or line == "Veiled Suffix" then
self.veiled = true
Expand Down Expand Up @@ -823,8 +824,6 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
self.catalystQuality = specToNumber(specVal)
elseif specName == "Intangibility" then
self.intangibility = specToNumber(specVal)
elseif specName == "Memory Strands" then
-- ignored
elseif specName == "Note" then
self.note = specVal
elseif specName == "Str" or specName == "Strength" or specName == "Dex" or specName == "Dexterity" or
Expand Down Expand Up @@ -925,6 +924,9 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
modLine.crafted = true
modLine.implicit = true
end
if modLine.vestigial then
self.vestigial = true
end

local baseName
-- items containing (#-#) lines are marked since the values won't have catalyst or mod magnitudes applied
Expand Down Expand Up @@ -1433,7 +1435,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
end
self.affixLimit = 0
if self.crafted then
if not self.affixes then
if not self.affixes then
self.crafted = false
elseif self.rarity == "MAGIC" then
if self.prefixes.limit or self.suffixes.limit then
Expand Down Expand Up @@ -1646,7 +1648,7 @@ function ItemClass:NormaliseQuality()
elseif not self.uniqueID and not self.corrupted and not self.split and not self.mirrored and self.quality < 20 then
self.quality = 20
end
end
end
end

function ItemClass:GetModSpawnWeight(mod, includeTags, excludeTags, baseTags)
Expand Down Expand Up @@ -2059,7 +2061,7 @@ function ItemClass:Craft()
end
t_insert(self.explicitModLines, modLine)
statOrder[order] = modLine
end
end
end
end
end
Expand Down Expand Up @@ -2461,7 +2463,7 @@ function ItemClass:BuildModListForSlotNum(baseList, slotNum)
or ((jewelData.clusterJewelSkill or jewelData.clusterJewelSmallsAreNothingness) and jewelData.clusterJewelNodeCount)
or (jewelData.clusterJewelSocketCountOverride and jewelData.clusterJewelNothingnessCount)
end
end
end
return { unpack(modList) }
end

Expand Down Expand Up @@ -2595,7 +2597,7 @@ function ItemClass:BuildModList()
-- Force the socket count to be equal to the stated number
self.selectableSocketCount = socketCount
local group = 0
for i = 1, m_max(socketCount, #self.sockets) do
for i = 1, m_max(socketCount, #self.sockets) do
if i > socketCount then
self.sockets[i] = nil
elseif not self.sockets[i] then
Expand Down
Loading
Loading