Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
aeb8819
update skills export
sida-wang Dec 29, 2024
9a2ef57
update gem export files
sida-wang Dec 29, 2024
8c9c04f
fix baseMod directive
sida-wang Dec 29, 2024
fd5de08
updated gem files
sida-wang Dec 29, 2024
1adaddd
Merge branch 'dev' into skills-export
sida-wang Dec 29, 2024
b3ef0a4
Add startSets directive to alllow for code against grantedEffect
sida-wang Dec 29, 2024
c3f1257
minor changes to allow client to load
sida-wang Dec 29, 2024
1eaec25
Update skill gem tooltips based on statsets
sida-wang Jan 1, 2025
e7086c4
Merge branch 'dev' into skills-export
sida-wang Jan 3, 2025
3cd98f1
fix missing quality stats export
sida-wang Jan 3, 2025
f523b44
further skill export updates
sida-wang Jan 3, 2025
c4dd9c4
Get rid of quality types
sida-wang Jan 3, 2025
46ffb23
more alt qual removal
sida-wang Jan 3, 2025
0e939b4
fix support max level
sida-wang Jan 3, 2025
b50f69c
remove alt qual filter
sida-wang Jan 3, 2025
eafaf2b
alt qual removal
sida-wang Jan 3, 2025
82c3cd5
statset changes
sida-wang Jan 3, 2025
2c87b35
Merge branch 'dev' into skills-export
sida-wang Jan 3, 2025
6f2848e
fix merge dev mistake
sida-wang Jan 4, 2025
6baeacd
match skill descriptions to in game
sida-wang Jan 4, 2025
4a1c75a
working changes
sida-wang Jan 5, 2025
6181d06
revert debug change
sida-wang Jan 5, 2025
4958ded
Merge branch 'dev' into skills-export
sida-wang Jan 5, 2025
10e4440
Fix spec
Jan 5, 2025
c1c0017
Fix statset integration
sida-wang Jan 5, 2025
a1a1f5b
Add support for gem quality popup
Jan 5, 2025
5cea5b8
fix bonestorm statmap
sida-wang Jan 6, 2025
6191af7
Merge branch 'skills-export' of https://github.com/sida-wang/PathOfBu…
sida-wang Jan 6, 2025
f21f8a4
Fix skillFlags reseting for other environments when creating active s…
sida-wang Jan 7, 2025
9810df5
Fix Bonestorm
Jan 8, 2025
4adedad
Fix export + gem colours
Jan 8, 2025
5893e42
Merge branch 'dev' into pr/62
Jan 8, 2025
b8f32d1
Merge branch 'dev' into pr/62
Jan 8, 2025
c5a4931
Export skills
Jan 8, 2025
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
14 changes: 12 additions & 2 deletions src/Classes/CalcsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ local CalcsTabClass = newClass("CalcsTab", "UndoHandler", "ControlHost", "Contro
self.build.buildFlag = true
end)
}, },
{ label = "Stat Set", { controlName = "statSet",
control = new("DropDownControl", nil, {0, 0, 300, 16}, nil, function(index, value)
local mainSocketGroup = self.build.skillsTab.socketGroupList[self.input.skill_number]
local srcInstance = mainSocketGroup.displaySkillListCalcs[mainSocketGroup.mainActiveSkillCalcs].activeEffect.srcInstance
srcInstance.statSetCalcs = srcInstance.statSetCalcs or { }
srcInstance.statSetCalcs.statSet = value.statSet
self:AddUndoState()
self.build.buildFlag = true
end)
}, },
{ label = "Skill Part", playerFlag = "multiPart", { controlName = "mainSkillPart",
control = new("DropDownControl", nil, {0, 0, 250, 16}, nil, function(index, value)
local mainSocketGroup = self.build.skillsTab.socketGroupList[self.input.skill_number]
Expand Down Expand Up @@ -374,7 +384,7 @@ end

function CalcsTabClass:CheckFlag(obj)
local actor = self.input.showMinion and self.calcsEnv.minion or self.calcsEnv.player
local skillFlags = actor.mainSkill.skillFlags
local skillFlags = actor.mainSkill.activeEffect.srcInstance.statSetCalcs.skillFlags
if obj.flag and not skillFlags[obj.flag] then
return
end
Expand All @@ -385,7 +395,7 @@ function CalcsTabClass:CheckFlag(obj)
end
end
end
if obj.playerFlag and not self.calcsEnv.player.mainSkill.skillFlags[obj.playerFlag] then
if obj.playerFlag and not self.calcsEnv.player.mainSkill.activeEffect.srcInstance.statSetCalcs.skillFlags[obj.playerFlag] then
return
end
if obj.notFlag and skillFlags[obj.notFlag] then
Expand Down
6 changes: 4 additions & 2 deletions src/Classes/ConfigTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,8 @@ local ConfigTabClass = newClass("ConfigTab", "UndoHandler", "ControlHost", "Cont
if varData.ifFlag then
t_insert(shownFuncs, listOrSingleIfOption(varData.ifFlag, function(ifOption)
local skillModList = self.build.calcsTab.mainEnv.player.mainSkill.skillModList
local skillFlags = self.build.calcsTab.mainEnv.player.mainSkill.skillFlags
-- only checking flags of skill in main env. rework may be required
local skillFlags = self.build.calcsTab.mainEnv.player.mainSkill.activeEffect.srcInstance.statSetMain.skillFlags
-- Check both the skill mods for flags and flags that are set via calcPerform
return skillFlags[ifOption] or skillModList:Flag(nil, ifOption)
end))
Expand Down Expand Up @@ -497,7 +498,8 @@ local ConfigTabClass = newClass("ConfigTab", "UndoHandler", "ControlHost", "Cont
if varData.ifSkillFlag then
t_insert(shownFuncs, listOrSingleIfOption(varData.ifSkillFlag, function(ifOption)
for _, activeSkill in ipairs(self.build.calcsTab.mainEnv.player.activeSkillList) do
if activeSkill.skillFlags[ifOption] then
-- only checking flags of skill in main env. rework may be required
if activeSkill.activeEffect.srcInstance.statSetMain.skillFlags[ifOption] then
return true
end
end
Expand Down
105 changes: 43 additions & 62 deletions src/Classes/GemSelectControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ local m_max = math.max
local m_floor = math.floor

local toolTipText = "Prefix tag searches with a colon and exclude tags with a dash. e.g. :fire:lightning:-cold:area"
local altQualMap = {
["Default"] = "",
["Alternate1"] = "Anomalous ",
["Alternate2"] = "Divergent ",
["Alternate3"] = "Phantasmal ",
}

local GemSelectClass = newClass("GemSelectControl", "EditControl", function(self, anchor, rect, skillsTab, index, changeFunc, forceTooltip)
self.EditControl(anchor, rect, nil, nil, "^ %a':-")
Expand Down Expand Up @@ -58,15 +52,14 @@ local GemSelectClass = newClass("GemSelectControl", "EditControl", function(self
}
end)

function GemSelectClass:CalcOutputWithThisGem(calcFunc, gemData, qualityId, useFullDPS)
function GemSelectClass:CalcOutputWithThisGem(calcFunc, gemData, useFullDPS)
local gemList = self.skillsTab.displayGroup.gemList
local oldGem
if gemList[self.index] then
oldGem = copyTable(gemList[self.index], true)
else
gemList[self.index] = {
level = gemData.naturalMaxLevel,
qualityId = qualityId,
quality = self.skillsTab.defaultGemQuality or 0,
count = 1,
enabled = true,
Expand All @@ -83,9 +76,6 @@ function GemSelectClass:CalcOutputWithThisGem(calcFunc, gemData, qualityId, useF
gemInstance.level = self.skillsTab:ProcessGemLevel(gemData)
gemInstance.gemData = gemData
gemInstance.displayEffect = nil
if gemInstance.qualityId == nil or gemInstance.qualityId == "" then
gemInstance.qualityId = "Default"
end
-- Add hovered gem to tooltip
self:AddGemTooltip(gemInstance)
-- Calculate the impact of using this gem
Expand Down Expand Up @@ -114,17 +104,7 @@ function GemSelectClass:PopulateGemList()
if (self.sortGemsBy and gemData.tags[self.sortGemsBy] == true or not self.sortGemsBy) then
local levelRequirement = (gemData.grantedEffect.levels and gemData.grantedEffect.levels[1] and gemData.grantedEffect.levels[1].levelRequirement) or 1
if characterLevel >= levelRequirement or not matchLevel then
if (showAwakened or showAll) and gemData.grantedEffect.plusVersionOf then
self.gems["Default:" .. gemId] = gemData
elseif showNormal or showAll then
if self.skillsTab.showAltQualityGems and (self.skillsTab.defaultGemQuality or 0) > 0 then
for _, altQual in ipairs(self.skillsTab:getGemAltQualityList(gemData)) do
self.gems[altQual.type .. ":" .. gemId] = gemData
end
else
self.gems["Default:" .. gemId] = gemData
end
end
self.gems["Default:" .. gemId] = gemData
end
end
end
Expand All @@ -140,7 +120,6 @@ function GemSelectClass:FilterSupport(gemId, gemData)
or showSupportTypes == "ALL"
or (showSupportTypes == "NORMAL" and not gemData.grantedEffect.plusVersionOf)
or (showSupportTypes == "AWAKENED" and gemData.grantedEffect.plusVersionOf))
and (self.skillsTab.showAltQualityGems or (not self.skillsTab.showAltQualityGems and self:GetQualityType(gemId) == "Default"))
end

function GemSelectClass:BuildList(buf)
Expand Down Expand Up @@ -170,7 +149,7 @@ function GemSelectClass:BuildList(buf)
for i, pattern in ipairs(patternList) do
local matchList = { }
for gemId, gemData in pairs(self.gems) do
if self:FilterSupport(gemId, gemData) and not added[gemId] and ((" "..gemData.name:lower()):match(pattern) or altQualMap[self:GetQualityType(gemId)]:lower():match(pattern)) then
if self:FilterSupport(gemId, gemData) and not added[gemId] and ((" "..gemData.name:lower()):match(pattern)) then
addThisGem = true
if #tagsList > 0 then
for _, tag in ipairs(tagsList) do
Expand Down Expand Up @@ -250,11 +229,11 @@ function GemSelectClass:UpdateSortCache()
and sortCache.outputRevision == self.skillsTab.build.outputRevision and sortCache.defaultLevel == self.skillsTab.defaultGemLevel
and (sortCache.characterLevel == self.skillsTab.build.characterLevel or self.skillsTab.defaultGemLevel ~= "characterLevel")
and sortCache.defaultQuality == self.skillsTab.defaultGemQuality and sortCache.sortType == self.skillsTab.sortGemsByDPSField
and sortCache.considerAlternates == self.skillsTab.showAltQualityGems and sortCache.considerGemType == self.skillsTab.showSupportGemTypes then
and sortCache.considerGemType == self.skillsTab.showSupportGemTypes then
return
end

if not sameSortBy or not sortCache or (sortCache.considerAlternates ~= self.skillsTab.showAltQualityGems or sortCache.considerGemType ~= self.skillsTab.showSupportGemTypes
if not sameSortBy or not sortCache or (sortCache.considerGemType ~= self.skillsTab.showSupportGemTypes
or sortCache.defaultQuality ~= self.skillsTab.defaultGemQuality
or sortCache.defaultLevel ~= self.skillsTab.defaultGemLevel
or (sortCache.characterLevel ~= self.skillsTab.build.characterLevel and self.skillsTab.defaultGemLevel == "characterLevel")) then
Expand All @@ -265,7 +244,6 @@ function GemSelectClass:UpdateSortCache()
-- Initialize a new sort cache
sortCache = {
considerGemType = self.skillsTab.showSupportGemTypes,
considerAlternates = self.skillsTab.showAltQualityGems,
socketGroup = self.skillsTab.displayGroup,
gemInstance = self.skillsTab.displayGroup.gemList[self.index],
outputRevision = self.skillsTab.build.outputRevision,
Expand Down Expand Up @@ -334,7 +312,7 @@ function GemSelectClass:UpdateSortCache()
sortCache.dps[gemId] = baseDPS
-- Ignore gems that don't support the active skill
if sortCache.canSupport[gemId] or gemData.grantedEffect.hasGlobalEffect then
local output = self:CalcOutputWithThisGem(calcFunc, gemData, self:GetQualityType(gemId), useFullDPS)
local output = self:CalcOutputWithThisGem(calcFunc, gemData, useFullDPS)
-- Check for nil because some fields may not be populated, default to 0
sortCache.dps[gemId] = (dpsField == "FullDPS" and output[dpsField] ~= nil and output[dpsField]) or (output.Minion and output.Minion.CombinedDPS) or (output[dpsField] ~= nil and output[dpsField]) or 0
end
Expand Down Expand Up @@ -457,9 +435,6 @@ function GemSelectClass:Draw(viewPort, noTooltip)
end
end
local gemText = gemData and gemData.name or "<No matches>"
if gemId and gemId ~= "" then
gemText = altQualMap[self:GetQualityType(gemId)] .. gemText
end
DrawString(0, y, "LEFT", height - 4, "VAR", gemText)
if gemData then
if gemData.grantedEffect.support and self.sortCache.canSupport[gemId] then
Expand All @@ -477,7 +452,7 @@ function GemSelectClass:Draw(viewPort, noTooltip)
local calcFunc, calcBase = self.skillsTab.build.calcsTab:GetMiscCalculator(self.build)
if calcFunc then
self.tooltip:Clear()
local output, gemInstance = self:CalcOutputWithThisGem(calcFunc, self.gems[self.list[self.hoverSel]], self:GetQualityType(self.list[self.hoverSel]), self.skillsTab.sortGemsByDPSField == "FullDPS")
local output = self:CalcOutputWithThisGem(calcFunc, self.gems[self.list[self.hoverSel]], self.skillsTab.sortGemsByDPSField == "FullDPS")
self.tooltip:AddSeparator(10)
self.skillsTab.build:AddStatComparesToTooltip(self.tooltip, calcBase, output, "^7Selecting this gem will give you:")
self.tooltip:Draw(x, y + height + 2 + (self.hoverSel - 1) * (height - 4) - scrollBar.offset, width, height - 4, viewPort)
Expand Down Expand Up @@ -506,10 +481,6 @@ function GemSelectClass:Draw(viewPort, noTooltip)
local cursorX, cursorY = GetCursorPos()
self.tooltip:Clear()
if gemInstance and gemInstance.gemData then
-- Check valid qualityId, set to 'Default' if missing
if gemInstance.qualityId == nil or gemInstance.qualityId == "" then
gemInstance.qualityId = "Default"
end
self:AddGemTooltip(gemInstance)
else
self.tooltip:AddLine(16, toolTipText)
Expand Down Expand Up @@ -564,25 +535,29 @@ function GemSelectClass:AddGemTooltip(gemInstance)
local grantedEffect = gemInstance.gemData.grantedEffect
local additionalEffects = gemInstance.gemData.additionalGrantedEffects

self.tooltip:AddLine(20, colorCodes.GEM .. altQualMap[gemInstance.qualityId]..grantedEffect.name)
self.tooltip:AddLine(20, colorCodes.GEM .. grantedEffect.name)
self.tooltip:AddSeparator(10)
self.tooltip:AddLine(16, "^x7F7F7F" .. gemInstance.gemData.tagString)
-- Will need rework if a gem can have 2+ additional supports
self:AddCommonGemInfo(gemInstance, grantedEffect, true, additionalEffects[1] and additionalEffects[1].support and additionalEffects[1])
self:AddGrantedEffectInfo(gemInstance, grantedEffect, true)
for _, statSet in ipairs(grantedEffect.statSets) do
self:AddStatSetInfo(gemInstance, grantedEffect, statSet)
end

if additionalEffects then
for _, additional in ipairs(additionalEffects) do
if not additional.support then
self.tooltip:AddSeparator(10)
self.tooltip:AddLine(20, colorCodes.GEM .. additional.name)
self.tooltip:AddSeparator(10)
self:AddCommonGemInfo(gemInstance, additional)
for _, additional in ipairs(additionalEffects or {}) do
if not additional.support then
self.tooltip:AddSeparator(10)
self.tooltip:AddLine(20, colorCodes.GEM .. additional.name)
self.tooltip:AddSeparator(10)
self:AddGrantedEffectInfo(gemInstance, additional)
for _, statSet in ipairs(additional.statSets) do
self:AddStatSetInfo(gemInstance, grantedEffect, statSet)
end
end
end
end

function GemSelectClass:AddCommonGemInfo(gemInstance, grantedEffect, addReq, mergeStatsFrom)
function GemSelectClass:AddGrantedEffectInfo(gemInstance, grantedEffect, addReq)
local displayInstance = gemInstance.displayEffect or gemInstance
local grantedEffectLevel = grantedEffect.levels[displayInstance.level] or { }
if addReq then
Expand Down Expand Up @@ -661,12 +636,6 @@ function GemSelectClass:AddCommonGemInfo(gemInstance, grantedEffect, addReq, mer
self.tooltip:AddLine(16, "^x7F7F7FCast Time: ^7Instant")
end
end
if grantedEffectLevel.critChance then
self.tooltip:AddLine(16, string.format("^x7F7F7FCritical Hit Chance: ^7%.2f%%", grantedEffectLevel.critChance))
end
if grantedEffectLevel.damageEffectiveness then
self.tooltip:AddLine(16, string.format("^x7F7F7FEffectiveness of Added Damage: ^7%d%%", grantedEffectLevel.damageEffectiveness * 100))
end
end
if addReq and displayInstance.quality > 0 then
self.tooltip:AddLine(16, string.format("^x7F7F7FQuality: "..colorCodes.MAGIC.."+%d%%^7%s",
Expand All @@ -688,17 +657,30 @@ function GemSelectClass:AddCommonGemInfo(gemInstance, grantedEffect, addReq, mer
self.tooltip:AddLine(16, colorCodes.GEM..line)
end
end
if self.skillsTab.build.data.describeStats then
end
function GemSelectClass:AddStatSetInfo(gemInstance, grantedEffect, statSet)
local displayInstance = gemInstance.displayEffect or gemInstance
local statSetLevel = statSet.levels[displayInstance.level] or { }
self.tooltip:AddSeparator(10)
self.tooltip:AddLine(20, colorCodes.GEM .. statSet.label)
self.tooltip:AddSeparator(10)
if statSetLevel.critChance then
self.tooltip:AddLine(16, string.format("^x7F7F7FCritical Hit Chance: ^7%.2f%%", statSetLevel.critChance))
end
if statSetLevel.baseMultiplier then
self.tooltip:AddLine(16, string.format("^x7F7F7FAttack Damage: ^7%d%%", statSetLevel.baseMultiplier * 100))
end
if self.skillsTab and self.skillsTab.build.data.describeStats then
self.tooltip:AddSeparator(10)
local stats = calcLib.buildSkillInstanceStats(displayInstance, grantedEffect)
if mergeStatsFrom then
for stat, val in pairs(calcLib.buildSkillInstanceStats(displayInstance, mergeStatsFrom)) do
stats[stat] = (stats[stat] or 0) + val
end
end
local descriptions, lineMap = self.skillsTab.build.data.describeStats(stats, grantedEffect.statDescriptionScope)
local stats = calcLib.buildSkillInstanceStats(displayInstance, grantedEffect, statSet)
--if mergeStatsFrom then
-- for stat, val in pairs(calcLib.buildSkillInstanceStats(displayInstance, mergeStatsFrom)) do
-- stats[stat] = (stats[stat] or 0) + val
-- end
--end
local descriptions, lineMap = self.skillsTab.build.data.describeStats(stats, statSet.statDescriptionScope)
for _, line in ipairs(descriptions) do
local source = grantedEffect.statMap[lineMap[line]] or self.skillsTab.build.data.skillStatMap[lineMap[line]]
local source = statSet.statMap[lineMap[line]] or self.skillsTab.build.data.skillStatMap[lineMap[line]]
if source then
if launch.devModeAlt then
local devText = lineMap[line]
Expand All @@ -720,7 +702,6 @@ function GemSelectClass:AddCommonGemInfo(gemInstance, grantedEffect, addReq, mer
end
end
end

function GemSelectClass:OnFocusGained()
self.EditControl:OnFocusGained()
self.dropped = true
Expand Down
3 changes: 2 additions & 1 deletion src/Classes/ModStore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ function ModStoreClass:GetStat(stat, cfg)
local totalMana = self.actor.output["Mana"]
if totalMana == 0 then return 0 else
for _, activeSkill in ipairs(self.actor.activeSkillList) do
if (activeSkill.skillTypes[SkillType.Aura] and not activeSkill.skillFlags.disable and activeSkill.buffList and activeSkill.buffList[1] and activeSkill.buffList[1].name == cfg.skillName) then
-- currently only checks main statset for skill flags. rework if required
if (activeSkill.skillTypes[SkillType.Aura] and not activeSkill.activeEffect.srcInstance.statSetMain.skillFlags.disable and activeSkill.buffList and activeSkill.buffList[1] and activeSkill.buffList[1].name == cfg.skillName) then
local manaBase = activeSkill.skillData["ManaReservedBase"] or 0
reservedPercentMana = manaBase / totalMana * 100
break
Expand Down
Loading