diff --git a/spec/System/TestScaeva_spec.lua b/spec/System/TestScaeva_spec.lua new file mode 100644 index 0000000000..84a90c8184 --- /dev/null +++ b/spec/System/TestScaeva_spec.lua @@ -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) diff --git a/src/Data/ModCache.lua b/src/Data/ModCache.lua index da1918b9f9..7f75d3edcc 100755 --- a/src/Data/ModCache.lua +++ b/src/Data/ModCache.lua @@ -11492,7 +11492,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} @@ -11861,8 +11861,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} @@ -15005,8 +15004,8 @@ c["Cannot have non-Abyssal sockets"]={{[1]={flags=0,keywordFlags=0,name="NoSocke c["Cannot inflict Curses"]={nil,"Cannot inflict Curses "} c["Cannot inflict Elemental Ailments"]={{[1]={flags=0,keywordFlags=0,name="CannotIgnite",type="FLAG",value=true},[2]={flags=0,keywordFlags=0,name="CannotChill",type="FLAG",value=true},[3]={flags=0,keywordFlags=0,name="CannotFreeze",type="FLAG",value=true},[4]={flags=0,keywordFlags=0,name="CannotShock",type="FLAG",value=true},[5]={flags=0,keywordFlags=0,name="CannotScorch",type="FLAG",value=true},[6]={flags=0,keywordFlags=0,name="CannotBrittle",type="FLAG",value=true},[7]={flags=0,keywordFlags=0,name="CannotSap",type="FLAG",value=true}},nil} c["Cannot inflict Freeze or Chill"]={{[1]={flags=0,keywordFlags=0,name="CannotFreeze",type="FLAG",value=true},[2]={flags=0,keywordFlags=0,name="CannotChill",type="FLAG",value=true}},nil} -end)();(function() c["Cannot inflict Ignite"]={{[1]={flags=0,keywordFlags=0,name="CannotIgnite",type="FLAG",value=true}},nil} +end)();(function() c["Cannot inflict Shock"]={{[1]={flags=0,keywordFlags=0,name="CannotShock",type="FLAG",value=true}},nil} c["Cannot lose Crab Barriers if you have lost Crab Barriers Recently"]={nil,"Cannot lose Crab Barriers if you have lost Crab Barriers Recently "} c["Cannot lose Crab Barriers if you have lost Crab Barriers Recently +3% Chance to Block Attack Damage while you have at least 5 Crab Barriers"]={nil,"Cannot lose Crab Barriers if you have lost Crab Barriers Recently +3% Chance to Block Attack Damage while you have at least 5 Crab Barriers "} @@ -20007,8 +20006,8 @@ c["Requires Class Scion Allocates Inquisitor if you have the matching modifier o c["Requires Class Scion Allocates Juggernaut if you have the matching modifier on Forbidden Flame"]={nil,"Requires Class Scion Allocates Juggernaut if you have the matching modifier on Forbidden Flame "} c["Requires Class Scion Allocates Juggernaut if you have the matching modifier on Forbidden Flesh"]={nil,"Requires Class Scion Allocates Juggernaut if you have the matching modifier on Forbidden Flesh "} c["Requires Class Scion Allocates Necromancer if you have the matching modifier on Forbidden Flame"]={nil,"Requires Class Scion Allocates Necromancer if you have the matching modifier on Forbidden Flame "} -end)();(function() c["Requires Class Scion Allocates Necromancer if you have the matching modifier on Forbidden Flesh"]={nil,"Requires Class Scion Allocates Necromancer if you have the matching modifier on Forbidden Flesh "} +end)();(function() c["Requires Class Scion Allocates Occultist if you have the matching modifier on Forbidden Flame"]={nil,"Requires Class Scion Allocates Occultist if you have the matching modifier on Forbidden Flame "} c["Requires Class Scion Allocates Occultist if you have the matching modifier on Forbidden Flesh"]={nil,"Requires Class Scion Allocates Occultist if you have the matching modifier on Forbidden Flesh "} c["Requires Class Scion Allocates Pathfinder if you have the matching modifier on Forbidden Flame"]={nil,"Requires Class Scion Allocates Pathfinder if you have the matching modifier on Forbidden Flame "} diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index 85e4cd8e3b..659bea6d1d 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -1449,6 +1449,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" } },