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
4 changes: 2 additions & 2 deletions spec/System/TestSkills_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ describe("TestSkills", function()
runCallback("OnFrame")

local genericEfficiencyCost = build.calcsTab.mainOutput.ManaCost
-- Test actual behavior: 12/1.25 = 9.6 (not rounded)
assert.True(math.abs(genericEfficiencyCost - 9.6) < 0.001)
-- The game rounds 12 / 1.25 = 9.6 after applying efficiency.
assert.are.equals(10, genericEfficiencyCost)

-- Test multiple efficiency sources stacking additively
build.configTab.input.customMods = "25% increased Cost Efficiency\n25% increased Mana Cost Efficiency"
Expand Down
8 changes: 8 additions & 0 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,10 @@ function calcs.offence(env, actor, activeSkill)
end
-- Apply cost efficiency (similar to reservation efficiency)
output[costName] = m_max(0, output[costName] / costEfficiency)
if val.upfront and not val.percent then
-- The game stores upfront resource costs as whole numbers after efficiency.
output[costName] = round(output[costName])
end
output[costName] = m_max(0, output[costName] + val.totalCost)
if val.type == "Mana" and hybridLifeCost > 0 then -- Life/Mana Mastery
output[costName] = m_max(0, m_floor((1 - hybridLifeCost) * output[costName]))
Expand All @@ -1796,6 +1800,10 @@ function calcs.offence(env, actor, activeSkill)
output[costName] = m_max(0, moreType * output[costName])
-- Apply cost efficiency for unaffected costs too
output[costName] = m_max(0, output[costName] / costEfficiency)
if val.upfront and not val.percent then
-- The game stores upfront resource costs as whole numbers after efficiency.
output[costName] = round(output[costName])
end
output[costName] = m_max(0, output[costName] + val.totalCost)
output[costNameRaw] = val.baseCostRaw and m_max(0, m_max(0, (1 + inc / 100) * (val.baseCostRaw + val.baseCostNoMult) * moreType / costEfficiency) + val.totalCost)
end
Expand Down
Loading