38 lines
893 B
Lua
38 lines
893 B
Lua
local Battler = require("scenes.battlesystem.actors.battler")
|
|
local Ennemy = Battler:extend()
|
|
|
|
local gui = require "game.modules.gui"
|
|
|
|
function Ennemy:new(world, x, y, owner)
|
|
Ennemy.super.new(self, world, x, y, 0, owner)
|
|
self.isEnnemy = true
|
|
|
|
self.actionPerTurn = 2
|
|
self:initSprite()
|
|
end
|
|
|
|
function Ennemy:draw()
|
|
self:drawSprite(0, -self.z)
|
|
local x, y = self.world.map:gridToPixel(self.x, self.y, true)
|
|
|
|
self.owner:drawHUD(x - 12, y - self.owner.abstract.data.hudHeight)
|
|
|
|
if (self.isSelected) then
|
|
local height = 32
|
|
self.assets.images["cursorpeak"]:draw(x - 7, y - 24 - 32)
|
|
end
|
|
end
|
|
|
|
function Ennemy:getStats()
|
|
return self.data.stats
|
|
end
|
|
|
|
-- ASSETS FUNCTIONS
|
|
-- Load and play assets needed by the character
|
|
|
|
function Ennemy:getSpritePath()
|
|
return "datas/gamedata/ennemies/" .. self.owner.category .. "/" .. self.owner.name .. "/sprites"
|
|
end
|
|
|
|
|
|
return Ennemy
|