feature/effects #37

Manually merged
neckrat merged 64 commits from feature/effects into main 2026-05-06 10:19:49 +03:00
Showing only changes of commit b89719abed - Show all commits

View File

@ -156,37 +156,6 @@ local behavior = {}
behavior.__index = behavior
behavior.id = "ai"
function behavior:dev_warrior()
return function(callback) -- почему так, описано в Task
self.owner:try(Tree.behaviors.spellcaster, function(spellB)
self.target = pathToClosestCharacter(self.owner, 1)
local attackTarget = closestCharacter(self.owner):has(Tree.behaviors.positioned)
if not attackTarget then return end
local task1 = spellB.spellbook[1]:cast(self.owner, self.target)
if task1 then
task1(
function()
-- здесь мы оказываемся после того, как сходили в первый раз
print('[AI]: я походил')
local task2 = spellB.spellbook[3]:cast(self.owner, attackTarget.position)
if task2 then
-- дергаем функцию после завершения хода
print('[AI]: и ударил')
task2(callback)
else
print('[AI]: чёт не бьётся')
callback()
end
end
)
else
print('рот этого казино')
callback()
end
end)
end
end
--- @param class Class
function behavior.new(class)
return setmetatable({