sonic-radiance/sonic-radiance.love/game/abstractmobs/ennemy.lua

31 lines
789 B
Lua
Raw Normal View History

2020-07-19 13:13:54 +02:00
AbstractMobParent = require "game.abstractmobs.parent"
AbstractEnnemy = AbstractMobParent:extend()
2020-08-04 13:32:23 +02:00
function AbstractEnnemy:new(directory, name)
2020-07-19 13:13:54 +02:00
self.simplename = name
2020-08-04 13:32:23 +02:00
self.directory = directory
2020-07-19 13:13:54 +02:00
self.super.new(self)
end
2020-08-04 13:32:23 +02:00
function AbstractEnnemy:getDirectory()
return "datas.gamedata.ennemies." .. self.directory .. "."
end
2020-07-19 13:13:54 +02:00
function AbstractEnnemy:initBasicElements()
2020-08-04 13:32:23 +02:00
self.data = require(self:getDirectory() .. self.simplename)
2020-07-19 13:13:54 +02:00
self.name = self.data.name
self.fullname = self.data.fullname
self.turns = self.data.turns
end
function AbstractEnnemy:createStats()
2020-08-04 13:32:23 +02:00
return require(self:getDirectory() .. self.simplename .. ".stats")
2020-07-19 13:13:54 +02:00
end
function AbstractEnnemy:createSkills()
2020-08-04 13:32:23 +02:00
return require(self:getDirectory() .. self.simplename .. ".skills")
2020-07-19 13:13:54 +02:00
end
return AbstractEnnemy