chore: kill game.skills
This commit is contained in:
parent
e9c9cbb8e3
commit
534517f0f3
8 changed files with 10 additions and 59 deletions
|
@ -28,7 +28,6 @@ local Serializer = require "birb.classes.serializable.serializer"
|
||||||
local Game = Serializer:extend()
|
local Game = Serializer:extend()
|
||||||
local Characters = require "game.characters"
|
local Characters = require "game.characters"
|
||||||
local Ennemies = require "game.ennemies"
|
local Ennemies = require "game.ennemies"
|
||||||
local Skills = require "game.skills"
|
|
||||||
local Loot = require "game.loot"
|
local Loot = require "game.loot"
|
||||||
local CBSCore = require "game.battle"
|
local CBSCore = require "game.battle"
|
||||||
local Difficulty = require "game.difficulty"
|
local Difficulty = require "game.difficulty"
|
||||||
|
@ -92,7 +91,6 @@ function Game:reset()
|
||||||
|
|
||||||
self.characters = Characters(self)
|
self.characters = Characters(self)
|
||||||
self.ennemies = Ennemies(self)
|
self.ennemies = Ennemies(self)
|
||||||
self.skills = Skills(self)
|
|
||||||
self.loot = Loot(self)
|
self.loot = Loot(self)
|
||||||
self.cbs = CBSCore(self)
|
self.cbs = CBSCore(self)
|
||||||
self.difficulty = Difficulty(self)
|
self.difficulty = Difficulty(self)
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
local SkillManager = Object:extend()
|
|
||||||
|
|
||||||
function SkillManager:new(controller)
|
|
||||||
self.controller = controller
|
|
||||||
end
|
|
||||||
|
|
||||||
function SkillManager:getSkillData(skillname)
|
|
||||||
if core.datas:exists("skills", skillname) then
|
|
||||||
return core.datas:get("skills", skillname)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function SkillManager:skillDataExists(skillname)
|
|
||||||
return core.datas:exists("skills", skillname)
|
|
||||||
end
|
|
||||||
|
|
||||||
function SkillManager:getEnnemySkillData(skillname)
|
|
||||||
if core.datas:exists("badskills", skillname) then
|
|
||||||
return core.datas:get("badskills", skillname)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function SkillManager:ennemySkillDataExists(skillname)
|
|
||||||
return core.datas:exists("badskills", skillname)
|
|
||||||
end
|
|
||||||
|
|
||||||
function SkillManager:getActionArguments(choregraphyAction)
|
|
||||||
local choregraphyData = require "datas.gamedata.skills"
|
|
||||||
local args = {}
|
|
||||||
args.name = choregraphyAction[1]
|
|
||||||
args.condition = choregraphyAction[2]
|
|
||||||
local actionData = choregraphyData.actions[args.name]
|
|
||||||
if actionData ~= nil then
|
|
||||||
args.type = actionData[1]
|
|
||||||
local argumentList = actionData[2]
|
|
||||||
for i, argData in ipairs(choregraphyAction) do
|
|
||||||
if i > 2 then
|
|
||||||
local argName = argumentList[i-2] or ""
|
|
||||||
args[argName] = argData
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return args
|
|
||||||
end
|
|
||||||
|
|
||||||
return SkillManager
|
|
|
@ -17,7 +17,7 @@ function ActionParent:update(dt)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ActionParent:loadChoregraphy(skillname)
|
function ActionParent:loadChoregraphy(skillname)
|
||||||
local skill = game.skills:getSkillData(skillname)
|
local skill = core.datas:get("skills", skillname)
|
||||||
self.choregraphy = ChoregraphySystem(self, skill.choregraphy)
|
self.choregraphy = ChoregraphySystem(self, skill.choregraphy)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ local ActionParent = require "scenes.battlesystem.controllers.fighters.systems.a
|
||||||
local SkillAction = ActionParent:extend()
|
local SkillAction = ActionParent:extend()
|
||||||
|
|
||||||
function SkillAction:new(fighter, skill)
|
function SkillAction:new(fighter, skill)
|
||||||
self.data = game.skills:getSkillData(skill)
|
self.data = core.datas:get("skills", skill)
|
||||||
SkillAction.super.new(self, fighter)
|
SkillAction.super.new(self, fighter)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ local ActionParent = require "scenes.battlesystem.controllers.fighters.systems.a
|
||||||
local EnnemyAction = ActionParent:extend()
|
local EnnemyAction = ActionParent:extend()
|
||||||
|
|
||||||
function EnnemyAction:new(fighter, skill)
|
function EnnemyAction:new(fighter, skill)
|
||||||
self.data = game.skills:getEnnemySkillData(skill)
|
self.data = core.datas:get("badskills", skill)
|
||||||
EnnemyAction.super.new(self, fighter)
|
EnnemyAction.super.new(self, fighter)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ function widgets.SkillWidget:new(character, menu_name, skill)
|
||||||
self.skillname = skill
|
self.skillname = skill
|
||||||
local label2 = "00"
|
local label2 = "00"
|
||||||
|
|
||||||
self.skilldata = game.skills:getSkillData(skill)
|
self.skilldata = core.datas:get("skills", skill)
|
||||||
|
|
||||||
if self.skilldata ~= nil then
|
if self.skilldata ~= nil then
|
||||||
label2 = self.skilldata.cost or 0
|
label2 = self.skilldata.cost or 0
|
||||||
|
|
|
@ -35,7 +35,7 @@ function ChoregraphyViewer:buildCharacterMenu()
|
||||||
self:addSubMenu("characters", "MainMenu", "Rivals")
|
self:addSubMenu("characters", "MainMenu", "Rivals")
|
||||||
for k, character in pairs(game.characters.list) do
|
for k, character in pairs(game.characters.list) do
|
||||||
self:addSubMenu(k, "characters", character.fullname)
|
self:addSubMenu(k, "characters", character.fullname)
|
||||||
menu.HeroChoregraphyWidget(self, k, game.skills:getSkillData("attack"))
|
menu.HeroChoregraphyWidget(self, k, core.datas:get("skills", "attack"))
|
||||||
self:buildSkillMenu(k)
|
self:buildSkillMenu(k)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -51,8 +51,8 @@ function ChoregraphyViewer:buildEnnemySkillMenu(category, ennemy)
|
||||||
self:addSubMenu(ennemy, category, ennemy)
|
self:addSubMenu(ennemy, category, ennemy)
|
||||||
local data = core.datas:get("ennemies", ennemy)
|
local data = core.datas:get("ennemies", ennemy)
|
||||||
for j,skillName in ipairs(data.skills) do
|
for j,skillName in ipairs(data.skills) do
|
||||||
if (game.skills:ennemySkillDataExists(skillName)) then
|
if (core.datas:exists("badskills", skillName)) then
|
||||||
menu.EnnemyChoregraphyWidget(self, category, ennemy, game.skills:getEnnemySkillData(skillName))
|
menu.EnnemyChoregraphyWidget(self, category, ennemy, core.datas:get("badskills", skillName))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -64,8 +64,8 @@ function ChoregraphyViewer:buildSkillMenu(charName)
|
||||||
local skillName = skill[1]
|
local skillName = skill[1]
|
||||||
if (skillTreated[skillName] ~= true) then
|
if (skillTreated[skillName] ~= true) then
|
||||||
skillTreated[skillName] = true
|
skillTreated[skillName] = true
|
||||||
if (game.skills:skillDataExists(skillName)) then
|
if (core.datas:exists("skills", skillName)) then
|
||||||
menu.HeroChoregraphyWidget(self, charName, game.skills:getSkillData(skillName))
|
menu.HeroChoregraphyWidget(self, charName, core.datas:get("skills", skillName))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -60,7 +60,7 @@ end
|
||||||
|
|
||||||
function SkillWidget:new(page, skill)
|
function SkillWidget:new(page, skill)
|
||||||
self.page = page
|
self.page = page
|
||||||
self.skillData = game.skills:getSkillData(skill)
|
self.skillData = core.datas:get("skills", skill)
|
||||||
SkillWidget.super.new(self, self.page.view.scene, "equip", self.skillData.fullname, utils.math.numberToString(self.skillData.cost, 2))
|
SkillWidget.super.new(self, self.page.view.scene, "equip", self.skillData.fullname, utils.math.numberToString(self.skillData.cost, 2))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue