Merge pull request 'main' (#7) from Bastion/Bastion:main into main

Reviewed-on: CiscOH/Bastion#7
main^2
CiscOH 1 year ago
commit 8a6308c584
  1. 6
      src/APL/APL.lua
  2. 12
      src/AuraTable/AuraTable.lua
  3. 8
      src/Spell/Spell.lua
  4. 6
      src/Unit/Unit.lua

@ -231,7 +231,7 @@ end
-- Add an item to the APL -- Add an item to the APL
---@param item Item ---@param item Item
---@param condition fun(...):boolean ---@param condition? fun(...):boolean
---@return APLActor ---@return APLActor
function APL:AddItem(item, condition) function APL:AddItem(item, condition)
local usableFunc = item.UsableIfFunc local usableFunc = item.UsableIfFunc
@ -268,8 +268,8 @@ end
-- Execute the APL -- Execute the APL
function APL:Execute() function APL:Execute()
for _, actor in ipairs(self.apl) do for _, actor in ipairs(self.apl) do
if actor:HasTraits() and actor:Evaluate() then if actor:HasTraits() then
if actor:Execute() then if actor:Evaluate() and actor:Execute() then
break break
end end
else else

@ -118,7 +118,7 @@ end
-- Get a units buffs -- Get a units buffs
---@return nil ---@return nil
function AuraTable:GetUnitBuffs() function AuraTable:GetUnitBuffs()
if Tinkr.classic then if Tinkr.classic or Tinkr.era then
for i = 1, 40 do for i = 1, 40 do
local aura = Bastion.Aura:New(self.unit, i, 'HELPFUL') local aura = Bastion.Aura:New(self.unit, i, 'HELPFUL')
@ -157,7 +157,7 @@ end
-- Get a units debuffs -- Get a units debuffs
---@return nil ---@return nil
function AuraTable:GetUnitDebuffs() function AuraTable:GetUnitDebuffs()
if Tinkr.classic then if Tinkr.classic or Tinkr.era then
for i = 1, 40 do for i = 1, 40 do
local aura = Bastion.Aura:New(self.unit, i, 'HARMFUL') local aura = Bastion.Aura:New(self.unit, i, 'HARMFUL')
@ -279,7 +279,7 @@ function AuraTable:Find(spell)
if a:IsUp() then -- Handle expired and non refreshed dropoffs not coming in UNIT_AURA if a:IsUp() then -- Handle expired and non refreshed dropoffs not coming in UNIT_AURA
return a return a
else else
if not Tinkr.classic then if not Tinkr.classic or Tinkr.era then
self:RemoveInstanceID(a:GetAuraInstanceID()) self:RemoveInstanceID(a:GetAuraInstanceID())
end end
end end
@ -305,7 +305,7 @@ function AuraTable:FindMy(spell)
if a:IsUp() then -- Handle expired and non refreshed dropoffs not coming in UNIT_AURA if a:IsUp() then -- Handle expired and non refreshed dropoffs not coming in UNIT_AURA
return a return a
else else
if not Tinkr.classic then if not Tinkr.classic or Tinkr.era then
self:RemoveInstanceID(a:GetAuraInstanceID()) self:RemoveInstanceID(a:GetAuraInstanceID())
end end
end end
@ -334,7 +334,7 @@ function AuraTable:FindFrom(spell, source)
return a return a
end end
else else
if not Tinkr.classic then if not Tinkr.classic or Tinkr.era then
self:RemoveInstanceID(a:GetAuraInstanceID()) self:RemoveInstanceID(a:GetAuraInstanceID())
end end
end end
@ -362,7 +362,7 @@ function AuraTable:FindTheirs(spell)
return a return a
end end
else else
if not Tinkr.classic then if not Tinkr.classic or Tinkr.era then
self:RemoveInstanceID(a:GetAuraInstanceID()) self:RemoveInstanceID(a:GetAuraInstanceID())
end end
end end

@ -161,7 +161,7 @@ end
-- Cast the spell -- Cast the spell
---@param unit Unit ---@param unit Unit
---@param condition string|function ---@param condition? string|function
---@return boolean ---@return boolean
function Spell:Cast(unit, condition) function Spell:Cast(unit, condition)
if condition then if condition then
@ -317,9 +317,9 @@ function Spell:GetWasLooking()
end end
-- Click the spell -- Click the spell
---@param x number ---@param x number|Vector3
---@param y number ---@param y? number
---@param z number ---@param z? number
---@return boolean ---@return boolean
function Spell:Click(x, y, z) function Spell:Click(x, y, z)
if type(x) == 'table' then if type(x) == 'table' then

@ -596,7 +596,7 @@ end
---@param unit Unit | nil ---@param unit Unit | nil
---@return number ---@return number
function Unit:GetComboPoints(unit) function Unit:GetComboPoints(unit)
if Tinkr.classic then if Tinkr.classic or Tinkr.era then
if not unit then if not unit then
return 0 return 0
end end
@ -607,7 +607,7 @@ end
---@return number ---@return number
function Unit:GetComboPointsMax() function Unit:GetComboPointsMax()
if Tinkr.classic then if Tinkr.classic or Tinkr.era then
return 5 return 5
end end
return UnitPowerMax(self:GetOMToken(), 4) return UnitPowerMax(self:GetOMToken(), 4)
@ -617,7 +617,7 @@ end
---@param unit Unit | nil ---@param unit Unit | nil
---@return number ---@return number
function Unit:GetComboPointsDeficit(unit) function Unit:GetComboPointsDeficit(unit)
if Tinkr.classic then if Tinkr.classic or Tinkr.era then
return self:GetComboPointsMax() - self:GetComboPoints(unit) return self:GetComboPointsMax() - self:GetComboPoints(unit)
end end
return self:GetComboPointsMax() - self:GetComboPoints() return self:GetComboPointsMax() - self:GetComboPoints()

Loading…
Cancel
Save