Fix Runegraft bonus for Boots / Gloves not working (#8746)

Needs to be handled later to work with nodes on the tree.
Not sure if removing the restriction for scaling a mod below 0 will cause issues elsewhere

Co-authored-by: LocalIdentity <localidentity2@gmail.com>
This commit is contained in:
LocalIdentity
2025-06-30 17:11:23 +10:00
committed by GitHub
parent 8e93b63c81
commit 386878146e
2 changed files with 23 additions and 17 deletions

View File

@@ -45,7 +45,6 @@ function ModStoreClass:ScaleAddMod(mod, scale)
if scale == 1 or unscalable then
self:AddMod(mod)
else
scale = m_max(scale, 0)
local scaledMod = copyTable(mod)
local subMod = scaledMod
if type(scaledMod.value) == "table" then

View File

@@ -1042,22 +1042,6 @@ function calcs.initEnv(build, mode, override, specEnv)
combinedList:MergeMod(mod)
end
env.itemModDB:ScaleAddList(combinedList, scale)
elseif item.type == "Gloves" and items["Gloves"] then
local bonusMod=(1 + (env.modDB:Sum("INC", nil, "EffectOfBonusesFromGloves") or 100) / 100)
scale = scale * bonusMod
local combinedList = new("ModList")
for _, mod in ipairs(srcList) do
combinedList:MergeMod(mod)
end
env.itemModDB:ScaleAddList(combinedList, scale)
elseif item.type == "Boots" and items["Boots"] then
local bonusMod=(1 + (env.modDB:Sum("INC", nil, "EffectOfBonusesFromBoots") or 100) / 100)
scale = scale * bonusMod
local combinedList = new("ModList")
for _, mod in ipairs(srcList) do
combinedList:MergeMod(mod)
end
env.itemModDB:ScaleAddList(combinedList, scale)
elseif env.modDB.multipliers["CorruptedMagicJewelEffect"] and item.type == "Jewel" and item.rarity == "MAGIC" and item.corrupted and slot.nodeId and item.base.subType ~= "Charm" then
scale = scale + env.modDB.multipliers["CorruptedMagicJewelEffect"]
local combinedList = new("ModList")
@@ -1202,6 +1186,29 @@ function calcs.initEnv(build, mode, override, specEnv)
return calcs.initEnv(build, mode, override, specEnv)
end
end
if env.player.itemList["Gloves"] then
local gloveEffectMod = env.modDB:Sum("INC", nil, "EffectOfBonusesFromGloves") / 100
if gloveEffectMod ~= 0 then
local modList = env.player.itemList["Gloves"].modList
for _, mod in ipairs(modList) do
local modCopy = copyTable(mod)
modCopy.source = "Many Sources:" .. tostring(gloveEffectMod * 100) .. "% Gloves Bonus Effect"
modDB:ScaleAddMod(modCopy, gloveEffectMod)
end
end
end
if env.player.itemList["Boots"] then
local bootEffectMod = env.modDB:Sum("INC", nil, "EffectOfBonusesFromBoots") / 100
if bootEffectMod ~= 0 then
local modList = env.player.itemList["Boots"].modList
for _, mod in ipairs(modList) do
local modCopy = copyTable(mod)
modCopy.source = "Many Sources:" .. tostring(bootEffectMod * 100) .. "% Boots Bonus Effect"
modDB:ScaleAddMod(modCopy, bootEffectMod)
end
end
end
-- Find skills granted by tree nodes
if not accelerate.nodeAlloc then