Skip to content

Commit

Permalink
feat(Spell): Add Spell:ExecuteRemains()
Browse files Browse the repository at this point in the history
  • Loading branch information
Cilraaz committed Apr 5, 2021
1 parent 64e47c8 commit 22f194a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions HeroLib/Class/Spell/Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,15 @@ function Spell:ExecuteTime()
return CastTime > GCD and CastTime or GCD
end

-- action.foo.execute_remains
function Spell:ExecuteRemains()
if not Player:IsCasting(self) then return 0 end
local CastRemains = Player:CastRemains()
local GCDRemains = Player:GCDRemains()

return CastRemains > GCDRemains and CastRemains or GCDRemains
end

-- Get the CostTable using GetSpellPowerCost.
function Spell:CostTable()
local SpellID = self.SpellID
Expand Down

0 comments on commit 22f194a

Please sign in to comment.