sonic-radiance/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua

47 lines
980 B
Lua

local FighterParent = require "scenes.battlesystem.controllers.fighters.parent"
local HeroFighter = FighterParent:extend()
local StatusBar = require "scenes.battlesystem.gui.statusbar"
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)
self.statusbar = StatusBar(self)
end
function HeroFighter:updateAssets(dt)
self.statusbar:update(dt)
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
-- 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
return HeroFighter