2021-04-03 10:39:34 +02:00
|
|
|
local AbstractMobParent = require "game.abstractmobs.parent"
|
2020-07-19 13:13:54 +02:00
|
|
|
|
2021-04-03 10:39:34 +02:00
|
|
|
local AbstractEnnemy = AbstractMobParent:extend()
|
2020-07-19 13:13:54 +02:00
|
|
|
|
2020-08-04 17:50:03 +02:00
|
|
|
local ennutils = require "game.utils.ennemies"
|
|
|
|
|
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
|
|
|
|
|
2021-05-15 14:50:12 +02:00
|
|
|
function AbstractEnnemy:haveProtecType(protectype)
|
|
|
|
return utils.table.contain(self.data.protectypes, protectype)
|
|
|
|
end
|
|
|
|
|
|
|
|
function AbstractEnnemy:getProtecTypes()
|
|
|
|
return self.data.protectypes
|
|
|
|
end
|
|
|
|
|
2020-07-19 13:13:54 +02:00
|
|
|
function AbstractEnnemy:initBasicElements()
|
2020-08-04 17:50:03 +02:00
|
|
|
self.data = ennutils.getData(self.directory, 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 17:50:03 +02:00
|
|
|
return self.data.stats
|
2020-07-19 13:13:54 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function AbstractEnnemy:createSkills()
|
2020-08-04 17:50:03 +02:00
|
|
|
return self.data.skills
|
2020-07-19 13:13:54 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
return AbstractEnnemy
|