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

58 lines
1.2 KiB
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: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()
core.debug:print("cbs/heroFighter", "launching the action menu")
self.turnSystem.scene.menu:set( self )
end
function HeroFighter:endAction()
end
-- Basic actions
function HeroFighter:doNothing()
self:setInactive()
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