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
42 changes: 36 additions & 6 deletions src/Modules/CalcSetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,40 @@
radiusJewelStats[index] = {
isNotable = (line:match("^(%S+)") == "Notable"),
toAdd = (line:find("also% grant")~= nil), -- only add mods with the "also grant" text to radiusNodes
sd = line:gsub(".*grant ", ""):gsub("%(.-%)", value)
sdLine = line:gsub(".*grant ", ""):gsub("%(.-%)", value)
}
if line:lower():match("increased effect of small passive skills in radius") then
return tonumber(line:match("%d+"))
end
end
local function mergeStats(node, sd, spec)
-- copy the original tree node so we ignore the mods being added from the jewel
local nodeCopy = copyTable(spec.tree.nodes[node.id], true)
local nodeNumber = 0
local nodeString = ""
local modToAddNumber = 0
local modToAddString = ""

-- loop the original node mods and compare to the jewel mod we want to add
-- if the strings without the numbers are identical, the mods should be identical
-- if so, update the node's version of the mod and do not add the jewel mods to the list
-- otherwise, add the jewel mod because it's unique/new to the node
for index, nodeSd in ipairs(nodeCopy.sd) do
nodeString = nodeSd:gsub("(%d+)", function(number)
nodeNumber = number
return ""
end)
modToAddString = sd:gsub("(%d+)", function(number)
modToAddNumber = number
return ""
end)
if nodeString == modToAddString then
node.sd[index] = node.sd[index]:gsub("(%d+)", (nodeNumber + modToAddNumber))
return
end
end
t_insert(node.sd, sd)
end
-- grab the stat lines from the selected variants on the jewel to add to the nodes
-- e.g. Against the Darkness or Time-Lost jewels
local function setRadiusJewelStats(radiusJewel, radiusJewelStats)
Expand Down Expand Up @@ -160,9 +188,9 @@
incEffect = setRadiusJewelStats(jewel, radiusJewelStats)
for _, stat in ipairs(radiusJewelStats) do
-- the node and stat types match, add sd to node if it's not already there and it's an 'also grant' mod
if not isValueInTable(node.sd, stat.sd) and ((node.type == "Notable" and stat.isNotable) or (node.type == "Normal" and not stat.isNotable))
if not isValueInTable(node.sd, stat.sdLine) and ((node.type == "Notable" and stat.isNotable) or (node.type == "Normal" and not stat.isNotable))
and stat.toAdd then
t_insert(node.sd, stat.sd)
mergeStats(node, stat.sdLine, spec)
end
end
-- if there's an incEffect of Small Passives mod on the jewel and the node is small, scale all numbers
Expand All @@ -184,7 +212,7 @@
-- if the Time-Lost jewel is socketed, add the stat
if itemsTab.activeSocketList then
for _, nodeId in pairs(itemsTab.activeSocketList) do
local socketIndex, socketedJewel = itemsTab:GetSocketAndJewelForNodeID(nodeId)
local _, socketedJewel = itemsTab:GetSocketAndJewelForNodeID(nodeId)
if socketedJewel and socketedJewel.baseName:find("Time%-Lost") == 1 then
addStats(jewel, node, spec)
end
Expand Down Expand Up @@ -282,7 +310,7 @@
table.insert(mod, { type = "Condition", var = "WeaponSet".. node.allocMode })
end
end

-- Apply Inc Node scaling from Hulking Form
if incSmallPassiveSkill > 0 and node.type == "Normal" and not node.isAttribute and not node.ascendancyName then
local scale = 1 + incSmallPassiveSkill / 100
Expand Down Expand Up @@ -329,7 +357,9 @@

-- Finalise radius jewels
for _, rad in pairs(env.radiusJewelList) do
rad.func(nil, modList, rad.data)
if rad.item.baseName:find("Time%-Lost") == nil then
rad.func(nil, modList, rad.data)
end
if env.mode == "MAIN" then
if not rad.item.jewelRadiusData then
rad.item.jewelRadiusData = { }
Expand Down Expand Up @@ -764,7 +794,7 @@
modDB:NewMod("Multiplier:AllocatedLifeMastery", "BASE", allocatedMasteryTypes["Life Mastery"])
end

-- add Conditional WeaponnSet# base on weapon set from item

Check warning on line 797 in src/Modules/CalcSetup.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Weaponn)
modDB:NewMod("Condition:WeaponSet" .. (build.itemsTab.activeItemSet.useSecondWeaponSet and 2 or 1) , "FLAG", true, "Weapon Set")

-- Build and merge item modifiers, and create list of radius jewels
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2818,7 +2818,7 @@
} end,
["gain maximum life instead of maximum energy shield from equipped armour items"] = { flag("ConvertArmourESToLife") },
-- Mercenary - Gemling
["attribute requirements of gems can be satisi?fied by your highest attribute"] = { flag("GemAttributeRequirementsSatisfiedByHighestAttribute") },

Check warning on line 2821 in src/Modules/ModParser.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (satisi)

Check warning on line 2821 in src/Modules/ModParser.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (fied)
["you can use two copies of the same support gem in different skills"] = { mod("MaxSupportGemCopies", "OVERRIDE", 2) },
-- Monk - Stormweaver
["targets can be affected by two of your shocks at the same time"] = { flag("ShockCanStack"), mod("ShockStacksMax", "OVERRIDE", 2) },
Expand Down Expand Up @@ -5232,7 +5232,6 @@
["nearby allies have (%d+)%% chance to block attack damage per (%d+) strength you have"] = function(block, _, str) return {
mod("ExtraAura", "LIST", { onlyAllies = true, mod = mod("BlockChance", "BASE", block) }, { type = "PerStat", stat = "Str", div = tonumber(str) }),
} end,
["(%d+)%% increased effect of small passive skills in radius"] = { },
}
for _, name in pairs(data.keystones) do
specialModList[name:lower()] = { mod("Keystone", "LIST", name) }
Expand Down Expand Up @@ -5491,6 +5490,7 @@
end
end
end,
["(%d+)%% increased Effect of Small Passive Skills in Radius"] = function(node, out, data) end,
["50% increased Effect of non-Keystone Passive Skills in Radius"] = function(node, out, data)
if node and node.type ~= "Keystone" then
out:NewMod("PassiveSkillEffect", "INC", 50, data.modSource)
Expand Down
Loading