Compare commits

..

No commits in common. 'd0d16ff450daab0aa132a26785ffd67ea5b5efe8' and 'f722d173060a3c14699656c453bbba89c766d06c' have entirely different histories.

  1. 10
      src/APL/APL.lua
  2. 8
      src/Spell/Spell.lua

@ -109,22 +109,22 @@ function APLActor:Execute()
-- print("Bastion: APL:Execute: Condition for spell " .. self:GetActor().spell:GetName())
self:GetActor().spell:CastableIf(self:GetActor().castableFunc):OnCast(self:GetActor().onCastFunc):Cast(
self:GetActor().target, self:GetActor().condition)
else
end
-- print("Bastion: APL:Execute: No condition for spell " .. self:GetActor().spell:GetName())
self:GetActor().spell:CastableIf(self:GetActor().castableFunc):OnCast(self:GetActor().onCastFunc):Cast(
self:GetActor().target)
end
end
if self:GetActor().item then
if self:GetActor().condition then
-- print("Bastion: APL:Execute: Condition for spell " .. self:GetActor().spell:GetName())
self:GetActor().item:UsableIf(self:GetActor().usableFunc):Use(self:GetActor().target,
self:GetActor().condition)
else
end
-- print("Bastion: APL:Execute: No condition for spell " .. self:GetActor().spell:GetName())
self:GetActor().item:UsableIf(self:GetActor().usableFunc):Use(self:GetActor().target)
end
end
if self:GetActor().action then
-- print("Bastion: APL:Execute: Executing action " .. self:GetActor().action)
self:GetActor().cb(self)
@ -209,7 +209,7 @@ end
-- Add a spell to the APL
---@param spell Spell
---@param condition? string|fun(...):boolean
---@param condition? fun(...):boolean
---@return APLActor
function APL:AddSpell(spell, condition)
local castableFunc = spell.CastableIfFunc

@ -161,15 +161,11 @@ end
-- Cast the spell
---@param unit Unit
---@param condition string|function
---@param condition string
---@return boolean
function Spell:Cast(unit, condition)
if condition then
if type(condition) == "string" and not self:EvaluateCondition(condition) then
if condition and not self:EvaluateCondition(condition) then
return false
elseif type(condition) == "function" and not condition() then
return false
end
end
if not self:Castable() then

Loading…
Cancel
Save