|
|
|
@ -568,8 +568,10 @@ function Spell:GetRange() |
|
|
|
|
return self.maxRange, self.minRange |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
---@param target? Bastion.Unit |
|
|
|
|
function Spell:CheckRange(target) |
|
|
|
|
---@param source Bastion.Unit |
|
|
|
|
---@param target Bastion.Unit |
|
|
|
|
function Spell:CheckRange(source, target) |
|
|
|
|
return self.isMelee and source:InMelee(target) or source:GetCombatDistance(target) <= self.maxRange |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
---@param target? Bastion.Unit |
|
|
|
@ -609,12 +611,11 @@ function Spell:IsInRange(unit) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
local inRange = C_Spell.IsSpellInRange(self:GetName(), unit:GetOMToken()) or false |
|
|
|
|
|
|
|
|
|
--[[ if inRange then |
|
|
|
|
if inRange then |
|
|
|
|
return true |
|
|
|
|
end ]] |
|
|
|
|
return inRange |
|
|
|
|
--return Bastion.Globals.UnitManager:Get("player"):InMelee(unit) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
return Bastion.Globals.UnitManager:Get("player"):InMelee(unit) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
-- Get the last cast time |
|
|
|
@ -793,7 +794,8 @@ end |
|
|
|
|
---@return boolean |
|
|
|
|
function Spell:IsEnrageDispel() |
|
|
|
|
return ({ |
|
|
|
|
[2908] = true, |
|
|
|
|
[2908] = true, -- Soothe |
|
|
|
|
[19801] = true, -- Tranq Shot |
|
|
|
|
})[self:GetID()] |
|
|
|
|
end |
|
|
|
|
|
|
|
|
@ -801,7 +803,12 @@ end |
|
|
|
|
---@return boolean |
|
|
|
|
function Spell:IsMagicDispel() |
|
|
|
|
return ({ |
|
|
|
|
[88423] = true, |
|
|
|
|
[77130] = true, -- Purify Spirit |
|
|
|
|
[115450] = true, -- Detox |
|
|
|
|
[4987] = true, -- Cleanse |
|
|
|
|
[527] = true, -- Purify |
|
|
|
|
[32375] = true, -- Mass Dispel |
|
|
|
|
[89808] = true, -- Singe Magic |
|
|
|
|
})[self:GetID()] |
|
|
|
|
end |
|
|
|
|
|
|
|
|
@ -809,7 +816,10 @@ end |
|
|
|
|
---@return boolean |
|
|
|
|
function Spell:IsCurseDispel() |
|
|
|
|
return ({ |
|
|
|
|
[88423] = true, |
|
|
|
|
[77130] = true, -- Purify Spirit |
|
|
|
|
[2782] = true, |
|
|
|
|
[475] = true, -- Remove Curse |
|
|
|
|
[51886] = true, -- Cleanse Spirit |
|
|
|
|
})[self:GetID()] |
|
|
|
|
end |
|
|
|
|
|
|
|
|
@ -817,14 +827,23 @@ end |
|
|
|
|
---@return boolean |
|
|
|
|
function Spell:IsPoisonDispel() |
|
|
|
|
return ({ |
|
|
|
|
[88423] = true, |
|
|
|
|
[2782] = true, |
|
|
|
|
[115450] = true, -- Detox |
|
|
|
|
[4987] = true, -- Cleanse |
|
|
|
|
[213644] = true, -- Cleanse Toxins |
|
|
|
|
})[self:GetID()] |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
-- IsDiseaseDispel |
|
|
|
|
---@return boolean |
|
|
|
|
function Spell:IsDiseaseDispel() |
|
|
|
|
return ({})[self:GetID()] |
|
|
|
|
return ({ |
|
|
|
|
[115450] = true, -- Detox |
|
|
|
|
[4987] = true, -- Cleanse |
|
|
|
|
[213644] = true, -- Cleanse Toxins |
|
|
|
|
[527] = true, -- Purify |
|
|
|
|
[213634] = true, -- Purify Disease |
|
|
|
|
})[self:GetID()] |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
-- IsSpell |
|
|
|
@ -964,79 +983,4 @@ function Spell:InFlight(params) |
|
|
|
|
return #self:GetMissiles(params) > 0 |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
--[[ ---@param target? Bastion.Unit |
|
|
|
|
function Spell:IsMineUp(target) |
|
|
|
|
target = target or Bastion.UnitManager:Get("player") |
|
|
|
|
return target:GetAuras():FindMy(self):IsUp() |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
---@param target? Bastion.Unit |
|
|
|
|
function Spell:IsMineRefreshable(target) |
|
|
|
|
target = target or Bastion.UnitManager:Get("player") |
|
|
|
|
return target:GetAuras():FindMy(self):Refreshable() |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
---@param spells Bastion.List |
|
|
|
|
---@param source Bastion.Unit |
|
|
|
|
---@param target Bastion.Unit |
|
|
|
|
function Spell:IsAnyUp(spells, source, target) |
|
|
|
|
local targetAuras = source:Exists() and target:GetAuras():FindAnyFrom(spells + self, source) or |
|
|
|
|
target:GetAuras():FindAnyOf(spells + self) |
|
|
|
|
return targetAuras:IsUp() |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
---@param source Bastion.Unit |
|
|
|
|
---@params target Bastion.Unit |
|
|
|
|
function Spell:IsUp(source, target) |
|
|
|
|
local targetAuras = source:Exists() and target:GetAuras():FindFrom(self, source) or target:GetAuras():FindAny(self) |
|
|
|
|
return targetAuras:IsUp() |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
---@param source Bastion.Unit |
|
|
|
|
---@param target Bastion.Unit |
|
|
|
|
function Spell:IsDown(source, target) |
|
|
|
|
local targetAuras = source:Exists() and target:GetAuras():FindFrom(self, source) or target:GetAuras():FindAny(self) |
|
|
|
|
return targetAuras:IsDown() |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
---@param spells Bastion.List |
|
|
|
|
---@param target Bastion.Unit |
|
|
|
|
function Spell:IsAnyOfMineUp(spells, target) |
|
|
|
|
target = target or Bastion.UnitManager:Get("player") |
|
|
|
|
return target:GetAuras():FindAnyOfMy(spells + self):IsUp() |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
---@param source Bastion.Unit |
|
|
|
|
---@param target Bastion.Unit |
|
|
|
|
function Spell:GetAuraCount(source, target) |
|
|
|
|
return (source:Exists() and target:GetAuras():FindFrom(self, source) or target:GetAuras():FindAny(self)):GetCount() |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
---@param target? Bastion.Unit |
|
|
|
|
function Spell:GetMyCount(target) |
|
|
|
|
target = target or Bastion.UnitManager:Get("player") |
|
|
|
|
return target:GetAuras():FindMy(self):GetCount() |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
---@param source Bastion.Unit |
|
|
|
|
---@param target Bastion.Unit |
|
|
|
|
function Spell:GetRemainingTime(source, target) |
|
|
|
|
local targetAuras = source:Exists() and target:GetAuras():FindFrom(self, source) or target:GetAuras():FindAny(self) |
|
|
|
|
return targetAuras:GetRemainingTime() |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
---@param target? Bastion.Unit |
|
|
|
|
function Spell:GetMyRemainingTime(target) |
|
|
|
|
target = target or Bastion.UnitManager:Get("player") |
|
|
|
|
return target:GetAuras():FindMy(self):GetRemainingTime() |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
---@param spells Bastion.List |
|
|
|
|
---@param source Bastion.Unit |
|
|
|
|
---@param target Bastion.Unit |
|
|
|
|
function Spell:GetAnyRemainingTime(spells, source, target) |
|
|
|
|
return (source:Exists() and target:GetAuras():FindAnyFrom(spells + self, source) or target:GetAuras():FindAnyOf(spells + self)) |
|
|
|
|
:GetRemainingTime() |
|
|
|
|
end ]] |
|
|
|
|
|
|
|
|
|
Bastion.Spell = Spell |
|
|
|
|