Skip to content

Commit 88e11e4

Browse files
authored
Add support for Mahuxotl's Machination (#521)
* Add support for Mahuxotl's Machination * Refactor * Fix tab * Fix scaling * Check if soul core effect modifier exists on an item * Naming
1 parent 55588d6 commit 88e11e4

File tree

4 files changed

+36
-14
lines changed

4 files changed

+36
-14
lines changed

src/Classes/Item.lua

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -777,21 +777,25 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
777777
-- this will need more advanced logic for jewel sockets in items to work properly but could just be removed as items like this was only introduced during development.
778778
if self.base then
779779
if self.base.weapon or self.base.armour then
780-
if #self.runes == 0 then
781-
for i, modLine in ipairs(self.runeModLines) do
782-
local value
783-
local strippedModeLine = modLine.line:gsub("(%d%.?%d*)", function(val)
784-
value = val
780+
local shouldFixRunesOnItem = #self.runes == 0
781+
782+
for i, modLine in ipairs(self.runeModLines) do
783+
local value
784+
local strippedModeLine = modLine.line:gsub("(%d%.?%d*)", function(val)
785+
value = val
786+
return "#"
787+
end)
788+
for name, runeMods in pairs(data.itemMods.Runes) do
789+
local runeValue
790+
local runeStrippedModeLine = (self.base.weapon and runeMods.weapon or runeMods.armour)[1]:gsub("(%d%.?%d*)", function(val)
791+
runeValue = val
785792
return "#"
786793
end)
787-
for name, runeMods in pairs(data.itemMods.Runes) do
788-
local runeValue
789-
local runeStrippedModeLine = (self.base.weapon and runeMods.weapon or runeMods.armour)[1]:gsub("(%d%.?%d*)", function(val)
790-
runeValue = val
791-
return "#"
792-
end)
793-
if strippedModeLine == runeStrippedModeLine then
794-
for i = 1, round(value/runeValue) do
794+
if strippedModeLine == runeStrippedModeLine then
795+
modLine.soulcore = name:match("Soul Core") ~= nil
796+
modLine.runeCount = round(value/runeValue)
797+
if shouldFixRunesOnItem then
798+
for i = 1, modLine.runeCount do
795799
t_insert(self.runes, name)
796800
end
797801
end
@@ -1617,4 +1621,5 @@ function ItemClass:BuildModList()
16171621
else
16181622
self.modList = self:BuildModListForSlotNum(baseList)
16191623
end
1624+
self.socketedSoulCoreEffectModifier = calcLocal(baseList, "SocketedSoulCoreEffect", "INC", 0) / 100
16201625
end

src/Data/ModCache.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1889,6 +1889,7 @@ c["50% reduced effect of Ignite on you 50% reduced effect of Shock on you"]={{[1
18891889
c["50% reduced effect of Shock on you"]={{[1]={flags=0,keywordFlags=0,name="SelfShockEffect",type="INC",value=-50}},nil}
18901890
c["500% increased Armour"]={{[1]={flags=0,keywordFlags=0,name="Armour",type="INC",value=500}},nil}
18911891
c["500% increased Armour and Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="ArmourAndEnergyShield",type="INC",value=500}},nil}
1892+
c["500% increased effect of Socketed Soul Cores"]={{[1]={flags=0,keywordFlags=0,name="SocketedSoulCoreEffect",type="INC",value=500}},nil}
18921893
c["53% increased Chaos Damage"]={{[1]={flags=0,keywordFlags=0,name="ChaosDamage",type="INC",value=53}},nil}
18931894
c["6 Life Regeneration per second"]={{[1]={flags=0,keywordFlags=0,name="LifeRegen",type="BASE",value=6}},nil}
18941895
c["6 Life gained when you Block"]={{[1]={flags=0,keywordFlags=0,name="LifeOnBlock",type="BASE",value=6}},nil}
@@ -1959,7 +1960,7 @@ c["65% increased Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="EnergyShiel
19591960
c["65% increased Evasion Rating"]={{[1]={flags=0,keywordFlags=0,name="Evasion",type="INC",value=65}},nil}
19601961
c["65% increased Evasion and Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="EvasionAndEnergyShield",type="INC",value=65}},nil}
19611962
c["666% increased Armour and Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="ArmourAndEnergyShield",type="INC",value=666}},nil}
1962-
c["666% increased effect of Socketed Soul Cores"]={{[1]={flags=0,keywordFlags=0,name="LocalEffect",type="INC",value=666}}," of Socketed Soul Cores "}
1963+
c["666% increased effect of Socketed Soul Cores"]={{[1]={flags=0,keywordFlags=0,name="SocketedSoulCoreEffect",type="INC",value=666}},nil}
19631964
c["7% chance to Gain 100% of Damage with Hits as Extra Chaos Damage"]={{[1]={flags=4,keywordFlags=0,name="DamageGainAsChaos",type="BASE",value=7}},nil}
19641965
c["7% increased Attributes"]={{[1]={flags=0,keywordFlags=0,name="Str",type="INC",value=7},[2]={flags=0,keywordFlags=0,name="Dex",type="INC",value=7},[3]={flags=0,keywordFlags=0,name="Int",type="INC",value=7},[4]={flags=0,keywordFlags=0,name="All",type="INC",value=7}},nil}
19651966
c["7% increased Chaos Damage"]={{[1]={flags=0,keywordFlags=0,name="ChaosDamage",type="INC",value=7}},nil}

src/Modules/CalcSetup.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,21 @@ function calcs.initEnv(build, mode, override, specEnv)
10381038
end
10391039
end
10401040
env.itemModDB.multipliers["RunesSocketedIn"..slotName] = socketed
1041+
1042+
if item.socketedSoulCoreEffectModifier ~= 0 then
1043+
for _, modLine in ipairs(item.runeModLines) do
1044+
if modLine.soulcore then
1045+
for _, mod in ipairs(modLine.modList) do
1046+
local modCopy = copyTable(mod)
1047+
modCopy.value = round(modCopy.value / modLine.runeCount)
1048+
for i = 1, modLine.runeCount do
1049+
env.itemModDB:ScaleAddMod(modCopy, item.socketedSoulCoreEffectModifier)
1050+
end
1051+
end
1052+
end
1053+
end
1054+
end
1055+
10411056
if item.type == "Jewel" and item.base.subType == "Abyss" then
10421057
-- Update Abyss Jewel conditions/multipliers
10431058
local cond = "Have"..item.baseName:gsub(" ","")

src/Modules/ModParser.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,7 @@ local modNameList = {
776776
["attribute requirements"] = { "StrRequirement", "DexRequirement", "IntRequirement" },
777777
["effect of socketed jewels"] = "SocketedJewelEffect",
778778
["effect of socketed abyss jewels"] = "SocketedJewelEffect",
779+
["effect of socketed soul cores"] = "SocketedSoulCoreEffect",
779780
["to inflict fire exposure on hit"] = "FireExposureChance",
780781
["to apply fire exposure on hit"] = "FireExposureChance",
781782
["to inflict cold exposure on hit"] = "ColdExposureChance",

0 commit comments

Comments
 (0)