From 22f194ae5ba57f45ecdcca1f94048f641fa1a8a6 Mon Sep 17 00:00:00 2001 From: Cilraaz Date: Sun, 4 Apr 2021 21:57:43 -0400 Subject: [PATCH] feat(Spell): Add Spell:ExecuteRemains() --- HeroLib/Class/Spell/Main.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/HeroLib/Class/Spell/Main.lua b/HeroLib/Class/Spell/Main.lua index e21b602f..198f824e 100755 --- a/HeroLib/Class/Spell/Main.lua +++ b/HeroLib/Class/Spell/Main.lua @@ -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