2020-07-19 15:07:35 +02:00
|
|
|
local FighterParent = require "scenes.battlesystem.controllers.fighters.parent"
|
|
|
|
local HeroFighter = FighterParent:extend()
|
|
|
|
|
2020-07-19 16:20:57 +02:00
|
|
|
local StatusBar = require "scenes.battlesystem.gui.statusbar"
|
|
|
|
|
2020-07-19 15:07:35 +02:00
|
|
|
local POSITIONS = {3, 1, 5}
|
|
|
|
local HEROES_LINE = 3;
|
|
|
|
|
|
|
|
function HeroFighter:new(owner, character, id)
|
|
|
|
self.name = character
|
|
|
|
self.super.new(self, owner, true, id)
|
2020-07-19 16:20:57 +02:00
|
|
|
|
|
|
|
self.statusbar = StatusBar(self)
|
|
|
|
end
|
|
|
|
|
|
|
|
function HeroFighter:updateAssets(dt)
|
|
|
|
self.statusbar:update(dt)
|
2020-07-19 15:07:35 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function HeroFighter:getAbstract()
|
|
|
|
return game.characters.list[self.name]
|
|
|
|
end
|
|
|
|
|
|
|
|
function HeroFighter:createActor()
|
|
|
|
local x, y = HEROES_LINE, POSITIONS[self.id]
|
|
|
|
return self.world.obj.Hero(self.world, x, y, self)
|
|
|
|
end
|
|
|
|
|
|
|
|
function HeroFighter:startAction()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
function HeroFighter:endAction()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2020-07-19 16:20:57 +02:00
|
|
|
-- DRAW FUNCTIONS
|
|
|
|
function HeroFighter:drawIcon(x, y)
|
|
|
|
local iconID = 1
|
|
|
|
self.assets.tileset["charicons"]:drawTile(iconID, x, y)
|
|
|
|
end
|
|
|
|
|
|
|
|
function HeroFighter:drawHUD()
|
|
|
|
self.statusbar:draw()
|
|
|
|
end
|
|
|
|
|
2020-07-19 15:07:35 +02:00
|
|
|
return HeroFighter
|