attack & annotation refactor
This commit is contained in:
parent
a0ddd5f7cd
commit
c27089d23e
@ -90,11 +90,15 @@ function attack:cast(caster, target)
|
||||
if caster:try(Tree.behaviors.map, function(map)
|
||||
local dist = math.max(math.abs(map.position.x - target.x), math.abs(map.position.y - target.y))
|
||||
print("dist:", dist)
|
||||
return dist >= 2
|
||||
return dist > 2
|
||||
end) then
|
||||
return false
|
||||
end
|
||||
|
||||
caster:try(Tree.behaviors.stats, function (stats)
|
||||
stats.mana = stats.mana - 2
|
||||
end)
|
||||
|
||||
--- @type Character
|
||||
local targetCharacterId = Tree.level.characterGrid:get(target)
|
||||
if not targetCharacterId then return false end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user