2020-07-19 15:07:35 +02:00
|
|
|
local FighterParent = require "scenes.battlesystem.controllers.fighters.parent"
|
|
|
|
local VillainFighter = FighterParent:extend()
|
|
|
|
|
2020-07-19 16:20:57 +02:00
|
|
|
local SimpleHPBar = require "scenes.battlesystem.gui.simplehpbar"
|
|
|
|
|
2020-07-19 15:07:35 +02:00
|
|
|
local POSITIONS = {3, 1, 5}
|
|
|
|
local ENNEMY_LINE = 10;
|
|
|
|
|
|
|
|
function VillainFighter:new(owner, ennemy, id)
|
|
|
|
self.name = ennemy
|
|
|
|
self.super.new(self, owner, false, id)
|
2020-07-19 16:20:57 +02:00
|
|
|
|
|
|
|
self.hpbar = SimpleHPBar(self.abstract.hp)
|
2020-07-19 15:07:35 +02:00
|
|
|
end
|
|
|
|
|
2020-07-19 16:20:57 +02:00
|
|
|
function VillainFighter:updateAssets(dt)
|
|
|
|
self.hpbar:update(dt)
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2020-07-19 15:07:35 +02:00
|
|
|
function VillainFighter:getAbstract()
|
|
|
|
return game.ennemies:getEnnemyData(self.name)
|
|
|
|
end
|
|
|
|
|
|
|
|
function VillainFighter:createActor()
|
|
|
|
local x, y = ENNEMY_LINE, POSITIONS[self.id]
|
|
|
|
return self.world.obj.Ennemy(self.world, x, y, self)
|
|
|
|
end
|
|
|
|
|
|
|
|
function VillainFighter:startAction()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
function VillainFighter:endAction()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2020-07-19 16:20:57 +02:00
|
|
|
-- DRAW FUNCTIONS
|
|
|
|
function VillainFighter:drawIcon(x, y)
|
|
|
|
love.graphics.setColor(1, 0, 0, 1)
|
|
|
|
love.graphics.rectangle("fill", x, y, 16, 16)
|
|
|
|
love.graphics.setColor(1, 1, 1, 1)
|
|
|
|
end
|
|
|
|
|
|
|
|
function VillainFighter:drawHUD(x, y)
|
|
|
|
self.hpbar:draw(x, y)
|
|
|
|
end
|
|
|
|
|
2020-07-19 15:07:35 +02:00
|
|
|
return VillainFighter
|