diff --git a/core/CostHandler.lua b/core/CostHandler.lua index 4f55924..138230b 100644 --- a/core/CostHandler.lua +++ b/core/CostHandler.lua @@ -10,17 +10,7 @@ local HEALING_WAVE = GetSpellInfo(332); local LESSER_HEALING_WAVE = GetSpellInfo(8004); local FLAME_SHOCK = GetSpellInfo(8053); ----@class CostHandler local CostHandler = {}; -CostHandler.__index = CostHandler; - ---- Get an object used to calculate spell cost stuff ----@return CostHandler -function CostHandler:New() - local ch = {}; - setmetatable(ch, CostHandler); - return ch; -end --- Set vars for mana cost. ---@param calcedSpell CalcedSpell @@ -29,7 +19,7 @@ end ---@param school number ---@param spellName string ---@param spellId number -function CostHandler:Mana(calcedSpell, spellBaseCost, effCastTime, school, spellName, spellId) +function CostHandler.Mana(calcedSpell, spellBaseCost, effCastTime, school, spellName, spellId) local mps = stats.mp5.val / 5 + stats.manaRegAura; calcedSpell.effectiveCost = calcedSpell.baseCost - math.min(5, effCastTime) * (stats.manaRegCasting + mps); if effCastTime > 5 then diff --git a/core/core.lua b/core/core.lua index ddbf42a..34c0f80 100644 --- a/core/core.lua +++ b/core/core.lua @@ -13,7 +13,7 @@ local currentState = 1; local stats = _addon.stats; local meleeCalc = _addon.MeleeCalc:New(); local magicCalc = _addon.MagicCalc:New(); -local costHandler = _addon.CostHandler:New(); +local costHandler = _addon.CostHandler; -- If a seal is currently active this will be the spell that should be used for Judgement. ---@type number|nil @@ -484,7 +484,7 @@ local function CalcSpell(spellId, calcedSpell, parentSpellData, parentEffCastTim calcedSpell.effectiveCost = spellCost; if costType == 0 then -- mana - costHandler:Mana(calcedSpell, spellRankInfo.baseCost, effCastTime, spellBaseInfo.school, spellName, spellId); + costHandler.Mana(calcedSpell, spellRankInfo.baseCost, effCastTime, spellBaseInfo.school, spellName, spellId); elseif costType == 1 then -- rage -- TODO: rage (on next melee, proc on crit etc.) elseif costType == 3 then -- energy