Skip to content

Commit

Permalink
AC -> HL
Browse files Browse the repository at this point in the history
  • Loading branch information
aethys256 committed Jul 17, 2018
1 parent e1ac51b commit 2caf089
Show file tree
Hide file tree
Showing 40 changed files with 354 additions and 354 deletions.
4 changes: 2 additions & 2 deletions HeroCache/Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
function Cache.Reset ()
if not Cache.HasBeenReset then
-- -- foreach method
-- for Key, Value in pairs(AC.Cache) do
-- wipe(AC.Cache[Key]);
-- for Key, Value in pairs(HL.Cache) do
-- wipe(HL.Cache[Key]);
-- end

wipe(Cache.APLVar);
Expand Down
14 changes: 7 additions & 7 deletions HeroLib/Class/Item.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
--- ============================ HEADER ============================
--- ======= LOCALIZE =======
-- Addon
local addonName, AC = ...;
local addonName, HL = ...;
-- HeroLib
local Cache = HeroCache;
local Unit = AC.Unit;
local Unit = HL.Unit;
local Player = Unit.Player;
local Target = Unit.Target;
local Spell = AC.Spell;
local Item = AC.Item;
local Spell = HL.Spell;
local Item = HL.Item;
-- Lua

-- File Locals
Expand Down Expand Up @@ -121,7 +121,7 @@
-- Return 0 if the Item isn't in CD.
if CDTime == 0 then return 0; end
-- Compute the CD.
local CD = CDTime + CDValue - AC.GetTime() - (BypassRecovery and 0 or AC.RecoveryOffset());
local CD = CDTime + CDValue - HL.GetTime() - (BypassRecovery and 0 or HL.RecoveryOffset());
-- Return the Item CD
return CD > 0 and CD or 0;
end
Expand Down Expand Up @@ -190,13 +190,13 @@
if Cache.ItemInfo[self.ItemID].IsEquipped == nil then
-- TODO: Plus this compatibility part.
if Slot then
Cache.ItemInfo[self.ItemID].IsEquipped = AC.Equipment[Slot] == self.ItemID and true or false;
Cache.ItemInfo[self.ItemID].IsEquipped = HL.Equipment[Slot] == self.ItemID and true or false;
else
local ItemIsEquipped = false;
-- Returns false for Legion Legendaries while in Instanced PvP. (Assuming 940 ilevel, 910 ones are meant to disappear)
if not Player:IsInInstancedPvP() or not self:IsLegendary() or self:Level() ~= 940 then
for i=0, #self.ItemSlotID do
if AC.Equipment[self.ItemSlotID[i]] == self.ItemID then
if HL.Equipment[self.ItemSlotID[i]] == self.ItemID then
ItemIsEquipped = true;
break;
end
Expand Down
10 changes: 5 additions & 5 deletions HeroLib/Class/Main.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- ============================ HEADER ============================
--- ======= LOCALIZE =======
-- Addon
local addonName, AC = ...;
local addonName, HL = ...;
-- HeroLib
local Cache = HeroCache;
-- Lua
Expand Down Expand Up @@ -31,7 +31,7 @@
--- ======= UNIT =======
do
local Unit = Class();
AC.Unit = Unit;
HL.Unit = Unit;
function Unit:New ( UnitID )
if type( UnitID ) ~= "string" then error( "Invalid UnitID." ); end
self.UnitID = UnitID;
Expand All @@ -47,7 +47,7 @@ do
local UnitIDs = {
{ "Arena", 5 },
{ "Boss", 4 },
{ "Nameplate", AC.MAXIMUM },
{ "Nameplate", HL.MAXIMUM },
{ "Party", 5 },
{ "Raid", 40 }
};
Expand All @@ -64,7 +64,7 @@ end
--- ======= SPELL =======
do
local Spell = Class();
AC.Spell = Spell;
HL.Spell = Spell;
function Spell:New ( SpellID, SpellType )
if type( SpellID ) ~= "number" then error( "Invalid SpellID." ); end
if SpellType and type( SpellType ) ~= "string" then error( "Invalid Spell Type." ); end
Expand Down Expand Up @@ -122,7 +122,7 @@ end

do
local Item = Class();
AC.Item = Item;
HL.Item = Item;
function Item:New ( ItemID, ItemSlotID )
if type( ItemID ) ~= "number" then error( "Invalid ItemID." ); end
if ItemSlotID and type( ItemSlotID ) ~= "table" then error( "Invalid ItemSlotID." ); end
Expand Down
10 changes: 5 additions & 5 deletions HeroLib/Class/Spell/Artifact.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
--- ============================ HEADER ============================
--- ======= LOCALIZE =======
-- Addon
local addonName, AC = ...;
local addonName, HL = ...;
-- HeroLib
local Cache, Utils = HeroCache, AC.Utils;
local Unit = AC.Unit;
local Cache, Utils = HeroCache, HL.Utils;
local Unit = HL.Unit;
local Player, Pet, Target = Unit.Player, Unit.Pet, Unit.Target;
local Focus, MouseOver = Unit.Focus, Unit.MouseOver;
local Arena, Boss, Nameplate = Unit.Arena, Unit.Boss, Unit.Nameplate;
local Party, Raid = Unit.Party, Unit.Raid;
local Spell = AC.Spell;
local Item = AC.Item;
local Spell = HL.Spell;
local Item = HL.Item;
-- Lua
local pairs = pairs;
local wipe = table.wipe;
Expand Down
10 changes: 5 additions & 5 deletions HeroLib/Class/Spell/Book.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
--- ============================ HEADER ============================
--- ======= LOCALIZE =======
-- Addon
local addonName, AC = ...;
local addonName, HL = ...;
-- HeroLib
local Cache, Utils = HeroCache, AC.Utils;
local Unit = AC.Unit;
local Cache, Utils = HeroCache, HL.Utils;
local Unit = HL.Unit;
local Player, Pet, Target = Unit.Player, Unit.Pet, Unit.Target;
local Focus, MouseOver = Unit.Focus, Unit.MouseOver;
local Arena, Boss, Nameplate = Unit.Arena, Unit.Boss, Unit.Nameplate;
local Party, Raid = Unit.Party, Unit.Raid;
local Spell = AC.Spell;
local Item = AC.Item;
local Spell = HL.Spell;
local Item = HL.Item;
-- Lua
local select = select;
-- WoW API
Expand Down
20 changes: 10 additions & 10 deletions HeroLib/Class/Spell/Cooldown.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
--- ============================ HEADER ============================
--- ======= LOCALIZE =======
-- Addon
local addonName, AC = ...;
local addonName, HL = ...;
-- HeroLib
local Cache, Utils = HeroCache, AC.Utils;
local Unit = AC.Unit;
local Cache, Utils = HeroCache, HL.Utils;
local Unit = HL.Unit;
local Player, Pet, Target = Unit.Player, Unit.Pet, Unit.Target;
local Focus, MouseOver = Unit.Focus, Unit.MouseOver;
local Arena, Boss, Nameplate = Unit.Arena, Unit.Boss, Unit.Nameplate;
local Party, Raid = Unit.Party, Unit.Raid;
local Spell = AC.Spell;
local Item = AC.Item;
local Spell = HL.Spell;
local Item = HL.Item;
-- Lua
local mathmax = math.max;
local unpack = unpack;
Expand Down Expand Up @@ -66,7 +66,7 @@
if CDTime == 0 then return 0; end
end
-- Compute the CD.
local CD = CDTime + CDValue - AC.GetTime() - (BypassRecovery and 0 or AC.RecoveryOffset());
local CD = CDTime + CDValue - HL.GetTime() - (BypassRecovery and 0 or HL.RecoveryOffset());
-- Return the Spell CD.
return CD > 0 and CD or 0;
end
Expand Down Expand Up @@ -141,7 +141,7 @@
end
end
if Offset then
return BypassRecovery and mathmax( AC.OffsetRemains( RechargeNoRecovery, Offset ), 0 ) or mathmax(AC.OffsetRemains( Recharge, Offset ), 0 );
return BypassRecovery and mathmax( HL.OffsetRemains( RechargeNoRecovery, Offset ), 0 ) or mathmax(HL.OffsetRemains( Recharge, Offset ), 0 );
else
return BypassRecovery and RechargeNoRecovery or Recharge;
end
Expand Down Expand Up @@ -185,7 +185,7 @@
end
end
if Offset then
return BypassRecovery and mathmax( AC.OffsetRemains( ChargesFractionalNoRecovery, Offset ), 0 ) or mathmax(AC.OffsetRemains( ChargesFractional, Offset ), 0 );
return BypassRecovery and mathmax( HL.OffsetRemains( ChargesFractionalNoRecovery, Offset ), 0 ) or mathmax(HL.OffsetRemains( ChargesFractional, Offset ), 0 );
else
return BypassRecovery and ChargesFractionalNoRecovery or ChargesFractional;
end
Expand Down Expand Up @@ -227,7 +227,7 @@
end
end
if Offset then
return BypassRecovery and mathmax( AC.OffsetRemains( FullRechargeTimeNoRecovery, Offset ), 0 ) or mathmax(AC.OffsetRemains( FullRechargeTime, Offset ), 0 );
return BypassRecovery and mathmax( HL.OffsetRemains( FullRechargeTimeNoRecovery, Offset ), 0 ) or mathmax(HL.OffsetRemains( FullRechargeTime, Offset ), 0 );
else
return BypassRecovery and FullRechargeTimeNoRecovery or FullRechargeTime;
end
Expand Down Expand Up @@ -269,7 +269,7 @@
end
end
if Offset then
return BypassRecovery and mathmax( AC.OffsetRemains( CooldownNoRecovery, Offset ), 0 ) or mathmax(AC.OffsetRemains( Cooldown, Offset ), 0 );
return BypassRecovery and mathmax( HL.OffsetRemains( CooldownNoRecovery, Offset ), 0 ) or mathmax(HL.OffsetRemains( Cooldown, Offset ), 0 );
else
return BypassRecovery and CooldownNoRecovery or Cooldown;
end
Expand Down
28 changes: 14 additions & 14 deletions HeroLib/Class/Spell/Main.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
--- ============================ HEADER ============================
--- ======= LOCALIZE =======
-- Addon
local addonName, AC = ...;
local addonName, HL = ...;
-- HeroLib
local Cache, Utils = HeroCache, AC.Utils;
local Unit = AC.Unit;
local Cache, Utils = HeroCache, HL.Utils;
local Unit = HL.Unit;
local Player, Pet, Target = Unit.Player, Unit.Pet, Unit.Target;
local Focus, MouseOver = Unit.Focus, Unit.MouseOver;
local Arena, Boss, Nameplate = Unit.Arena, Unit.Boss, Unit.Nameplate;
local Party, Raid = Unit.Party, Unit.Raid;
local Spell = AC.Spell;
local Item = AC.Item;
local Spell = HL.Spell;
local Item = HL.Item;
-- Lua
local pairs = pairs;
local unpack = unpack;
Expand All @@ -32,22 +32,22 @@

-- Get the Time since Last spell Cast.
function Spell:TimeSinceLastCast ()
return AC.GetTime() - self.LastCastTime;
return HL.GetTime() - self.LastCastTime;
end

-- Get the Time since Last spell Display.
function Spell:TimeSinceLastDisplay ()
return AC.GetTime() - self.LastDisplayTime;
return HL.GetTime() - self.LastDisplayTime;
end

-- Get the Time since Last Buff applied on the player.
function Spell:TimeSinceLastAppliedOnPlayer ()
return AC.GetTime() - self.LastAppliedOnPlayerTime;
return HL.GetTime() - self.LastAppliedOnPlayerTime;
end

-- Get the Time since Last Buff removed from the player.
function Spell:TimeSinceLastRemovedOnPlayer ()
return AC.GetTime() - self.LastRemovedFromPlayerTime;
return HL.GetTime() - self.LastRemovedFromPlayerTime;
end

-- Register the spell damage formula.
Expand Down Expand Up @@ -220,12 +220,12 @@
end

-- action.foo.tick_time
local TickTime = AC.Enum.TickTime;
local TickTime = HL.Enum.TickTime;
function Spell:FilterTickTime (SpecID)
local RegisteredSpells = {};
local BaseTickTime = AC.Enum.TickTime;
local BaseTickTime = HL.Enum.TickTime;
-- Fetch registered spells during the init
for Spec, Spells in pairs(AC.Spell[AC.SpecID_ClassesSpecs[SpecID][1]]) do
for Spec, Spells in pairs(HL.Spell[HL.SpecID_ClassesSpecs[SpecID][1]]) do
for _, Spell in pairs(Spells) do
local SpellID = Spell:ID();
local TickTimeInfo = BaseTickTime[SpellID][1];
Expand All @@ -251,7 +251,7 @@
end

-- Base Duration of a dot/hot/channel...
local SpellDuration = AC.Enum.SpellDuration;
local SpellDuration = HL.Enum.SpellDuration;
function Spell:BaseDuration ()
local Duration = SpellDuration[self.SpellID];
if not Duration or Duration == 0 then return 0; end
Expand All @@ -272,7 +272,7 @@
return BaseDuration * 0.3;
end

local SpellGCD = AC.Enum.TriggerGCD;
local SpellGCD = HL.Enum.TriggerGCD;
function Spell:GCD ()
local Gcd = SpellGCD[self.SpellID]
if not Gcd or Gcd == 0 then return 0; end
Expand Down
18 changes: 9 additions & 9 deletions HeroLib/Class/Spell/Travel.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
--- ============================ HEADER ============================
--- ======= LOCALIZE =======
-- Addon
local addonName, AC = ...;
local addonName, HL = ...;
-- HeroLib
local Cache, Utils = HeroCache, AC.Utils;
local Unit = AC.Unit;
local Cache, Utils = HeroCache, HL.Utils;
local Unit = HL.Unit;
local Player, Pet, Target = Unit.Player, Unit.Pet, Unit.Target;
local Focus, MouseOver = Unit.Focus, Unit.MouseOver;
local Arena, Boss, Nameplate = Unit.Arena, Unit.Boss, Unit.Nameplate;
local Party, Raid = Unit.Party, Unit.Raid;
local Spell = AC.Spell;
local Item = AC.Item;
local Spell = HL.Spell;
local Item = HL.Item;
-- Lua
local pairs = pairs;
-- File Locals
Expand All @@ -19,12 +19,12 @@

--- ============================ CONTENT ============================
-- action.foo.travel_time
local ProjectileSpeed = AC.Enum.ProjectileSpeed;
local ProjectileSpeed = HL.Enum.ProjectileSpeed;
function Spell:FilterProjectileSpeed (SpecID)
local RegisteredSpells = {};
local BaseProjectileSpeed = AC.Enum.ProjectileSpeed; -- In case FilterTravelTime is called multiple time, we take the Enum table as base.
local BaseProjectileSpeed = HL.Enum.ProjectileSpeed; -- In case FilterTravelTime is called multiple time, we take the Enum table as base.
-- Fetch registered spells during the init
for Spec, Spells in pairs(AC.Spell[AC.SpecID_ClassesSpecs[SpecID][1]]) do
for Spec, Spells in pairs(HL.Spell[HL.SpecID_ClassesSpecs[SpecID][1]]) do
for _, Spell in pairs(Spells) do
local SpellID = Spell:ID();
local ProjectileSpeedInfo = BaseProjectileSpeed[SpellID];
Expand All @@ -43,5 +43,5 @@

-- action.foo.in_flight
function Spell:IsInFlight ()
return AC.GetTime() < self.LastHitTime;
return HL.GetTime() < self.LastHitTime;
end
Loading

0 comments on commit 2caf089

Please sign in to comment.