Ajout des derniers développement #1

Merged
kazhnuz merged 68 commits from chronicles-cbs into master 2020-08-02 11:14:18 +02:00
3 changed files with 74 additions and 5 deletions
Showing only changes of commit 698d6697fb - Show all commits

View file

@ -0,0 +1,26 @@
AbstractMobParent = require "game.abstractmobs.parent"
AbstractEnnemy = AbstractMobParent:extend()
function AbstractEnnemy:new(name)
self.simplename = name
self.super.new(self)
end
function AbstractEnnemy:initBasicElements()
self.data = require("datas.gamedata.ennemies." .. self.simplename)
self.name = self.data.name
self.fullname = self.data.fullname
self.turns = self.data.turns
end
function AbstractEnnemy:createStats()
return require("datas.gamedata.ennemies." .. self.simplename .. ".stats")
end
function AbstractEnnemy:createSkills()
return require("datas.gamedata.ennemies." .. self.simplename .. ".skills")
end
return AbstractEnnemy

View file

@ -0,0 +1,45 @@
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

View file

@ -1,15 +1,13 @@
local EnnemyManager = Object:extend()
local AbstractEnnemy = require "game.abstractmobs.ennemy"
function EnnemyManager:new(controller)
self.controller = controller
end
function EnnemyManager:getEnnemyData(ennemy)
local data = require("datas.gamedata.ennemies." .. ennemy)
data.skills = require("datas.gamedata.ennemies." .. ennemy .. ".skills")
data.stats = require("datas.gamedata.ennemies." .. ennemy .. ".stats")
return data
return AbstractEnnemy(ennemy)
end
return EnnemyManager