Skip to content

Add some Spectres, enable library, and add calcs for reservation #936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 56 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
df938e2
initial spectres
Blitz54 Apr 3, 2025
f4b8290
Merge branch 'PathOfBuildingCommunity:dev' into spectres
Blitz54 Apr 7, 2025
ba09ac3
library shows up, and some spectres+skills added
Blitz54 Apr 8, 2025
f709c73
Tarnished Scarab
Blitz54 Apr 9, 2025
17d302d
Merge branch 'PathOfBuildingCommunity:dev' into spectres
Blitz54 Apr 9, 2025
ceab80c
Two more spectres and some skill changes
Blitz54 Apr 10, 2025
16a1d13
Blood Priest and Priestess
Blitz54 Apr 11, 2025
238780a
Drudge Osseodon
Blitz54 Apr 12, 2025
0ba7bed
Merge branch 'PathOfBuildingCommunity:dev' into spectres
Blitz54 Apr 17, 2025
626d1d7
Diretusk Boar
Blitz54 Apr 17, 2025
46673db
Terracotta Soldier
Blitz54 Apr 17, 2025
0feb757
Fettered Monstrosity
Blitz54 Apr 17, 2025
f5c264f
Filthy First-born
Blitz54 Apr 18, 2025
04467bc
experienceMultiplier for Spectre Reservation
Blitz54 Apr 20, 2025
a10c459
Faridun Spearwoman
Blitz54 Apr 21, 2025
6a63272
Better Reservation calcs for spectre
Blitz54 Apr 25, 2025
e5af2ac
Crabs
Blitz54 Apr 28, 2025
acaf8c6
Export Monster Type
Blitz54 Apr 28, 2025
f201da3
Show Spirit Cost in the spectre library window
Blitz54 Apr 29, 2025
d5048aa
Add monster type to library
Blitz54 Apr 29, 2025
c69e0b0
Serpent Shaman and enable spectre curses
Blitz54 Apr 30, 2025
c6a00e2
Initial support for Companion and small calc change for reservedFlat
Blitz54 May 1, 2025
c5916b3
Merge branch 'dev' into spectres
Blitz54 May 1, 2025
0b606eb
Add separate beast library
Blitz54 May 4, 2025
19b59b2
tooltip shows companion reservation now
Blitz54 May 4, 2025
2b69649
Initial import of Companion/Spectre gems
Blitz54 May 7, 2025
9bbe995
Put reservation calcs into exporter
Blitz54 May 7, 2025
28d2a3c
Imports spectres to spectre list
Blitz54 May 7, 2025
c625bf4
import changes and sets current minion to imported one
Blitz54 May 8, 2025
2d026f8
Update Spectre/Companion tooltip reservations, and dynamically update…
Blitz54 May 9, 2025
c5eebf7
Update gem names according to selected spectre - mostly
Blitz54 May 10, 2025
d90afa8
Merge branch 'PathOfBuildingCommunity:dev' into spectres
Blitz54 May 10, 2025
f2e7150
Moved spectre skills to Spectre.lua
Blitz54 May 10, 2025
62885d8
Sync minion dropdown between calc tab and left bar
Blitz54 May 10, 2025
74fcfcd
Gem name updates, and dropdowns for minion are in sync
Blitz54 May 10, 2025
ef7e9bb
Companion uses beast list now
Blitz54 May 10, 2025
59fc4bb
Prowling Shade and potential crash fix
Blitz54 May 10, 2025
002246e
Replace sub prefix check with match
Blitz54 May 10, 2025
a100df5
Clean up gem tooltip code + fix display issue
May 11, 2025
b7ab927
Tooltip fix for companion
Blitz54 May 12, 2025
3ead7e9
Cultist Archer, Witch, Daggerdancer
Blitz54 May 12, 2025
0223b3c
Spectre life fix and "Show minion stats" refixed
Blitz54 May 12, 2025
a222c97
Fix minion ES and life calcs
Blitz54 May 12, 2025
fe03923
Merge branch 'dev' into spectres
May 13, 2025
2907b07
Add Tons of Spectres for import, no skills yet
Blitz54 May 13, 2025
5a143a9
Export list of spectres with unique names
May 14, 2025
ad6b2e5
Remove a few spectres and update exporter
Blitz54 May 14, 2025
8d909de
Initial Spectre Library UI Update
Blitz54 May 14, 2025
b65084c
Export monster category images
May 15, 2025
467e157
Show Monster Images on checkboxes in Spectre Library
Blitz54 May 15, 2025
8aed1df
removed test mob
Blitz54 May 15, 2025
8494f60
Spec stuff for Spawn Locations
Blitz54 May 15, 2025
dd3be9e
Most Spectre Spawn Locations shown in tooltip
Blitz54 May 16, 2025
a754b7a
Prettied up library and actually committed tooltip this time
Blitz54 May 16, 2025
ff91849
Preparation for popular spectre list, and some small fixes
Blitz54 May 17, 2025
0f5bb08
Fix bug on importing build with broken greyed gem
Blitz54 May 17, 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
20 changes: 19 additions & 1 deletion src/Classes/CalcsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,36 @@ local CalcsTabClass = newClass("CalcsTab", "UndoHandler", "ControlHost", "Contro
control = new("DropDownControl", nil, {0, 0, 160, 16}, nil, function(index, value)
local mainSocketGroup = self.build.skillsTab.socketGroupList[self.input.skill_number]
local srcInstance = mainSocketGroup.displaySkillListCalcs[mainSocketGroup.mainActiveSkillCalcs].activeEffect.srcInstance
-- Synchronize DropDownControl between CalcActiveSkill and skillMinionCalcs
if value.itemSetId then
srcInstance.skillMinionItemSetCalcs = value.itemSetId
srcInstance.skillMinionItemSet = value.itemSetId
if srcInstance.nameSpec:match("^Spectre:") then
srcInstance.nameSpec = "Spectre: ".. value.label
elseif srcInstance.nameSpec:match("^Companion:") then
srcInstance.nameSpec = "Companion: ".. value.label
end
else
srcInstance.skillMinionCalcs = value.minionId
srcInstance.skillMinion = value.minionId
if srcInstance.nameSpec:match("^Spectre:") then
srcInstance.nameSpec = "Spectre: ".. value.label
elseif srcInstance.nameSpec:match("^Companion:") then
srcInstance.nameSpec = "Companion: ".. value.label
end
end
self:AddUndoState()
self.build.buildFlag = true
end)
} },
{ label = "Spectre Library", flag = "spectre", { controlName = "mainSkillMinionLibrary",
control = new("ButtonControl", nil, {0, 0, 100, 16}, "Manage Spectres...", function()
self.build:OpenSpectreLibrary()
self.build:OpenSpectreLibrary("spectre")
end)
} },
{ label = "Beast Library", flag = "summonBeast", { controlName = "mainSkillBeastLibrary",
control = new("ButtonControl", nil, {0, 0, 100, 16}, "Manage Beasts...", function()
self.build:OpenSpectreLibrary("beast")
end)
} },
{ label = "Minion Skill", flag = "haveMinion", { controlName = "mainSkillMinionSkill",
Expand Down
16 changes: 15 additions & 1 deletion src/Classes/GemSelectControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,11 @@ function GemSelectClass:AddGemTooltip(gemInstance)
local grantedEffect = gemInstance.gemData.grantedEffect
local additionalEffects = gemInstance.gemData.additionalGrantedEffects

self.tooltip:AddLine(20, colorCodes.GEM .. grantedEffect.name)
if grantedEffect.name:match("^Spectre:") or grantedEffect.name:match("^Companion:") then
self.tooltip:AddLine(20, colorCodes.GEM .. (gemInstance.displayEffect and gemInstance.displayEffect.nameSpec or gemInstance.gemData.name))
else
self.tooltip:AddLine(20, colorCodes.GEM .. grantedEffect.name)
end
self.tooltip:AddSeparator(10)
self.tooltip:AddLine(18, colorCodes.NORMAL .. gemInstance.gemData.gemType)
if gemInstance.gemData.tagString ~= "" then
Expand Down Expand Up @@ -592,9 +596,19 @@ function GemSelectClass:AddGrantedEffectInfo(gemInstance, grantedEffect, addReq)
self.tooltip:AddLine(16, string)
end
else
if gemInstance.skillMinion then
if gemInstance.nameSpec:match("^Spectre:") then
grantedEffectLevel.spiritReservationFlat = data.spectres[gemInstance.skillMinion].spectreReservation
elseif gemInstance.nameSpec:match("^Companion:") then
grantedEffectLevel.spiritReservationPercent = data.spectres[gemInstance.skillMinion].companionReservation
end
end
if grantedEffectLevel.spiritReservationFlat then
self.tooltip:AddLine(16, string.format("^x7F7F7FReservation: ^7%d Spirit", grantedEffectLevel.spiritReservationFlat))
end
if grantedEffectLevel.spiritReservationPercent then
self.tooltip:AddLine(16, string.format("^x7F7F7FReservation: ^7%.1f%% Spirit", grantedEffectLevel.spiritReservationPercent))
end
local cost
for _, res in ipairs(self.costs) do
if grantedEffectLevel.cost and grantedEffectLevel.cost[res.Resource] then
Expand Down
37 changes: 36 additions & 1 deletion src/Classes/ImportTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -691,12 +691,47 @@ function ImportTabClass:ImportItemsAndSkills(charData)
local funcGetGemInstance = function(skillData)
local typeLine = sanitiseText(skillData.typeLine) .. (skillData.support and " Support" or "")
local gemId = self.build.data.gemForBaseName[typeLine:lower()]

if typeLine:match("^Spectre:") then
gemId = "Metadata/Items/Gems/SkillGemSummonSpectre"
end
if typeLine:match("^Companion:") then
gemId = "Metadata/Items/Gems/SkillGemSummonBeast"
end

if gemId then
local gemInstance = { level = 20, quality = 0, enabled = true, enableGlobal1 = true, enableGlobal2 = true, count = 1, gemId = gemId }
gemInstance.nameSpec = self.build.data.gems[gemId].name
gemInstance.support = skillData.support

local spectreList = data.spectres
if typeLine:sub(1, 8) == "Spectre:" then
local spectreName = typeLine:sub(10) -- gets monster name after "Spectre: "
for id, spectre in pairs(spectreList) do
if spectre.name == spectreName then
if not isValueInArray(self.build.spectreList, id) then
t_insert(self.build.spectreList, id)
end
gemInstance.skillMinion = id -- Sets imported minion in dropdown on left
gemInstance.skillMinionCalcs = id-- Sets imported minion in dropdown in calcs tab
break
end
end
end
if typeLine:sub(1, 10) == "Companion:" then
local companionName = typeLine:sub(12)
for id, spectre in pairs(spectreList) do
if spectre.name == companionName then
if not isValueInArray(self.build.beastList, id) then
t_insert(self.build.beastList, id)
end
gemInstance.skillMinion = id
gemInstance.skillMinionCalcs = id
break
end
end
end

gemInstance.nameSpec = self.build.data.gems[gemId].name
for _, property in pairs(skillData.properties) do
if property.name == "Level" then
gemInstance.level = tonumber(property.values[1][1]:match("%d+"))
Expand Down
43 changes: 27 additions & 16 deletions src/Classes/MinionListControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,29 @@ local ipairs = ipairs
local t_insert = table.insert
local t_remove = table.remove
local s_format = string.format
local m_max = math.max

local MinionListClass = newClass("MinionListControl", "ListControl", function(self, anchor, rect, data, list, dest)
local MinionListClass = newClass("MinionListControl", "ListControl", function(self, anchor, rect, data, list, dest, label)
self.ListControl(anchor, rect, 16, "VERTICAL", not dest, list)
self.data = data
self.dest = dest
if dest then
self.dragTargetList = { dest }
self.label = "^7Available Spectres:"
self.controls.add = new("ButtonControl", {"BOTTOMRIGHT",self,"TOPRIGHT"}, {0, -2, 60, 18}, "Add", function()
self:AddSel()
end)
self.controls.add.enabled = function()
return self.selValue ~= nil and not isValueInArray(dest.list, self.selValue)
end
self.dragTargetList = { dest }
self.label = label or "^7Available Spectres:"
self.controls.add = new("ButtonControl", {"BOTTOMRIGHT",self,"TOPRIGHT"}, {0, -2, 60, 18}, "Add", function()
self:AddSel()
end)
self.controls.add.enabled = function()
return self.selValue ~= nil and not isValueInArray(dest.list, self.selValue)
end
else
self.label = "^7Spectres in Build:"
self.controls.delete = new("ButtonControl", {"BOTTOMRIGHT",self,"TOPRIGHT"}, {0, -2, 60, 18}, "Remove", function()
self:OnSelDelete(self.selIndex, self.selValue)
end)
self.controls.delete.enabled = function()
return self.selValue ~= nil
end
self.label = label or "^7Spectres in Build:"
self.controls.delete = new("ButtonControl", {"BOTTOMRIGHT",self,"TOPRIGHT"}, {0, -2, 60, 18}, "Remove", function()
self:OnSelDelete(self.selIndex, self.selValue)
end)
self.controls.delete.enabled = function()
return self.selValue ~= nil
end
end
end)

Expand All @@ -49,6 +50,16 @@ function MinionListClass:AddValueTooltip(tooltip, index, minionId)
if tooltip:CheckForUpdate(minionId) then
local minion = self.data.minions[minionId]
tooltip:AddLine(18, "^7"..minion.name)
if #minion.spawnLocation > 0 then
local coloredLocations = {}
for _, location in ipairs(minion.spawnLocation) do
table.insert(coloredLocations, colorCodes.RELIC .. location)
end
tooltip:AddLine(14, s_format("^7Spawn: %s", table.concat(coloredLocations, ", ")))
end
tooltip:AddLine(14, s_format("^7Spectre Reservation: %s%d", colorCodes.SPIRIT, tostring(minion.spectreReservation)))
tooltip:AddLine(14, s_format("^7Companion Reservation: %s%s%%", colorCodes.SPIRIT, tostring(minion.companionReservation)))
tooltip:AddLine(14, "^7Category: "..minion.monsterCategory)
tooltip:AddLine(14, s_format("^7Life Multiplier: x%.2f", minion.life))
if minion.energyShield then
tooltip:AddLine(14, s_format("^7Energy Shield: %d%% of base Life", minion.energyShield * 100))
Expand Down
6 changes: 3 additions & 3 deletions src/Classes/MinionSearchListControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ local t_insert = table.insert
local t_remove = table.remove
local s_format = string.format

local MinionSearchListClass = newClass("MinionSearchListControl", "MinionListControl", function(self, anchor, rect, data, list, dest)
self.MinionListControl(anchor, rect, data, list, dest)
local MinionSearchListClass = newClass("MinionSearchListControl", "MinionListControl", function(self, anchor, rect, data, list, dest, label)
self.MinionListControl(anchor, rect, data, list, dest, label)
self.unfilteredList = copyTable(list)
self.isMutable = false

self.controls.searchText = new("EditControl", {"BOTTOMLEFT",self,"TOPLEFT"}, {0, -2, 128, 18}, "", "Search", "%c", 100, function(buf)
self.controls.searchText = new("EditControl", {"BOTTOMLEFT",self,"TOPLEFT"}, {0, -2, 148, 18}, "", "Search", "%c", 100, function(buf)
self:ListFilterChanged(buf, self.controls.searchModeDropDown.selIndex)
end, nil, nil, true)

Expand Down
12 changes: 9 additions & 3 deletions src/Classes/SkillsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ function SkillsTabClass:LoadSkill(node, skillSetId)
if gemData then
gemInstance.gemId = gemData.id
gemInstance.skillId = gemData.grantedEffectId
gemInstance.nameSpec = gemData.nameSpec
if gemData.nameSpec then
gemInstance.nameSpec = gemData.nameSpec
end
end
elseif child.attrib.skillId then
local grantedEffect = self.build.data.skills[child.attrib.skillId]
Expand Down Expand Up @@ -1028,7 +1030,11 @@ function SkillsTabClass:ProcessSocketGroup(socketGroup)
gemInstance.errMsg = nil
gemInstance.gemData = data.gems[gemInstance.gemId]
if gemInstance.gemData then
gemInstance.nameSpec = gemInstance.gemData.name
if gemInstance.nameSpec:match("^Companion:") or gemInstance.nameSpec:match("^Spectre:") then
gemInstance.nameSpec = gemInstance.nameSpec
else
gemInstance.nameSpec = gemInstance.gemData.name
end
gemInstance.skillId = gemInstance.gemData.grantedEffectId
end
elseif gemInstance.skillId then
Expand Down Expand Up @@ -1155,7 +1161,7 @@ function SkillsTabClass:AddSocketGroupTooltip(tooltip, socketGroup)
tooltip:AddLine(16, "^7Active Skill #" .. index .. "'s Main Minion Skill:")
local activeEffect = activeSkill.minion.mainSkill.effectList[1]
tooltip:AddLine(20, string.format("%s%s ^7%d/%d",
data.skillColorMap[activeEffect.grantedEffect.color],
data.skillColorMap[activeEffect.grantedEffect.color] or colorCodes.NORMAL,
activeEffect.grantedEffect.name,
activeEffect.level,
activeEffect.quality
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/Tooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,6 @@ function TooltipClass:Draw(x, y, w, h, viewPort)
end
DrawImage(nil, ttX, ttY, ttW * columns, BORDER_WIDTH) -- top border
DrawImage(nil, ttX, ttY + maxColumnHeight - BORDER_WIDTH, ttW * columns, BORDER_WIDTH) -- bottom border

SetDrawColor(1, 1, 1) -- Reset draw color to white as it messes with Spectre Library
return ttW, ttH
end
Loading