Skip to content

Commit 8ebe515

Browse files
LocalIdentityLocalIdentity
andauthored
Fix quality stats on gems not showing up in gem tooltip (#1302)
* Fix quality stats on gems not showing up in gem tooltip We were still using the old logic for secondaryGrantedEffect that PoB 1 uses, so if any skill had a quality stat on a additionalGrantedEffects, it wouldn't show up in the quality tooltip or get added to the main gem tooltip We now iterate over the first 2 entries in the additionalGrantedEffects list to check for quality stats in them Note: We technically handle quality stats wrong for quite a few gem. Some gems have restrictions on the stat sets the quality stat should apply to but we currently just apply the quality stat to all the stat sets. I'll look into fixing this in the future We were also missing the export of the quality stat on Hand of Chayula * Fix gem display * Fix tooltip display --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent cad4b29 commit 8ebe515

File tree

7 files changed

+82
-28
lines changed

7 files changed

+82
-28
lines changed

src/Classes/GemSelectControl.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,11 +560,11 @@ function GemSelectClass:AddGemTooltip(gemInstance)
560560
self.tooltip:AddSeparator(10)
561561
self:AddGrantedEffectInfo(gemInstance, additional)
562562
for _, statSet in ipairs(additional.statSets) do
563-
self:AddStatSetInfo(gemInstance, grantedEffect, statSet)
563+
self:AddStatSetInfo(gemInstance, additional, statSet)
564564
end
565565
else
566566
for _, statSet in ipairs(additional.statSets) do
567-
self:AddStatSetInfo(gemInstance, grantedEffect, statSet, true)
567+
self:AddStatSetInfo(gemInstance, additional, statSet, true)
568568
end
569569
end
570570
end
@@ -573,7 +573,7 @@ end
573573
function GemSelectClass:AddGrantedEffectInfo(gemInstance, grantedEffect, addReq)
574574
local displayInstance = gemInstance.displayEffect or gemInstance
575575
local grantedEffectLevel = grantedEffect.levels[displayInstance.level] or { }
576-
if gemInstance.gemData.Tier and not grantedEffect.isLineage then
576+
if gemInstance.gemData.Tier and not grantedEffect.isLineage and not grantedEffect.hidden then
577577
self.tooltip:AddLine(16, string.format("^x7F7F7FTier: ^7%d", gemInstance.gemData.Tier))
578578
end
579579
if addReq and not grantedEffect.support then
@@ -661,7 +661,7 @@ function GemSelectClass:AddGrantedEffectInfo(gemInstance, grantedEffect, addReq)
661661
if grantedEffectLevel.critChance then
662662
self.tooltip:AddLine(16, string.format("^x7F7F7FCritical Hit Chance: ^7%.2f%%", grantedEffectLevel.critChance))
663663
end
664-
if gemInstance.gemData.weaponRequirements then
664+
if gemInstance.gemData.weaponRequirements and not grantedEffect.hidden then
665665
self.tooltip:AddLine(16, "^x7F7F7F Requires: ^7" .. gemInstance.gemData.weaponRequirements)
666666
end
667667
end

src/Classes/SkillsTab.lua

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -756,41 +756,53 @@ function SkillsTabClass:CreateGemSlot(index)
756756
end
757757
-- Function for both granted effect and secondary such as vaal
758758
local addQualityLines = function(qualityList, grantedEffect)
759-
tooltip:AddLine(18, colorCodes.GEM..grantedEffect.name)
760-
-- Hardcoded to use 20% quality instead of grabbing from gem, this is for consistency and so we always show something
761-
tooltip:AddLine(16, colorCodes.NORMAL.."At +20% Quality:")
762-
for k, qual in pairs(qualityList) do
763-
-- Do the stats one at a time because we're not guaranteed to get the descriptions in the same order we look at them here
764-
local stats = { }
765-
stats[qual[1]] = qual[2] * 20
766-
local descriptions = self.build.data.describeStats(stats, grantedEffect.statSets[1].statDescriptionScope)
767-
-- line may be nil if the value results in no line due to not being enough quality
768-
for _, line in ipairs(descriptions) do
769-
if line then
770-
-- Check if we have a handler for the mod in the gem's statMap or in the shared stat map for skills
771-
if grantedEffect.statSets[1].statMap[qual[1]] or self.build.data.skillStatMap[qual[1]] then
772-
tooltip:AddLine(16, colorCodes.MAGIC..line)
773-
else
774-
local line = colorCodes.UNSUPPORTED..line
775-
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
776-
tooltip:AddLine(16, line)
759+
if #qualityList > 0 then
760+
if grantedEffect.name == "" then
761+
tooltip:AddLine(18, colorCodes.GEM..grantedEffect.statSets[1].label)
762+
else
763+
tooltip:AddLine(18, colorCodes.GEM..grantedEffect.name)
764+
end
765+
-- Hardcoded to use 20% quality instead of grabbing from gem, this is for consistency and so we always show something
766+
tooltip:AddLine(16, colorCodes.NORMAL.."At +20% Quality:")
767+
for k, qual in pairs(qualityList) do
768+
-- Do the stats one at a time because we're not guaranteed to get the descriptions in the same order we look at them here
769+
local stats = { }
770+
stats[qual[1]] = qual[2] * 20
771+
local descriptions = self.build.data.describeStats(stats, grantedEffect.statSets[1].statDescriptionScope, true)
772+
-- line may be nil if the value results in no line due to not being enough quality
773+
for _, line in ipairs(descriptions) do
774+
if line then
775+
-- Check if we have a handler for the mod in the gem's statMap or in the shared stat map for skills
776+
if grantedEffect.statSets[1].statMap[qual[1]] or self.build.data.skillStatMap[qual[1]] then
777+
tooltip:AddLine(16, colorCodes.MAGIC..line)
778+
else
779+
local line = colorCodes.UNSUPPORTED..line
780+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
781+
tooltip:AddLine(16, line)
782+
end
777783
end
778784
end
779785
end
780786
end
781787
end
782788
-- Check if there is a quality of this type for the effect
783-
if gemData and gemData.grantedEffect.qualityStats then
789+
-- Currently only checks the first 2 additionalGrantedEffects. Will need to fix if gems ever add more
790+
if gemData and gemData.grantedEffect.qualityStats and #gemData.grantedEffect.qualityStats > 0 then
784791
local qualityTable = gemData.grantedEffect.qualityStats
785792
addQualityLines(qualityTable, gemData.grantedEffect)
786793
end
787-
if gemData and gemData.secondaryGrantedEffect and gemData.secondaryGrantedEffect.qualityStats then
788-
local qualityTable = gemData.secondaryGrantedEffect.qualityStats
794+
if gemData and gemData.additionalGrantedEffects[1] and gemData.additionalGrantedEffects[1].qualityStats and #gemData.additionalGrantedEffects[1].qualityStats > 0 then
795+
local qualityTable = gemData.additionalGrantedEffects[1].qualityStats
796+
tooltip:AddSeparator(10)
797+
addQualityLines(qualityTable, gemData.additionalGrantedEffects[1])
798+
end
799+
if gemData and gemData.additionalGrantedEffects[2] and gemData.additionalGrantedEffects[2].qualityStats and #gemData.additionalGrantedEffects[2].qualityStats > 0 then
800+
local qualityTable = gemData.additionalGrantedEffects[2].qualityStats
789801
tooltip:AddSeparator(10)
790-
addQualityLines(qualityTable, gemData.secondaryGrantedEffect)
802+
addQualityLines(qualityTable, gemData.additionalGrantedEffects[2])
791803
end
792804
-- Add stat comparisons for hovered quality (based on set quality)
793-
if gemData and (gemData.grantedEffect.qualityStats or (gemData.secondaryGrantedEffect and gemData.secondaryGrantedEffect.qualityStats)) and self.displayGroup.gemList[index] then
805+
if gemData and (gemData.grantedEffect.qualityStats or (gemData.additionalGrantedEffects[1] and gemData.additionalGrantedEffects[1].qualityStats or gemData.additionalGrantedEffects[2] and gemData.additionalGrantedEffects[2].qualityStats)) and self.displayGroup.gemList[index] then
794806
local calcFunc, calcBase = self.build.calcsTab:GetMiscCalculator(self.build)
795807
if calcFunc then
796808
local storedQuality = self.displayGroup.gemList[index].quality

src/Data/Skills/act_dex.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5167,6 +5167,8 @@ skills["SupportMirageArcherPlayer"] = {
51675167
requireSkillTypes = { SkillType.RangedAttack, SkillType.CrossbowAmmoSkill, SkillType.OR, },
51685168
addSkillTypes = { },
51695169
excludeSkillTypes = { SkillType.HasUsageCondition, },
5170+
qualityStats = {
5171+
},
51705172
levels = {
51715173
[1] = { levelRequirement = 0, },
51725174
[2] = { levelRequirement = 0, },

src/Data/Skills/act_int.lua

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,8 @@ skills["SupportBarrierInvocationPlayer"] = {
803803
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
804804
excludeSkillTypes = { SkillType.SupportedByHourglass, },
805805
isTrigger = true,
806+
qualityStats = {
807+
},
806808
levels = {
807809
[1] = { levelRequirement = 0, },
808810
[2] = { levelRequirement = 0, },
@@ -1030,6 +1032,8 @@ skills["SupportBlasphemyPlayer"] = {
10301032
excludeSkillTypes = { SkillType.Trapped, SkillType.RemoteMined, SkillType.OR, SkillType.SummonsTotem, SkillType.UsedByTotem, SkillType.NOT, SkillType.AND, SkillType.SupportedByHourglass, },
10311033
isTrigger = true,
10321034
ignoreMinionTypes = true,
1035+
qualityStats = {
1036+
},
10331037
levels = {
10341038
[1] = { levelRequirement = 0, },
10351039
[2] = { levelRequirement = 0, },
@@ -2087,6 +2091,8 @@ skills["SupportMetaCastOnCritPlayer"] = {
20872091
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
20882092
excludeSkillTypes = { SkillType.SupportedByHourglass, },
20892093
isTrigger = true,
2094+
qualityStats = {
2095+
},
20902096
levels = {
20912097
[1] = { levelRequirement = 0, },
20922098
[2] = { levelRequirement = 0, },
@@ -2310,6 +2316,8 @@ skills["SupportMetaCastOnDodgePlayer"] = {
23102316
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
23112317
excludeSkillTypes = { SkillType.SupportedByHourglass, },
23122318
isTrigger = true,
2319+
qualityStats = {
2320+
},
23132321
levels = {
23142322
[1] = { levelRequirement = 0, },
23152323
[2] = { levelRequirement = 0, },
@@ -2534,6 +2542,8 @@ skills["SupportMetaCastOnElementalAilmentPlayer"] = {
25342542
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
25352543
excludeSkillTypes = { SkillType.SupportedByHourglass, },
25362544
isTrigger = true,
2545+
qualityStats = {
2546+
},
25372547
levels = {
25382548
[1] = { levelRequirement = 0, },
25392549
[2] = { levelRequirement = 0, },
@@ -2756,6 +2766,8 @@ skills["SupportMetaCastOnMinionDeathPlayer"] = {
27562766
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
27572767
excludeSkillTypes = { SkillType.SupportedByHourglass, SkillType.CreatesMinion, },
27582768
isTrigger = true,
2769+
qualityStats = {
2770+
},
27592771
levels = {
27602772
[1] = { levelRequirement = 0, },
27612773
[2] = { levelRequirement = 0, },
@@ -4339,6 +4351,8 @@ skills["SupportMetaCastCurseOnBlockPlayer"] = {
43394351
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
43404352
excludeSkillTypes = { SkillType.SupportedByHourglass, },
43414353
isTrigger = true,
4354+
qualityStats = {
4355+
},
43424356
levels = {
43434357
[1] = { levelRequirement = 0, },
43444358
[2] = { levelRequirement = 0, },
@@ -5506,6 +5520,8 @@ skills["SupportElementalInvocationPlayer"] = {
55065520
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
55075521
excludeSkillTypes = { SkillType.SupportedByHourglass, },
55085522
isTrigger = true,
5523+
qualityStats = {
5524+
},
55095525
levels = {
55105526
[1] = { levelRequirement = 0, },
55115527
[2] = { levelRequirement = 0, },
@@ -11174,6 +11190,10 @@ skills["SupportHandOfChayulaPlayer"] = {
1117411190
requireSkillTypes = { SkillType.AppliesCurse, SkillType.Mark, SkillType.OR, },
1117511191
addSkillTypes = { },
1117611192
excludeSkillTypes = { },
11193+
qualityStats = {
11194+
{ "base_curse_duration_+%", 1 },
11195+
{ "mark_effect_+%", 0.5 },
11196+
},
1117711197
levels = {
1117811198
[1] = { levelRequirement = 0, },
1117911199
[2] = { levelRequirement = 0, },
@@ -15888,6 +15908,8 @@ skills["SupportReapersInvocationPlayer"] = {
1588815908
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
1588915909
excludeSkillTypes = { SkillType.SupportedByHourglass, },
1589015910
isTrigger = true,
15911+
qualityStats = {
15912+
},
1589115913
levels = {
1589215914
[1] = { levelRequirement = 0, },
1589315915
[2] = { levelRequirement = 0, },

src/Data/Skills/act_str.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,8 @@ skills["SupportAncestralWarriorTotemPlayer"] = {
521521
["One Handed Axe"] = true,
522522
["One Handed Sword"] = true,
523523
},
524+
qualityStats = {
525+
},
524526
levels = {
525527
[1] = { levelRequirement = 0, },
526528
[2] = { levelRequirement = 0, },
@@ -1810,6 +1812,8 @@ skills["SupportMetaCastOnBlockPlayer"] = {
18101812
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
18111813
excludeSkillTypes = { SkillType.SupportedByHourglass, },
18121814
isTrigger = true,
1815+
qualityStats = {
1816+
},
18131817
levels = {
18141818
[1] = { levelRequirement = 0, },
18151819
[2] = { levelRequirement = 0, },
@@ -1954,6 +1958,8 @@ skills["SupportMetaCastOnMeleeKillPlayer"] = {
19541958
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
19551959
excludeSkillTypes = { SkillType.SupportedByHourglass, },
19561960
isTrigger = true,
1961+
qualityStats = {
1962+
},
19571963
levels = {
19581964
[8] = { storedUses = 1, levelRequirement = 0, cooldown = 0.2, },
19591965
},
@@ -2022,6 +2028,8 @@ skills["SupportMetaCastOnMeleeStunPlayer"] = {
20222028
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
20232029
excludeSkillTypes = { SkillType.SupportedByHourglass, },
20242030
isTrigger = true,
2031+
qualityStats = {
2032+
},
20252033
levels = {
20262034
[8] = { storedUses = 1, levelRequirement = 0, cooldown = 0.2, },
20272035
},
@@ -11200,6 +11208,8 @@ skills["SupportMortarCannonPlayer"] = {
1120011208
requireSkillTypes = { SkillType.Grenade, },
1120111209
addSkillTypes = { SkillType.UsedByTotem, },
1120211210
excludeSkillTypes = { SkillType.Meta, SkillType.Triggered, SkillType.Channel, SkillType.Persistent, },
11211+
qualityStats = {
11212+
},
1120311213
levels = {
1120411214
[1] = { levelRequirement = 0, },
1120511215
[2] = { levelRequirement = 0, },
@@ -14326,6 +14336,8 @@ skills["SupportMetaCastLightningSpellOnHitPlayer"] = {
1432614336
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
1432714337
excludeSkillTypes = { SkillType.SupportedByHourglass, },
1432814338
isTrigger = true,
14339+
qualityStats = {
14340+
},
1432914341
levels = {
1433014342
[1] = { levelRequirement = 0, },
1433114343
[2] = { levelRequirement = 0, },

src/Data/Skills/other.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,8 @@ skills["SupportMetaDeadeyeMarksPlayer"] = {
977977
requireSkillTypes = { SkillType.Mark, },
978978
addSkillTypes = { },
979979
excludeSkillTypes = { },
980+
qualityStats = {
981+
},
980982
levels = {
981983
[1] = { levelRequirement = 0, },
982984
[2] = { levelRequirement = 0, },
@@ -1201,6 +1203,8 @@ skills["SupportMetaCastOnCharmUsePlayer"] = {
12011203
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
12021204
excludeSkillTypes = { SkillType.SupportedByHourglass, },
12031205
isTrigger = true,
1206+
qualityStats = {
1207+
},
12041208
levels = {
12051209
[1] = { levelRequirement = 0, },
12061210
[2] = { levelRequirement = 0, },
@@ -2975,6 +2979,8 @@ skills["SupportMetaCastFireSpellOnHitPlayer"] = {
29752979
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
29762980
excludeSkillTypes = { SkillType.SupportedByHourglass, },
29772981
isTrigger = true,
2982+
qualityStats = {
2983+
},
29782984
levels = {
29792985
[1] = { levelRequirement = 0, },
29802986
[2] = { levelRequirement = 0, },

src/Export/Scripts/skills.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ directiveTable.skill = function(state, args, out)
271271
--end
272272
table.insert(skill.levels, level)
273273
end
274-
if not skill.qualityStats and not granted.IsSupport then
274+
if not (skillGem and granted.IsSupport) then
275275
skill.qualityStats = { }
276276
local qualityStats = dat("GrantedEffectQualityStats"):GetRow("GrantedEffect", granted)
277277
if qualityStats and qualityStats.GrantedStats then

0 commit comments

Comments
 (0)