2021-08-15 16:50:53 +02:00
|
|
|
local FighterControllerParent = require "scenes.battlesystem.fighters.parent"
|
2020-07-19 15:07:35 +02:00
|
|
|
local HeroFighterController = FighterControllerParent:extend()
|
2020-07-18 09:51:02 +02:00
|
|
|
|
2021-08-15 16:50:53 +02:00
|
|
|
local Character = require "scenes.battlesystem.fighters.character"
|
2020-07-18 09:51:02 +02:00
|
|
|
|
2020-07-19 15:07:35 +02:00
|
|
|
function HeroFighterController:new(owner)
|
|
|
|
self.super.new(self, owner)
|
|
|
|
self:initHeroes()
|
2020-07-18 09:51:02 +02:00
|
|
|
end
|
|
|
|
|
2020-07-19 15:07:35 +02:00
|
|
|
function HeroFighterController:initHeroes()
|
|
|
|
for i, hero in ipairs(game.characters.team) do
|
|
|
|
self:add(Character(self, hero, i))
|
|
|
|
end
|
2020-07-18 09:51:02 +02:00
|
|
|
end
|
|
|
|
|
2021-03-13 18:00:39 +01:00
|
|
|
function HeroFighterController:fleeBattle()
|
|
|
|
for i, hero in ipairs(self.list) do
|
|
|
|
hero.actor:flee()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-07-19 15:07:35 +02:00
|
|
|
return HeroFighterController
|