Skip to content

Commit 31cb3eb

Browse files
committed
Add life and es cost tests
1 parent 90fa139 commit 31cb3eb

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

spec/System/TestSkills_spec.lua

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ describe("TestAttacks", function()
216216
assert.True(math.abs(finalCost - 12) < 0.1) -- floor(12 * 1.5) / 1.5
217217
end)
218218

219-
it("Test flat cost is added before cost efficiency (#10003)", function()
219+
it("Test flat cost is added before cost efficiency", function()
220220
-- In-game order is ((base cost * multipliers) + flat cost) / (1 + cost efficiency)
221221
build.skillsTab:PasteSocketGroup("Hydrosphere 1/0 1\n")
222222

@@ -229,6 +229,29 @@ describe("TestAttacks", function()
229229
-- (12 + 10) / 1.5 = 14.667
230230
assert.True(math.abs(finalCost - 22 / 1.5) < 0.001)
231231
end)
232+
it("Test flat cost is added before cost efficiency for life costs", function()
233+
build.skillsTab:PasteSocketGroup("Hydrosphere 1/0 1\n")
234+
235+
-- Convert Hydrosphere's 12 base cost to life, then add +10 flat and 50% efficiency
236+
build.configTab.input.customMods = "Skills Cost Life instead of Mana\n+10 to Total Cost\n50% increased Cost Efficiency"
237+
build.configTab:BuildModList()
238+
runCallback("OnFrame")
239+
240+
-- (12 + 10) / 1.5 = 14.667
241+
assert.True(math.abs(build.calcsTab.mainOutput.LifeCost - 22 / 1.5) < 0.001)
242+
end)
243+
244+
it("Test flat cost is added before cost efficiency for energy shield costs (#10003)", function()
245+
build.skillsTab:PasteSocketGroup("Hydrosphere 1/0 1\n")
246+
247+
-- Convert Hydrosphere's 12 base cost to ES, then add +10 flat and 50% efficiency
248+
build.configTab.input.customMods = "Skills Cost Energy Shield instead of Mana or Life\n+10 to Total Cost\n50% increased Cost Efficiency"
249+
build.configTab:BuildModList()
250+
runCallback("OnFrame")
251+
252+
-- (12 + 10) / 1.5 = 14.667
253+
assert.True(math.abs(build.calcsTab.mainOutput.ESCost - 22 / 1.5) < 0.001)
254+
end)
232255
it("Test mana cost efficiency with support gems", function()
233256
-- Test interaction between cost efficiency and cost multipliers
234257
build.skillsTab:PasteSocketGroup("Contagion 6/0 1\nMagnified Area I 1/0 1")

0 commit comments

Comments
 (0)