2019-08-14 16:26:23 +02:00
|
|
|
local Battler = require("scenes.battlesystem.actors.battler")
|
|
|
|
local Ennemy = Battler:extend()
|
2019-03-10 13:11:26 +01:00
|
|
|
|
2019-08-14 22:47:10 +02:00
|
|
|
local gui = require "game.modules.gui"
|
|
|
|
|
2019-08-14 16:26:23 +02:00
|
|
|
function Ennemy:new(world, x, y)
|
|
|
|
Ennemy.super.new(self, world, x, y, 0)
|
2019-03-10 13:11:26 +01:00
|
|
|
self.isEnnemy = true
|
|
|
|
|
|
|
|
self.actionPerTurn = 2
|
|
|
|
end
|
|
|
|
|
|
|
|
function Ennemy:draw()
|
2019-08-14 22:47:10 +02:00
|
|
|
local x, y = self.maputils.gridToPixel(self.x, self.y, true)
|
2019-03-10 13:11:26 +01:00
|
|
|
love.graphics.setColor(1, 0, 0, 1)
|
|
|
|
love.graphics.rectangle("fill", x - 8, y - 32, 16, 32)
|
|
|
|
love.graphics.setColor(1, 1, 1, 1)
|
|
|
|
end
|
|
|
|
|
2019-08-14 22:47:10 +02:00
|
|
|
function Ennemy:drawHUD()
|
|
|
|
local x, y = self.maputils.gridToPixel(self.x, self.y, true)
|
|
|
|
love.graphics.setColor(0, 0, 0, 1)
|
|
|
|
gui.drawBar(x - 14, y - 38, 26, 4)
|
|
|
|
love.graphics.setColor(248/255, 160/255, 0, 1)
|
|
|
|
gui.drawBar(x - 14, y - 37, 24, 2)
|
|
|
|
love.graphics.setColor(1, 1, 1, 1)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2019-03-10 13:11:26 +01:00
|
|
|
function Ennemy: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 Ennemy:getStats()
|
|
|
|
local stats = {}
|
2019-08-14 22:47:10 +02:00
|
|
|
stats.speed = 25
|
2019-03-10 13:11:26 +01:00
|
|
|
|
|
|
|
return stats
|
|
|
|
end
|
|
|
|
|
|
|
|
return Ennemy
|