45 lines
849 B
Lua
45 lines
849 B
Lua
local AbstractMobParent = Object:extend()
|
|
|
|
function AbstractMobParent:new()
|
|
self:initBasicElements()
|
|
self.stats = self:createStats()
|
|
self.skills = self:createSkills()
|
|
self:initLife()
|
|
end
|
|
|
|
function AbstractMobParent:initBasicElements()
|
|
self.name = "PlaceHolder"
|
|
self.fullname = "PlaceHolder"
|
|
self.turns = 2
|
|
end
|
|
|
|
function AbstractMobParent:createStats()
|
|
local stats = {}
|
|
|
|
stats.hpmax = 0
|
|
stats.ppmax = 0
|
|
stats.attack = 0
|
|
stats.power = 0
|
|
stats.defense = 0
|
|
stats.technic = 0
|
|
stats.mind = 0
|
|
stats.speed = 0
|
|
|
|
return stats
|
|
end
|
|
|
|
function AbstractMobParent:createSkills()
|
|
return {}
|
|
end
|
|
|
|
function AbstractMobParent:initLife()
|
|
self.hp = self.stats.hpmax
|
|
self.mp = self.stats.mpmax
|
|
self.status = 0
|
|
end
|
|
|
|
function AbstractMobParent:getStats()
|
|
return self.stats
|
|
end
|
|
|
|
return AbstractMobParent
|