Skip to content

Commit 500d97e

Browse files
LocalIdentityLocalIdentity
andauthored
Add support for Effect of Socketed Augments mod (#2298)
The mod is very similar to the other soul core and rune effect mods we already supported This now supports the mod on gloves and also the mod on Darkness Enthroned Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 085bd41 commit 500d97e

4 files changed

Lines changed: 44 additions & 12 deletions

File tree

spec/System/TestItemParse_spec.lua

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,28 @@ describe("TestItemParse", function()
591591
assert.is_not_nil(item:BuildRaw():match("{enchant}{rune}Gain 18%% of Damage as Extra Fire Damage"))
592592
end)
593593

594+
it("applies increased effect of socketed augment items", function()
595+
local item = new("Item", [[
596+
Test Wand
597+
Runic Fork
598+
Sockets: S
599+
Rune: Lesser Desert Rune
600+
Implicits: 1
601+
{enchant}{rune}Gain 6% of Damage as Extra Fire Damage
602+
100% increased effect of Socketed Augment Items
603+
]])
604+
item:BuildAndParseRaw()
605+
606+
local damageGainAsFire = 0
607+
for _, mod in ipairs(item.slotModList[1]) do
608+
if mod.name == "DamageGainAsFire" and mod.type == "BASE" then
609+
damageGainAsFire = damageGainAsFire + mod.value
610+
end
611+
end
612+
assert.are.equals(12, damageGainAsFire)
613+
assert.is_not_nil(item:BuildRaw():match("{enchant}{rune}Gain 12%% of Damage as Extra Fire Damage"))
614+
end)
615+
594616
it("does not double-scale imported socketed rune text", function()
595617
local item = new("Item", [[
596618
Runeseeker's Call

src/Classes/Item.lua

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,13 +1140,13 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
11401140
table.sort(runes, function(a, b) return compareRuneValueSets(a.values, b.values) end)
11411141
end
11421142

1143-
local gameSocketedRuneEffectModifier = 0
1143+
local gameSocketedAugmentEffectModifier = 0
11441144
if mode == "GAME" and shouldFixRunesOnItem then
11451145
for _, modLines in ipairs({ self.enchantModLines, self.implicitModLines, self.explicitModLines }) do
11461146
for _, effectModLine in ipairs(modLines) do
11471147
for _, mod in ipairs(effectModLine.modList or { }) do
1148-
if mod.name == "SocketedRuneEffect" and mod.type == "INC" then
1149-
gameSocketedRuneEffectModifier = gameSocketedRuneEffectModifier + mod.value / 100
1148+
if (mod.name == "SocketedRuneEffect" or mod.name == "SocketedAugmentItemEffect") and mod.type == "INC" then
1149+
gameSocketedAugmentEffectModifier = gameSocketedAugmentEffectModifier + mod.value / 100
11501150
end
11511151
end
11521152
end
@@ -1160,10 +1160,10 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
11601160
if groupedRunes and not modLine.bonded then -- found the rune category with the relevant stat.
11611161
local result, numRunes
11621162
local socketedRuneEffectAlreadyApplied
1163-
if gameSocketedRuneEffectModifier ~= 0 then
1163+
if gameSocketedAugmentEffectModifier ~= 0 then
11641164
local unscaledTargetValues = { }
11651165
for valueIndex, value in ipairs(targetValues) do
1166-
unscaledTargetValues[valueIndex] = value / (1 + gameSocketedRuneEffectModifier)
1166+
unscaledTargetValues[valueIndex] = value / (1 + gameSocketedAugmentEffectModifier)
11671167
end
11681168
result, numRunes = findRuneCombination(groupedRunes, unscaledTargetValues, remainingRunes)
11691169
socketedRuneEffectAlreadyApplied = result ~= nil
@@ -1604,8 +1604,12 @@ end
16041604

16051605
function ItemClass:ApplySocketedRuneDisplayScalars()
16061606
for _, modLine in ipairs(self.runeModLines or { }) do
1607-
local effectModifier = modLine.augmentType == "SoulCore" and (self.socketedSoulCoreEffectModifier or 0)
1608-
or modLine.augmentType == "Rune" and (self.socketedRuneEffectModifier or 0)
1607+
local effectModifier = self.socketedAugmentItemEffectModifier or 0
1608+
if modLine.augmentType == "SoulCore" then
1609+
effectModifier = effectModifier + (self.socketedSoulCoreEffectModifier or 0)
1610+
elseif modLine.augmentType == "Rune" then
1611+
effectModifier = effectModifier + (self.socketedRuneEffectModifier or 0)
1612+
end
16091613
if effectModifier and effectModifier ~= 0 and not modLine.socketedRuneEffectAlreadyApplied then
16101614
modLine.displayValueScalar = 1 + effectModifier
16111615
else
@@ -2105,12 +2109,17 @@ function ItemClass:BuildModList()
21052109
end
21062110
self.socketedSoulCoreEffectModifier = calcLocal(baseList, "SocketedSoulCoreEffect", "INC", 0) / 100
21072111
self.socketedRuneEffectModifier = calcLocal(baseList, "SocketedRuneEffect", "INC", 0) / 100
2112+
self.socketedAugmentItemEffectModifier = calcLocal(baseList, "SocketedAugmentItemEffect", "INC", 0) / 100
21082113
if self.runeModLines[1] then
21092114
self:ApplySocketedRuneDisplayScalars()
21102115
end
21112116
for _, modLine in ipairs(self.runeModLines) do
2112-
local effectModifier = modLine.augmentType == "SoulCore" and self.socketedSoulCoreEffectModifier
2113-
or modLine.augmentType == "Rune" and self.socketedRuneEffectModifier
2117+
local effectModifier = self.socketedAugmentItemEffectModifier or 0
2118+
if modLine.augmentType == "SoulCore" then
2119+
effectModifier = effectModifier + self.socketedSoulCoreEffectModifier
2120+
elseif modLine.augmentType == "Rune" then
2121+
effectModifier = effectModifier + self.socketedRuneEffectModifier
2122+
end
21142123
if effectModifier and effectModifier ~= 0 and self:CheckModLineVariant(modLine) and not modLine.extra and not modLine.socketedRuneEffectAlreadyApplied then
21152124
for _, mod in ipairs(modLine.modList) do
21162125
baseList:ScaleAddMod(mod, effectModifier)
@@ -2226,4 +2235,4 @@ function ItemClass:BuildModList()
22262235
else
22272236
self.modList = self:BuildModListForSlotNum(baseList)
22282237
end
2229-
end
2238+
end

src/Data/ModCache.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,8 +1386,8 @@ c["100% increased Thorns damage"]={{[1]={flags=32,keywordFlags=0,name="Damage",t
13861386
c["100% increased Thorns damage if you've consumed an Endurance Charge Recently"]={{[1]={[1]={limit=1,type="Multiplier",var="RemovableEnduranceCharge"},flags=32,keywordFlags=0,name="Damage",type="INC",value=100}},nil}
13871387
c["100% increased amount of Life Leeched"]={{[1]={flags=0,keywordFlags=0,name="MaxLifeLeechRate",type="INC",value=100}},nil}
13881388
c["100% increased chance to Shock"]={{[1]={flags=0,keywordFlags=0,name="EnemyShockChance",type="INC",value=100}},nil}
1389-
c["100% increased effect of Socketed Augment Items"]={{[1]={flags=0,keywordFlags=0,name="LocalEffect",type="INC",value=100}}," of Socketed Augment Items "}
1390-
c["100% increased effect of Socketed Augment Items This item gains bonuses from Socketed Items as though it was a Body Armour"]={{[1]={flags=0,keywordFlags=0,name="LocalEffect",type="INC",value=100}}," of Socketed Augment Items This item gains bonuses from Socketed Items as though it was a Body Armour "}
1389+
c["100% increased effect of Socketed Augment Items"]={{[1]={flags=0,keywordFlags=0,name="SocketedAugmentItemEffect",type="INC",value=100}},nil}
1390+
c["100% increased effect of Socketed Augment Items This item gains bonuses from Socketed Items as though it was a Body Armour"]={{[1]={flags=0,keywordFlags=0,name="SocketedAugmentItemEffect",type="INC",value=100}}," This item gains bonuses from Socketed Items as though it was a Body Armour "}
13911391
c["100% increased effect of Socketed Soul Cores"]={{[1]={flags=0,keywordFlags=0,name="SocketedSoulCoreEffect",type="INC",value=100}},nil}
13921392
c["100% increased maximum Divinity"]={{}," maximum Divinity "}
13931393
c["100% increased maximum Divinity 20% reduced maximum Divinity per Corrupted Item Equipped"]={{}," maximum Divinity 20% reduced maximum Divinity per Corrupted Item Equipped "}

src/Modules/ModParser.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,7 @@ local modNameList = {
897897
["effect of socketed abyss jewels"] = "SocketedJewelEffect",
898898
["effect of socketed soul cores"] = "SocketedSoulCoreEffect",
899899
["effect of socketed runes"] = "SocketedRuneEffect",
900+
["effect of socketed augment items"] = "SocketedAugmentItemEffect",
900901
["to inflict fire exposure on hit"] = "FireExposureChance",
901902
["to apply fire exposure on hit"] = "FireExposureChance",
902903
["to inflict cold exposure on hit"] = "ColdExposureChance",

0 commit comments

Comments
 (0)