diff --git a/src/Classes/GemSelectControl.lua b/src/Classes/GemSelectControl.lua index 66834b7d2..80d686e17 100644 --- a/src/Classes/GemSelectControl.lua +++ b/src/Classes/GemSelectControl.lua @@ -462,7 +462,9 @@ function GemSelectClass:Draw(viewPort, noTooltip) nameSpec = gemData.name, skillId = gemData.grantedEffectId, displayEffect = nil, - gemData = gemData + gemData = gemData, + corruptLevel = 0, + corrupted = false, } self:AddGemTooltip(gemInstance) self.tooltip:AddSeparator(10) @@ -600,11 +602,30 @@ function GemSelectClass:AddGrantedEffectInfo(gemInstance, grantedEffect, addReq) self.tooltip:AddLine(fontSizeBig, string.format("^x7F7F7FTier: ^7%d", gemInstance.gemData.Tier), "FONTIN SC") end if addReq and not grantedEffect.support then - self.tooltip:AddLine(fontSizeBig, string.format("^x7F7F7FLevel: ^7%d%s%s", - gemInstance.level, - ((displayInstance.level > gemInstance.level) and " (" .. colorCodes.MAGIC .. "+" .. (displayInstance.level - gemInstance.level) .. "^7)") or ((displayInstance.level < gemInstance.level) and " (" .. colorCodes.WARNING .. "-" .. (gemInstance.level - displayInstance.level) .. "^7)") or "", - (gemInstance.level >= gemInstance.gemData.naturalMaxLevel) and " (Max)" or "" - ),"FONTIN SC") + local totalLevel + totalLevel = displayInstance.level + if displayInstance.corruptLevel ~= 0 or + (displayInstance.gemPropertyInfo and displayInstance.gemPropertyInfo[1].value.value > 0 ) or + (displayInstance.level - gemInstance.level - displayInstance.corruptLevel > 0) + then + self.tooltip:AddLine(fontSizeBig, string.format("^x7F7F7FLevel: ^7" .. colorCodes.MAGIC .. totalLevel), "FONTIN SC") + self.tooltip:AddLine(fontSizeBig, "^7" .. gemInstance.level .. " Levels from Gem" .. ((gemInstance.level >= gemInstance.gemData.naturalMaxLevel) and " (Max)" or ""), "FONTIN SC") + else + self.tooltip:AddLine(fontSizeBig, string.format("^x7F7F7FLevel: ^7" .. totalLevel .. ((gemInstance.level >= gemInstance.gemData.naturalMaxLevel) and " (Max)" or "")), "FONTIN SC") + end + if displayInstance.corruptLevel > 0 then + self.tooltip:AddLine(fontSizeBig, colorCodes.MAGIC .. "+" .. displayInstance.corruptLevel .. " Level from Corruption", "FONTIN SC") + elseif displayInstance.corruptLevel < 0 then + self.tooltip:AddLine(fontSizeBig, colorCodes.MAGIC .. displayInstance.corruptLevel .. " Level from Corruption", "FONTIN SC") + end + if displayInstance.gemPropertyInfo and displayInstance.gemPropertyInfo[1].value.value > 0 then + self.tooltip:AddLine(fontSizeBig, colorCodes.MAGIC .. "+" .. displayInstance.gemPropertyInfo[1].value.value .. " Levels from Global Modifiers", "FONTIN SC") + if displayInstance.level - gemInstance.level - displayInstance.corruptLevel - displayInstance.gemPropertyInfo[1].value.value > 0 then + self.tooltip:AddLine(fontSizeBig, colorCodes.MAGIC .. "+" .. displayInstance.level - gemInstance.level - displayInstance.corruptLevel - displayInstance.gemPropertyInfo[1].value.value .. " Levels from Supports", "FONTIN SC") + end + elseif displayInstance.level - gemInstance.level - displayInstance.corruptLevel > 0 then + self.tooltip:AddLine(fontSizeBig, colorCodes.MAGIC .. "+" .. displayInstance.level - gemInstance.level - displayInstance.corruptLevel .. " Levels from Supports", "FONTIN SC") + end end if grantedEffect.support then if grantedEffectLevel.manaMultiplier and grantedEffectLevel.reservationMultiplier and grantedEffectLevel.manaMultiplier == grantedEffectLevel.reservationMultiplier then @@ -707,6 +728,10 @@ function GemSelectClass:AddGrantedEffectInfo(gemInstance, grantedEffect, addReq) for _, line in ipairs(wrap) do self.tooltip:AddLine(fontSizeBig, colorCodes.GEMDESCRIPTION..line, "FONTIN ITALIC") end + if displayInstance.corrupted == true then + self.tooltip:AddSeparator(10) + self.tooltip:AddLine(fontSizeBig, colorCodes.NEGATIVE .. "Corrupted", "FONTIN SC") + end end end function GemSelectClass:AddStatSetInfo(gemInstance, grantedEffect, statSet, noLabel, index) diff --git a/src/Classes/ImportTab.lua b/src/Classes/ImportTab.lua index ef26f786b..25c0a6f31 100644 --- a/src/Classes/ImportTab.lua +++ b/src/Classes/ImportTab.lua @@ -775,6 +775,7 @@ function ImportTabClass:ImportItemsAndSkills(charData) if gemId then local gemInstance = { level = 20, quality = 0, enabled = true, enableGlobal1 = true, enableGlobal2 = true, count = 1, gemId = gemId } gemInstance.support = skillData.support + gemInstance.corrupted = skillData.corrupted local spectreList = data.spectres if typeLine:sub(1, 8) == "Spectre:" then @@ -830,8 +831,10 @@ function ImportTabClass:ImportItemsAndSkills(charData) else gemInstance.level = tonumber(property.values[1][1]:match("%d+")) end - if skillData.properties[_ + 2] and skillData.properties[_ + 2].values[1][1]:match("(%d+) Level[s]? from Corruption") then - gemInstance.level = gemInstance.level + tonumber(skillData.properties[_ + 2].values[1][1]:match("(%d+) Level[s]? from Corruption")) + if skillData.properties[_ + 2] and skillData.properties[_ + 2].values[1][1]:match("(-?%d+) Level[s]? from Corruption") then + gemInstance.corruptLevel = tonumber(skillData.properties[_ + 2].values[1][1]:match("(-?%d+) Level[s]? from Corruption")) + else + gemInstance.corruptLevel = 0 end elseif escapeGGGString(property.name) == "Quality" then gemInstance.quality = tonumber(property.values[1][1]:match("%d+")) diff --git a/src/Classes/SkillsTab.lua b/src/Classes/SkillsTab.lua index 5d203a27a..f0b10ec65 100644 --- a/src/Classes/SkillsTab.lua +++ b/src/Classes/SkillsTab.lua @@ -58,6 +58,13 @@ local showSupportGemTypeList = { { label = "Awakened", show = "AWAKENED" }, } +local corruptOption = { + { label = "Not Corrupted", level = 0 }, + { label = "+1 to Gem Level", level = 1 }, + { label = "Corrupted", level = 0 }, + { label = "-1 to Gem Level", level = -1 }, +} + local sortGemTypeList = { { label = "Full DPS", type = "FullDPS" }, { label = "Combined DPS", type = "CombinedDPS" }, @@ -260,10 +267,23 @@ will automatically apply to the skill.]] self.controls.gemNameHeader = new("LabelControl", {"BOTTOMLEFT", self.gemSlots[1].nameSpec, "TOPLEFT"}, {0, -2, 0, 16}, "^7Gem name:") self.controls.gemLevelHeader = new("LabelControl", {"BOTTOMLEFT", self.gemSlots[1].level, "TOPLEFT"}, {0, -2, 0, 16}, "^7Level:") self.controls.gemQualityHeader = new("LabelControl", {"BOTTOMLEFT", self.gemSlots[1].quality, "TOPLEFT"}, {0, -2, 0, 16}, "^7Quality:") + self.controls.gemCorruptHeader = new("LabelControl", {"BOTTOMLEFT", self.gemSlots[1].corruptLevel, "TOPLEFT"}, {0, -2, 0, 16}, "^7Corrupt:") self.controls.gemEnableHeader = new("LabelControl", {"BOTTOMLEFT", self.gemSlots[1].enabled, "TOPLEFT"}, {-16, -2, 0, 16}, "^7Enabled:") self.controls.gemCountHeader = new("LabelControl", {"BOTTOMLEFT", self.gemSlots[1].count, "TOPLEFT"}, {8, -2, 0, 16}, "^7Count:") end) +function SkillsTabClass:GetCorruptIndex(gemInstance) + if gemInstance.corruptLevel == 1 then + return 2 -- +1 to Gem Level + elseif gemInstance.corruptLevel == -1 then + return 4 -- -1 to Gem Level + elseif gemInstance.corrupted == true then + return 3 -- Corrupted + else + return 1 -- Not Corrupted + end +end + function SkillsTabClass:LoadSkill(node, skillSetId) if node.elem ~= "Skill" then return @@ -333,6 +353,8 @@ function SkillsTabClass:LoadSkill(node, skillSetId) gemInstance.skillMinionItemSetCalcs = tonumber(child.attrib.skillMinionItemSetCalcs) gemInstance.skillMinionSkill = tonumber(child.attrib.skillMinionSkill) gemInstance.skillMinionSkillCalcs = tonumber(child.attrib.skillMinionSkillCalcs) + gemInstance.corrupted = child.attrib.corrupted == "true" + gemInstance.corruptLevel = tonumber(child.attrib.corruptLevel) gemInstance.statSet = { } gemInstance.statSetCalcs = { } gemInstance.skillMinionSkillStatSetIndexLookup = { } @@ -461,6 +483,8 @@ function SkillsTabClass:Save(xml) skillMinionItemSetCalcs = gemInstance.skillMinionItemSetCalcs and tostring(gemInstance.skillMinionItemSetCalcs), skillMinionSkill = gemInstance.skillMinionSkill and tostring(gemInstance.skillMinionSkill), skillMinionSkillCalcs = gemInstance.skillMinionSkillCalcs and tostring(gemInstance.skillMinionSkillCalcs), + corrupted = tostring(gemInstance.corrupted), + corruptLevel = tostring(gemInstance.corruptLevel), } } if gemInstance.statSet then for grantedEffect, index in pairs(gemInstance.statSet) do @@ -575,8 +599,15 @@ function SkillsTabClass:CopySocketGroup(socketGroup) skillText = skillText .. "Slot: " .. socketGroup.slot .. "\r\n" end for _, gemInstance in ipairs(socketGroup.gemList) do - skillText = skillText .. string.format("%s %d/%d %s %d\r\n", gemInstance.nameSpec, gemInstance.level, gemInstance.quality, gemInstance.enabled and "" or "DISABLED", gemInstance.count or 1) - end + skillText = skillText .. string.format( + "%s %d/%d %s %d%s\r\n", + gemInstance.nameSpec, + gemInstance.level, + gemInstance.quality, + gemInstance.enabled and "" or "DISABLED", + gemInstance.count or 1, + gemInstance.corrupted and (" C" .. ((gemInstance.corruptLevel or 0) ~= 0 and ((gemInstance.corruptLevel > 0 and "+" or "") .. gemInstance.corruptLevel) or "")) or "" + ) end Copy(skillText) end @@ -592,15 +623,50 @@ function SkillsTabClass:PasteSocketGroup(testInput) if slot then newGroup.slot = slot end - for nameSpec, level, quality, state, count in skillText:gmatch("([ %a']+) (%d+)/(%d+) ?(%a*) (%d+)") do + for nameSpec, level, quality, state, count, cFlag, cLevel in + skillText:gmatch("([ %a':]+) (%d+)/(%d+) ?(%a*) (%d+) ?(C?)([+-]?%d*)") + do + local skillMinion = nil + local skillMinionCalcs = nil + local minionName = nil + local minionList = nil + + if nameSpec:find("Spectre") then + minionName = nameSpec:match(": (.+)") + nameSpec = "Summon Spectre" + minionList = self.build.spectreList + elseif nameSpec:find("Companion") then + minionName = nameSpec:match(": (.+)") + nameSpec = "Tamed Companion" + minionList = self.build.beastList + end + + -- Search for the minion if we found a spectre or companion + if minionName then + for id, spectre in pairs(data.spectres) do + if spectre.name == minionName then + if not isValueInArray(minionList, id) then + t_insert(minionList, id) + end + skillMinion = id + skillMinionCalcs = id + break + end + end + end + t_insert(newGroup.gemList, { nameSpec = nameSpec, level = tonumber(level) or 20, quality = tonumber(quality) or 0, enabled = state ~= "DISABLED", count = tonumber(count) or 1, + corrupted = cFlag == "C", + corruptLevel = tonumber(cLevel) or 0, enableGlobal1 = true, - enableGlobal2 = true + enableGlobal2 = true, + skillMinion = skillMinion, + skillMinionCalcs = skillMinionCalcs }) end if #newGroup.gemList > 0 then @@ -632,6 +698,7 @@ function SkillsTabClass:CreateGemSlot(index) self.gemSlots[index2].enableGlobal1.state = gemInstance.enableGlobal1 self.gemSlots[index2].enableGlobal2.state = gemInstance.enableGlobal2 self.gemSlots[index2].count:SetText(gemInstance.count or 1) + self.gemSlots[index2].corruptLevel.selIndex = self:GetCorruptIndex(gemInstance) end self:AddUndoState() self.build.buildFlag = true @@ -671,11 +738,14 @@ function SkillsTabClass:CreateGemSlot(index) enableGlobal1 = true, enableGlobal2 = true, count = 1, - new = true + new = true, + corrupted = false, + corruptLevel = 0, } self.displayGroup.gemList[index] = gemInstance slot.level:SetText(gemInstance.level) slot.quality:SetText(gemInstance.quality) + slot.corruptLevel.selIndex = self:GetCorruptIndex(gemInstance) slot.enabled.state = true slot.enableGlobal1.state = true slot.enableGlobal2.state = true @@ -707,12 +777,13 @@ function SkillsTabClass:CreateGemSlot(index) slot.level = new("EditControl", { "LEFT", slot.nameSpec, "RIGHT" }, { 2, 0, 60, 20 }, nil, nil, "%D", 2, function(buf) local gemInstance = self.displayGroup.gemList[index] if not gemInstance then - gemInstance = { nameSpec = "", level = self.defaultGemLevel or 20, quality = self.defaultGemQuality or 0, enabled = true, enableGlobal1 = true, enableGlobal2 = true, count = 1, new = true } + gemInstance = { nameSpec = "", level = self.defaultGemLevel or 20, quality = self.defaultGemQuality or 0, enabled = true, enableGlobal1 = true, enableGlobal2 = true, count = 1, new = true, corruptLevel = 0, corrupted = false } self.displayGroup.gemList[index] = gemInstance slot.quality:SetText(gemInstance.quality) slot.enabled.state = true slot.enableGlobal1.state = true slot.count:SetText(gemInstance.count) + slot.corruptLevel = self:GetCorruptIndex(gemInstance) end gemInstance.level = tonumber(buf) or self.displayGroup.gemList[index].naturalMaxLevel or self:ProcessGemLevel(gemInstance.gemData) or 20 self:ProcessSocketGroup(self.displayGroup) @@ -729,12 +800,13 @@ function SkillsTabClass:CreateGemSlot(index) slot.quality = new("EditControl", {"LEFT",slot.level,"RIGHT"}, {2, 0, 60, 20}, nil, nil, "%D", 2, function(buf) local gemInstance = self.displayGroup.gemList[index] if not gemInstance then - gemInstance = { nameSpec = "", level = self.defaultGemLevel or 20, quality = self.defaultGemQuality or 0, enabled = true, enableGlobal1 = true, enableGlobal2 = true, count = 1, new = true } + gemInstance = { nameSpec = "", level = self.defaultGemLevel or 20, quality = self.defaultGemQuality or 0, enabled = true, enableGlobal1 = true, enableGlobal2 = true, count = 1, new = true, corruptLevel = 0, corrupted = false } self.displayGroup.gemList[index] = gemInstance slot.level:SetText(gemInstance.level) slot.enabled.state = true slot.enableGlobal1.state = true slot.count:SetText(gemInstance.count) + slot.corruptLevel = self:GetCorruptIndex(gemInstance) end gemInstance.quality = tonumber(buf) or self.defaultGemQuality or 0 self:ProcessSocketGroup(self.displayGroup) @@ -824,11 +896,12 @@ function SkillsTabClass:CreateGemSlot(index) slot.enabled = new("CheckBoxControl", {"LEFT",slot.quality,"RIGHT"}, {18, 0, 20}, nil, function(state) local gemInstance = self.displayGroup.gemList[index] if not gemInstance then - gemInstance = { nameSpec = "", level = self.defaultGemLevel or 20, quality = self.defaultGemQuality or 0, enabled = true, enableGlobal1 = true, enableGlobal2 = true, count = 1, new = true } + gemInstance = { nameSpec = "", level = self.defaultGemLevel or 20, quality = self.defaultGemQuality or 0, enabled = true, enableGlobal1 = true, enableGlobal2 = true, count = 1, new = true, corruptLevel = 0, corrupted = false } self.displayGroup.gemList[index] = gemInstance slot.level:SetText(gemInstance.level) slot.quality:SetText(gemInstance.quality) slot.count:SetText(gemInstance.count) + slot.corruptLevel = self:GetCorruptIndex(gemInstance) end if not gemInstance.gemData.vaalGem then slot.enableGlobal1.state = true @@ -863,12 +936,13 @@ function SkillsTabClass:CreateGemSlot(index) slot.count = new("EditControl", {"LEFT",slot.enabled,"RIGHT"}, {18, 0, 60, 20}, nil, nil, "%D", 2, function(buf) local gemInstance = self.displayGroup.gemList[index] if not gemInstance then - gemInstance = { nameSpec = "", level = self.defaultGemLevel or 20, quality = self.defaultGemQuality or 0, enabled = true, enableGlobal1 = true, count = 1, new = true } + gemInstance = { nameSpec = "", level = self.defaultGemLevel or 20, quality = self.defaultGemQuality or 0, enabled = true, enableGlobal1 = true, count = 1, new = true, corruptLevel = 0, corrupted = false } self.displayGroup.gemList[index] = gemInstance slot.level:SetText(gemInstance.level) slot.quality:SetText(gemInstance.quality) slot.enabled.state = true slot.enableGlobal1.state = true + slot.corruptLevel = self:GetCorruptIndex(gemInstance) end gemInstance.count = tonumber(buf) or 1 slot.count.buf = tostring(gemInstance.count) @@ -900,6 +974,43 @@ function SkillsTabClass:CreateGemSlot(index) end self.controls["gemSlot"..index.."Count"] = slot.count + slot.corruptLevel = new("DropDownControl", {"LEFT",slot.count,"RIGHT"}, {18, 0, 140, 20}, corruptOption, function(indexSel, value) + local gemInstance = self.displayGroup.gemList[index] + if not gemInstance then + gemInstance = { nameSpec = "", level = 20, quality = 0, enabled = true, enableGlobal1 = true, count = 1, new = true, corruptLevel = 0, corrupted = false } + self.displayGroup.gemList[index] = gemInstance + slot.level:SetText(gemInstance.level) + slot.quality:SetText(gemInstance.quality) + slot.enabled.state = true + slot.enableGlobal1.state = true + end + gemInstance.corruptLevel = value.level + gemInstance.corrupted = (value.label ~= "Not Corrupted") + slot.corruptLevel.selIndex = indexSel + self:ProcessSocketGroup(self.displayGroup) + self:AddUndoState() + self.build.buildFlag = true + end) + + slot.corruptLevel.shown = function() + local gemInstance = self.displayGroup and self.displayGroup.gemList[index] + if gemInstance then + local grantedEffectList = gemInstance.gemData and gemInstance.gemData.grantedEffectList or { gemInstance.grantedEffect } + for index, grantedEffect in ipairs(grantedEffectList) do + if not grantedEffect.support and not grantedEffect.unsupported and (not grantedEffect.hasGlobalEffect or gemInstance["enableGlobal"..index]) then + return true + end + end + end + return false + end + + slot.corruptLevel.enabled = function() + return index <= #self.displayGroup.gemList + end + + self.controls["gemSlot"..index.."CorruptLevel"] = slot.corruptLevel + -- Parser/calculator error message slot.errMsg = new("LabelControl", {"LEFT",slot.count,"RIGHT"}, {2, 2, 0, 16}, function() local gemInstance = self.displayGroup and self.displayGroup.gemList[index] @@ -962,6 +1073,7 @@ function SkillsTabClass:UpdateGemSlots() slot.quality:SetText("") slot.enabled.state = false slot.count:SetText(1) + slot.corruptLevel.selIndex = 1 else slot.nameSpec.inactiveCol = self.displayGroup.gemList[slotIndex].color end @@ -1133,6 +1245,7 @@ function SkillsTabClass:SetDisplayGroup(socketGroup) self.gemSlots[index].enableGlobal1.state = gemInstance.enableGlobal1 self.gemSlots[index].enableGlobal2.state = gemInstance.enableGlobal2 self.gemSlots[index].count:SetText(gemInstance.count or 1) + self.gemSlots[index].corruptLevel.selIndex = self:GetCorruptIndex(gemInstance) end end end @@ -1159,13 +1272,14 @@ function SkillsTabClass:AddSocketGroupTooltip(tooltip, socketGroup) end tooltip:AddLine(16, "^7Active Skill #"..index..":") for _, skillEffect in ipairs(activeSkill.effectList) do - tooltip:AddLine(20, string.format("%s%s ^7%d%s/%d%s", + tooltip:AddLine(20, string.format("%s%s ^7%d%s/%d%s%s", data.skillColorMap[skillEffect.grantedEffect.color or skillEffect.gemData and skillEffect.gemData.grantedEffect.color], skillEffect.srcInstance.nameSpec or skillEffect.grantedEffect.name, skillEffect.srcInstance and skillEffect.srcInstance.level or skillEffect.level, (skillEffect.srcInstance and skillEffect.level > skillEffect.srcInstance.level) and colorCodes.MAGIC.."+"..(skillEffect.level - skillEffect.srcInstance.level).."^7" or "", skillEffect.srcInstance and skillEffect.srcInstance.quality or skillEffect.quality, - (skillEffect.srcInstance and skillEffect.quality > skillEffect.srcInstance.quality) and colorCodes.MAGIC.."+"..(skillEffect.quality - skillEffect.srcInstance.quality).."^7" or "" + (skillEffect.srcInstance and skillEffect.quality > skillEffect.srcInstance.quality) and colorCodes.MAGIC.."+"..(skillEffect.quality - skillEffect.srcInstance.quality).."^7" or "", + (skillEffect.srcInstance and skillEffect.srcInstance.corrupted == true) and (colorCodes.NEGATIVE.." C"..((skillEffect.srcInstance.corruptLevel or 0) ~= 0 and ((skillEffect.srcInstance.corruptLevel > 0 and "+" or "")..skillEffect.srcInstance.corruptLevel) or "")) or "" )) if skillEffect.srcInstance then gemShown[skillEffect.srcInstance] = true diff --git a/src/Modules/CalcActiveSkill.lua b/src/Modules/CalcActiveSkill.lua index dd999c834..8c9ac5650 100644 --- a/src/Modules/CalcActiveSkill.lua +++ b/src/Modules/CalcActiveSkill.lua @@ -636,6 +636,10 @@ function calcs.buildActiveSkillModList(env, activeSkill) -- Apply gem/quality modifiers from support gems skillModList:NewMod("GemLevel", "BASE", activeSkill.activeEffect.srcInstance and activeSkill.activeEffect.srcInstance.level or activeSkill.activeEffect.level, "Max Level") + if activeSkill.activeEffect.srcInstance and activeSkill.activeEffect.srcInstance.corruptLevel then + skillModList:NewMod("GemCorruptionLevel", "BASE", activeSkill.activeEffect.srcInstance.corruptLevel, "Corruption") + activeSkill.activeEffect.gemData.tags.corrupted = true + end for _, supportProperty in ipairs(skillModList:Tabulate("LIST", activeSkill.skillCfg, "SupportedGemProperty")) do local value = supportProperty.value if value.keyword == "grants_active_skill" and activeSkill.activeEffect.gemData and not activeSkill.activeEffect.gemData.tags.support then diff --git a/src/Modules/CalcPerform.lua b/src/Modules/CalcPerform.lua index cd5a2bc12..64afe63f4 100644 --- a/src/Modules/CalcPerform.lua +++ b/src/Modules/CalcPerform.lua @@ -3231,9 +3231,10 @@ function calcs.perform(env, skipEHP) local baseLevel = mainSkill.skillModList:Sum("BASE", mainSkill.skillCfg, "GemLevel") local totalItemLevel = mainSkill.skillModList:Sum("BASE", mainSkill.skillCfg, "GemItemLevel") local totalSupportLevel = mainSkill.skillModList:Sum("BASE", mainSkill.skillCfg, "GemSupportLevel") + local totalCorruptionLevel = mainSkill.skillModList:Sum("BASE", mainSkill.skillCfg, "GemCorruptionLevel") output.GemHasLevel = true - output.GemLevel = baseLevel + totalSupportLevel + totalItemLevel + output.GemLevel = baseLevel + totalSupportLevel + totalItemLevel + totalCorruptionLevel if env.player.breakdown then env.player.breakdown.GemLevel = {} @@ -3244,6 +3245,11 @@ function calcs.perform(env, skipEHP) if totalItemLevel > 0 then t_insert(env.player.breakdown.GemLevel, s_format("+ %d ^8(level from items)", totalItemLevel)) end + if totalCorruptionLevel > 0 then + t_insert(env.player.breakdown.GemLevel, s_format("+ %d ^8(level from corruption)", totalCorruptionLevel)) + elseif totalCorruptionLevel < 0 then + t_insert(env.player.breakdown.GemLevel, s_format("%d ^8(level from corruption)", totalCorruptionLevel)) + end t_insert(env.player.breakdown.GemLevel, s_format("= %d", output.GemLevel)) end end diff --git a/src/Modules/CalcSections.lua b/src/Modules/CalcSections.lua index ab1596c29..92229d165 100644 --- a/src/Modules/CalcSections.lua +++ b/src/Modules/CalcSections.lua @@ -623,7 +623,7 @@ return { } } } }, { 1, "SkillTypeStats", 1, colorCodes.OFFENCE, {{ defaultCollapsed = false, label = "Skill type-specific Stats", data = { - { label = "Gem Level", haveOutput = "GemHasLevel", { format = "{0:output:GemLevel}", { breakdown = "GemLevel" }, { modName = { "GemLevel" }, cfg = "skill" },{ modName = { "GemSupportLevel" }, cfg = "skill" }, { modName = { "GemItemLevel" }, cfg = "skill" }, }, }, + { label = "Gem Level", haveOutput = "GemHasLevel", { format = "{0:output:GemLevel}", { breakdown = "GemLevel" }, { modName = { "GemLevel" }, cfg = "skill" },{ modName = { "GemSupportLevel" }, cfg = "skill" }, { modName = { "GemItemLevel" }, cfg = "skill" }, { modName = { "GemCorruptionLevel" }, cfg = "skill" } }, }, { label = "Spirit Cost", color = colorCodes.SPIRIT, haveOutput = "SpiritHasCost", { format = "{0:output:SpiritCost}", { breakdown = "SpiritCost" }, { modName = { "SpiritCost", "Cost", "SpiritCostNoMult" }, cfg = "skill" }, }, }, { label = "Spirit % Cost", color = colorCodes.SPIRIT, haveOutput = "SpiritPercentHasCost", { format = "{0:output:SpiritPercentCost}", { breakdown = "SpiritPercentCost" }, { modName = { "SpiritCost", "Cost", "SpiritCostNoMult" }, cfg = "skill" }, }, }, { label = "Mana Cost", color = colorCodes.MANA, haveOutput = "ManaHasCost", { format = "{0:output:ManaCost}", { breakdown = "ManaCost" }, { modName = { "ManaCost", "Cost", "ManaCostNoMult" }, cfg = "skill" }, }, }, diff --git a/src/Modules/CalcSetup.lua b/src/Modules/CalcSetup.lua index 3cdb977be..680380111 100644 --- a/src/Modules/CalcSetup.lua +++ b/src/Modules/CalcSetup.lua @@ -1653,9 +1653,14 @@ function calcs.initEnv(build, mode, override, specEnv) level = gemInstance.level, quality = gemInstance.quality, qualityId = gemInstance.qualityId, + corrupted = gemInstance.corrupted, + corruptLevel = gemInstance.corruptLevel, srcInstance = gemInstance, gemData = gemInstance.gemData, } + if activeEffect.corruptLevel then + activeEffect.level = activeEffect.level + activeEffect.corruptLevel + end if env.mode == "CALCS" then activeEffect.statSetCalcs = { index = gemInstance.statSetCalcs and gemInstance.statSetCalcs[grantedEffect.id] or 1} else