Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions src/Classes/GemTooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,30 @@ local function addGrantedEffectInfo(tooltip, build, gemInstance, grantedEffect,
tooltip:AddLine(fontSizeBig, colorCodes.MAGIC .. " +" .. totalLevel - gemInstance.level - corruptLevel .. " Levels from Supports", "FONTIN SC")
end
end
if not levelRange and addReq and displayInstance.quality > 0 then
tooltip:AddLine(fontSizeBig, colorCodes.GEMINFO .. string.format(" Quality: " .. colorCodes.MAGIC .. "+%d%%^7%s",
gemInstance.quality,
(displayInstance.quality > gemInstance.quality) and " (" .. colorCodes.MAGIC .. "+" .. (displayInstance.quality - gemInstance.quality) .. "^7)" or ""
), "FONTIN SC")
-- gem quality by type
local isSupport = displayInstance.gemData?.gemType == "Support"
if not levelRange and addReq and displayInstance.quality > 0 and not isSupport then
local totalGlobalQuality = 0
if displayInstance.gemPropertyInfo then
for i, prop in ipairs(displayInstance.gemPropertyInfo) do
if prop.value and prop.value.key == "quality" and prop.value.value then
totalGlobalQuality = totalGlobalQuality + prop.value.value
end
end
end
totalGlobalQuality = math.floor(totalGlobalQuality)
local gemQuality = gemInstance.quality
if gemQuality > 0
then
tooltip:AddLine(fontSizeBig, colorCodes.GEMINFO .. " Quality: ^7" .. colorCodes.MAGIC .. "+".. gemQuality .. "%", "FONTIN SC")
end
if totalGlobalQuality > 0 then
tooltip:AddLine(fontSizeBig, colorCodes.MAGIC .. " +" .. totalGlobalQuality .. "% Quality from Global Modifiers", "FONTIN SC")
end
local supportQuality = math.floor(displayInstance.quality) - totalGlobalQuality - gemQuality
if supportQuality > 0 then
tooltip:AddLine(fontSizeBig, colorCodes.MAGIC .. " +" .. supportQuality .. "% Quality from Supports", "FONTIN SC")
end
end
if not levelRange and grantedEffect.support then
if levelStats.manaMultiplier and levelStats.reservationMultiplier and levelStats.manaMultiplier == levelStats.reservationMultiplier then
Expand Down
6 changes: 5 additions & 1 deletion src/Modules/CalcActiveSkill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,10 @@ function calcs.buildActiveSkillModList(env, activeSkill)
local gemMaxLevel = supportGrantedInheritedLevel or (activeSkill.activeEffect.srcInstance and activeSkill.activeEffect.srcInstance.level) or activeSkill.activeEffect.level
local gemMaxLevelSource = supportGrantedInheritedLevel and "Inherited Max Level" or "Max Level"
skillModList:NewMod("GemLevel", "BASE", gemMaxLevel, gemMaxLevelSource)
local gemBaseQuality = (activeSkill.activeEffect.srcInstance and activeSkill.activeEffect.srcInstance.quality) or activeSkill.activeEffect.quality
if gemBaseQuality then
skillModList:NewMod("GemQuality", "BASE", gemBaseQuality, "Gem Quality")
end
if activeSkill.activeEffect.srcInstance and activeSkill.activeEffect.srcInstance.corrupted and not (activeSkill.activeEffect.srcInstance.fromItem or activeSkill.activeEffect.srcInstance.fromTree or activeSkill.activeEffect.grantedEffect.fromItem or activeSkill.activeEffect.grantedEffect.fromTree) then
skillModList:NewMod("GemCorruptionLevel", "BASE", activeSkill.activeEffect.srcInstance.corruptLevel, "Corruption")
activeSkill.skillCfg.skillCond["GemCorrupted"] = true
Expand All @@ -803,7 +807,7 @@ function calcs.buildActiveSkillModList(env, activeSkill)

for _, gemProperty in ipairs((activeSkill.activeEffect.gemPropertyInfo or {})) do
local value = gemProperty.value
skillModList:NewMod("GemItem".. value.key:gsub("^%l", string.upper), "BASE", value.value, gemProperty.mod.source, #gemProperty.mod > 0 and gemProperty.mod[1] or nil)
skillModList:NewMod("GemGlobal" .. value.key:gsub("^%l", string.upper), "BASE", value.value, gemProperty.mod.source, #gemProperty.mod > 0 and gemProperty.mod[1] or nil)
end

-- Add active gem modifiers
Expand Down
20 changes: 19 additions & 1 deletion src/Modules/CalcPerform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3654,7 +3654,7 @@ function calcs.perform(env, skipEHP)
local mainSkill = env.player.mainSkill
if mainSkill.activeEffect and mainSkill.activeEffect.level and mainSkill.activeEffect.srcInstance then
local baseLevel = mainSkill.skillModList:Sum("BASE", mainSkill.skillCfg, "GemLevel")
local totalItemLevel = mainSkill.skillModList:Sum("BASE", mainSkill.skillCfg, "GemItemLevel")
local totalItemLevel = mainSkill.skillModList:Sum("BASE", mainSkill.skillCfg, "GemGlobalLevel")
local totalSupportLevel = mainSkill.skillModList:Sum("BASE", mainSkill.skillCfg, "GemSupportLevel")
local totalCorruptionLevel = mainSkill.skillModList:Sum("BASE", mainSkill.skillCfg, "GemCorruptionLevel")

Expand Down Expand Up @@ -3682,6 +3682,24 @@ function calcs.perform(env, skipEHP)
t_insert(env.player.breakdown.GemLevel, s_format("= %d", output.GemLevel))
end
end
if mainSkill.activeEffect and mainSkill.activeEffect.quality and mainSkill.activeEffect.srcInstance then
local baseQuality = mainSkill.skillModList:Sum("BASE", mainSkill.skillCfg, "GemQuality")
local totalGlobalQuality = mainSkill.skillModList:Sum("BASE", mainSkill.skillCfg, "GemGlobalQuality")
local totalSupportQuality = mainSkill.skillModList:Sum("BASE", mainSkill.skillCfg, "GemSupportQuality")

output.GemQuality = baseQuality + totalSupportQuality + totalGlobalQuality
if env.player.breakdown then
env.player.breakdown.GemQuality = {}
t_insert(env.player.breakdown.GemQuality, s_format("%d ^8(quality from gem)", baseQuality))
if totalSupportQuality > 0 then
t_insert(env.player.breakdown.GemQuality, s_format("+ %d ^8(quality from supports)", totalSupportQuality))
end
if totalGlobalQuality > 0 then
t_insert(env.player.breakdown.GemQuality, s_format("+ %d ^8(quality from global modifiers)", totalGlobalQuality))
end
t_insert(env.player.breakdown.GemQuality, s_format("= %d", output.GemQuality))
end
end
end

-- check for warnings to add
Expand Down
3 changes: 2 additions & 1 deletion src/Modules/CalcSections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,8 @@ return {
} }
} },
{ 1, "SkillTypeStats", 1, colorCodes.OFFENCE, {{ defaultCollapsed = false, label = "Skill type-specific Stats", data = {
{ label = "Gem Level", notFlag = "thorns", haveOutput = "GemHasLevel", { format = "{0:output:GemLevel}", { breakdown = "GemLevel" }, { modName = { "GemLevel" }, cfg = "skill" }, { modName = { "GemSupportLevel" }, cfg = "skill", notSkillData = "inheritsGemLevel" }, { modName = { "GemItemLevel" }, cfg = "skill", notSkillData = "inheritsGemLevel" }, { modName = { "GemCorruptionLevel" }, cfg = "skill", notSkillData = "inheritsGemLevel" } }, },
{ label = "Gem Level", notFlag = "thorns", haveOutput = "GemHasLevel", { format = "{0:output:GemLevel}", { breakdown = "GemLevel" }, { modName = { "GemLevel" }, cfg = "skill" }, { modName = { "GemSupportLevel" }, cfg = "skill", notSkillData = "inheritsGemLevel" }, { modName = { "GemGlobalLevel" }, cfg = "skill", notSkillData = "inheritsGemLevel" }, { modName = { "GemCorruptionLevel" }, cfg = "skill", notSkillData = "inheritsGemLevel" } }, },
{ label = "Gem Quality", notFlag = "thorns", haveOutput = "GemQuality", { format = "{0:output:GemQuality}%", { breakdown = "GemQuality" }, { modName = { "GemQuality" }, cfg = "skill" }, { modName = { "GemSupportQuality" }, cfg = "skill" }, { modName = { "GemGlobalQuality" }, 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" }, }, },
Expand Down
Loading