sonic-radiance/sonic-radiance.love/game/skills.lua

48 lines
1.2 KiB
Lua
Raw Normal View History

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