Skip to content
Open
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
41 changes: 41 additions & 0 deletions spec/System/TestScaeva_spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
describe("Scaeva empty sockets", function()
before_each(function()
newBuild()
build.configTab.input.customMods = "+1000 to Armour\n+1000 to Evasion Rating\n+1000 to maximum Energy Shield\n+1000 to Ward"
build.configTab:BuildModList()
end)

local function equip(raw, slot)
local item = new("Item"):Item(raw)
build.itemsTab:AddItem(item, true)
build.itemsTab.slots[slot]:SetSelItemId(item.id)
build.buildFlag = true
return item
end

for _, slot in ipairs({ "Weapon 1", "Weapon 2" }) do
it("applies global defences only per empty socket in " .. slot, function()
-- Other equipped sockets must not contribute to Scaeva's bonus.
equip("Rarity: NORMAL\nIron Hat\nSockets: W-W-W-W\nImplicits: 0", "Helmet")
for _, occupied in ipairs({ 0, 1, 3 }) do
build.skillsTab.socketGroupList = { }
build.skillsTab:PasteSocketGroup("Slot: " .. slot .. "\n" .. ("Fireball 1/0 1\n"):rep(occupied))
equip("Rarity: UNIQUE\nScaeva\nGladius\nSockets: R-G-B\nImplicits: 0\n8% increased Global Defences per Empty Socket", slot)
runCallback("OnFrame")
local actual = build.calcsTab.mainOutput
local armour, evasion, energyShield = actual.Armour, actual.Evasion, actual.EnergyShield
local ward = actual.Ward
assert.is_true(ward > 0)

-- Three sockets minus the occupied ones, at 8% per empty socket.
local bonus = 8 * (3 - occupied)
equip("Rarity: UNIQUE\nScaeva\nGladius\nSockets: R-G-B\nImplicits: 0\n" .. bonus .. "% increased Global Defences", slot)
runCallback("OnFrame")
assert.are.equals(build.calcsTab.mainOutput.Armour, armour)
assert.are.equals(build.calcsTab.mainOutput.Evasion, evasion)
assert.are.equals(build.calcsTab.mainOutput.EnergyShield, energyShield)
assert.are.equals(build.calcsTab.mainOutput.Ward, ward)
end
end)
end
end)
9 changes: 4 additions & 5 deletions src/Data/ModCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11203,7 +11203,7 @@ c["7% increased Energy Shield Recovery rate"]={{[1]={flags=0,keywordFlags=0,name
c["7% increased Fire Damage"]={{[1]={flags=0,keywordFlags=0,name="FireDamage",type="INC",value=7}},nil}
c["7% increased Flask Effect Duration"]={{[1]={flags=0,keywordFlags=0,name="FlaskDuration",type="INC",value=7}},nil}
c["7% increased Global Defences"]={{[1]={[1]={type="Global"},flags=0,keywordFlags=0,name="Defences",type="INC",value=7}},nil}
c["7% increased Global Defences per Empty Socket"]={{[1]={[1]={type="Global"},flags=0,keywordFlags=0,name="Defences",type="INC",value=7}}," per Empty Socket "}
c["7% increased Global Defences per Empty Socket"]={{[1]={[1]={type="Global"},[2]={type="Multiplier",var="EmptySocketIn{SlotName}"},flags=0,keywordFlags=0,name="Defences",type="INC",value=7}},nil}
c["7% increased Global Physical Damage"]={{[1]={[1]={type="Global"},flags=0,keywordFlags=0,name="PhysicalDamage",type="INC",value=7}},nil}
c["7% increased Ignite Duration on Enemies"]={{[1]={flags=0,keywordFlags=0,name="EnemyIgniteDuration",type="INC",value=7}},nil}
c["7% increased Impale Effect"]={{[1]={flags=0,keywordFlags=0,name="ImpaleEffect",type="INC",value=7}},nil}
Expand Down Expand Up @@ -11563,8 +11563,7 @@ c["8% increased Flask Mana Recovery rate"]={{[1]={flags=0,keywordFlags=0,name="F
c["8% increased Global Accuracy Rating"]={{[1]={[1]={type="Global"},flags=0,keywordFlags=0,name="Accuracy",type="INC",value=8}},nil}
c["8% increased Global Critical Strike Chance"]={{[1]={[1]={type="Global"},flags=0,keywordFlags=0,name="CritChance",type="INC",value=8}},nil}
c["8% increased Global Defences"]={{[1]={[1]={type="Global"},flags=0,keywordFlags=0,name="Defences",type="INC",value=8}},nil}
c["8% increased Global Defences per Empty Socket"]={{[1]={[1]={type="Global"},flags=0,keywordFlags=0,name="Defences",type="INC",value=8}}," per Empty Socket "}
c["8% increased Global Defences per Empty Socket 8% increased Global Defences per White Socket"]={{[1]={[1]={type="Global"},[2]={type="Multiplier",var="WhiteSocketIn{SlotName}"},flags=0,keywordFlags=0,name="Defences",type="INC",value=8}}," per Empty Socket 8% increased Global Defences "}
c["8% increased Global Defences per Empty Socket"]={{[1]={[1]={type="Global"},[2]={type="Multiplier",var="EmptySocketIn{SlotName}"},flags=0,keywordFlags=0,name="Defences",type="INC",value=8}},nil}
c["8% increased Global Defences per White Socket"]={{[1]={[1]={type="Global"},[2]={type="Multiplier",var="WhiteSocketIn{SlotName}"},flags=0,keywordFlags=0,name="Defences",type="INC",value=8}},nil}
c["8% increased Global Physical Damage"]={{[1]={[1]={type="Global"},flags=0,keywordFlags=0,name="PhysicalDamage",type="INC",value=8}},nil}
c["8% increased Impale Effect"]={{[1]={flags=0,keywordFlags=0,name="ImpaleEffect",type="INC",value=8}},nil}
Expand Down Expand Up @@ -15005,8 +15004,8 @@ c["Damage of Enemies Hitting you is Unlucky while you are on Full Life"]={nil,"D
c["Damage of Enemies Hitting you is Unlucky while you are on Low Life"]={nil,"Damage of Enemies Hitting you is Unlucky while you are on Low Life "}
c["Damage of Enemies Hitting you is Unlucky while you have a Magic Ring Equipped"]={nil,"Damage of Enemies Hitting you is Unlucky while you have a Magic Ring Equipped "}
c["Damage of Enemies Hitting you is Unlucky while you have a Magic Ring Equipped You are Hexproof if you have a Magic Ring in right slot"]={nil,"Damage of Enemies Hitting you is Unlucky while you have a Magic Ring Equipped You are Hexproof if you have a Magic Ring in right slot "}
end)();(function()
c["Damage of Hits against you is Lucky"]={nil,"Damage of Hits is Lucky "}
end)();(function()
c["Damage over Time Multiplier for Ailments is equal to Critical Strike Multiplier"]={{[1]={flags=0,keywordFlags=0,name="DotMultiplierIsCritMultiplier",type="FLAG",value=true}},nil}
c["Damage taken bypasses Unbroken Ward if the Hit deals less Damage than 15% of Ward"]={{[1]={flags=0,keywordFlags=0,name="WardBypassBelowPercent",type="BASE",value=15}},nil}
c["Damage taken from Blocked Hits cannot bypass Energy Shield"]={{[1]={[1]={neg=true,type="Condition",var="EVBypass"},flags=0,keywordFlags=0,name="BlockedDamageDoesntBypassES",type="FLAG",value=true}},nil}
Expand Down Expand Up @@ -20007,8 +20006,8 @@ c["Skills Socketed in your Boots are Supported by level 20 Impale"]={{[1]={[1]={
c["Skills Socketed in your Boots are Supported by level 20 Increased Area of Effect"]={{[1]={[1]={slotName="Boots",type="SocketedIn"},flags=0,keywordFlags=0,name="ExtraSupport",type="LIST",value={appliesToGrantedSkills=true,level=20,skillId="SupportIncreasedAreaOfEffect"}}},nil}
c["Skills Socketed in your Boots are Supported by level 20 Increased Critical Damage"]={{[1]={[1]={slotName="Boots",type="SocketedIn"},flags=0,keywordFlags=0,name="ExtraSupport",type="LIST",value={appliesToGrantedSkills=true,level=20,skillId="SupportIncreasedCriticalDamage"}}},nil}
c["Skills Socketed in your Boots are Supported by level 20 Increased Critical Strikes"]={{[1]={[1]={slotName="Boots",type="SocketedIn"},flags=0,keywordFlags=0,name="ExtraSupport",type="LIST",value={appliesToGrantedSkills=true,level=20,skillId="SupportIncreasedCriticalStrikes"}}},nil}
end)();(function()
c["Skills Socketed in your Boots are Supported by level 20 Infernal Legion"]={{[1]={[1]={slotName="Boots",type="SocketedIn"},flags=0,keywordFlags=0,name="ExtraSupport",type="LIST",value={appliesToGrantedSkills=true,level=20,skillId="SupportInfernalLegion"}}},nil}
end)();(function()
c["Skills Socketed in your Boots are Supported by level 20 Infused Channelling"]={{[1]={[1]={slotName="Boots",type="SocketedIn"},flags=0,keywordFlags=0,name="ExtraSupport",type="LIST",value={appliesToGrantedSkills=true,level=20,skillId="SupportInfusedChannelling"}}},nil}
c["Skills Socketed in your Boots are Supported by level 20 Innervate"]={{[1]={[1]={slotName="Boots",type="SocketedIn"},flags=0,keywordFlags=0,name="ExtraSupport",type="LIST",value={appliesToGrantedSkills=true,level=20,skillId="SupportInnervate"}}},nil}
c["Skills Socketed in your Boots are Supported by level 20 Inspiration"]={{[1]={[1]={slotName="Boots",type="SocketedIn"},flags=0,keywordFlags=0,name="ExtraSupport",type="LIST",value={appliesToGrantedSkills=true,level=20,skillId="SupportInspiration"}}},nil}
Expand Down
1 change: 1 addition & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,7 @@ local modTagList = {
["per green socket"] = { tag = { type = "Multiplier", var = "GreenSocketIn{SlotName}" } },
["per blue socket"] = { tag = { type = "Multiplier", var = "BlueSocketIn{SlotName}" } },
["per white socket"] = { tag = { type = "Multiplier", var = "WhiteSocketIn{SlotName}" } },
["per empty socket"] = { tag = { type = "Multiplier", var = "EmptySocketIn{SlotName}" } },
["for each unlinked socket in equipped two handed weapon"] = { tagList = { { type = "Multiplier", var = "UnlinkedSocketInWeapon 1" }, { type = "Condition", var = "UsingTwoHandedWeapon" } } },
["for each empty red socket on any equipped item"] = { tag = { type = "Multiplier", var = "EmptyRedSocketsInAnySlot" } },
["for each empty green socket on any equipped item"] = { tag = { type = "Multiplier", var = "EmptyGreenSocketsInAnySlot" } },
Expand Down
Loading