hotfix: revert some shit caused by merge
make the boar work with new AI features
This commit is contained in:
parent
3d6124d2ed
commit
b89719abed
@ -156,37 +156,6 @@ local behavior = {}
|
|||||||
behavior.__index = behavior
|
behavior.__index = behavior
|
||||||
behavior.id = "ai"
|
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
|
--- @param class Class
|
||||||
function behavior.new(class)
|
function behavior.new(class)
|
||||||
return setmetatable({
|
return setmetatable({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user