|
|
@ -388,27 +388,39 @@ end |
|
|
|
---@param spells List |
|
|
|
---@param spells List |
|
|
|
---@return Aura |
|
|
|
---@return Aura |
|
|
|
function AuraTable:FindAnyOf(spells) |
|
|
|
function AuraTable:FindAnyOf(spells) |
|
|
|
return spells:find(function(spell) |
|
|
|
return spells:reduce(function(acc, cur) |
|
|
|
return self:FindAny(spell):IsValid() |
|
|
|
local aura = self:FindAny(cur) |
|
|
|
end) or Bastion.Aura:New() |
|
|
|
if aura:IsValid() then |
|
|
|
|
|
|
|
return aura, true |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
return acc |
|
|
|
|
|
|
|
end, Bastion.Aura:New()) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
-- FindAnyOfMy |
|
|
|
-- FindAnyOfMy |
|
|
|
---@param spells List |
|
|
|
---@param spells List |
|
|
|
---@return Aura |
|
|
|
---@return Aura |
|
|
|
function AuraTable:FindAnyOfMy(spells) |
|
|
|
function AuraTable:FindAnyOfMy(spells) |
|
|
|
return spells:find(function(spell) |
|
|
|
return spells:reduce(function(acc, cur) |
|
|
|
return self:FindMy(spell):IsValid() |
|
|
|
local aura = self:FindMy(cur) |
|
|
|
end) or Bastion.Aura:New() |
|
|
|
if aura:IsValid() then |
|
|
|
|
|
|
|
return aura, true |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
return acc |
|
|
|
|
|
|
|
end, Bastion.Aura:New()) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
-- FindAnyOfTheirs |
|
|
|
-- FindAnyOfTheirs |
|
|
|
---@param spells List |
|
|
|
---@param spells List |
|
|
|
---@return Aura |
|
|
|
---@return Aura |
|
|
|
function AuraTable:FindAnyOfTheirs(spells) |
|
|
|
function AuraTable:FindAnyOfTheirs(spells) |
|
|
|
return spells:find(function(spell) |
|
|
|
return spells:reduce(function(acc, cur) |
|
|
|
return self:FindTheirs(spell):IsValid() |
|
|
|
local aura = self:FindTheirs(cur) |
|
|
|
end) or Bastion.Aura:New() |
|
|
|
if aura:IsValid() then |
|
|
|
|
|
|
|
return aura, true |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
return acc |
|
|
|
|
|
|
|
end, Bastion.Aura:New()) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
-- FindAnyFrom |
|
|
|
-- FindAnyFrom |
|
|
@ -416,9 +428,13 @@ end |
|
|
|
---@param source Unit |
|
|
|
---@param source Unit |
|
|
|
---@return Aura |
|
|
|
---@return Aura |
|
|
|
function AuraTable:FindAnyFrom(spells, source) |
|
|
|
function AuraTable:FindAnyFrom(spells, source) |
|
|
|
return spells:find(function(spell) |
|
|
|
return spells:reduce(function(acc, cur) |
|
|
|
return self:FindFrom(spell, source):IsValid() |
|
|
|
local aura = self:FindFrom(cur, source) |
|
|
|
end) or Bastion.Aura:New() |
|
|
|
if aura:IsValid() then |
|
|
|
|
|
|
|
return aura, true |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
return acc |
|
|
|
|
|
|
|
end, Bastion.Aura:New()) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
-- Has any stealable aura |
|
|
|
-- Has any stealable aura |
|
|
|