diff --git a/sonic-radiance.love/datas/gamedata/skills/init.lua b/sonic-radiance.love/datas/gamedata/skills/init.lua new file mode 100644 index 0000000..cd3e25b --- /dev/null +++ b/sonic-radiance.love/datas/gamedata/skills/init.lua @@ -0,0 +1,15 @@ +return { + actions = { + ["wait"] = {"wait", {"duration"}}, + ["addGFX"] = {"addGFX", {'sprite', "dx", "dy", "affectedByDirection", 'blockProcess'}}, + ["playSFX"] = {"playSFX", {"sfx"}}, + ["sendDamage"] = {"sendDamage", {"power", "accuracy", "isSpecial", "isAerial"}}, + ["sendDamageFromPos"] = {"sendDamageToPoint", {"dx", "dy", "power", "accuracy", "isSpecial", "isAerial", "affectedByDirection"}}, + ["sendDamageFromCursor"] = {"sendDamageToPoint", {"dx", "dy", "power", "accuracy", "isSpecial", "isAerial", "affectedByDirection"}}, + ["dashForward"] = {"dashForward", {"speed", "blockProcess"}}, + ["setAnimation"] = {"setAnimation", {"animation", "blockProcess"}}, + ["jumpBack"] = {"jump", {"blockProcess"}}, + ["jumpToCursor"] = {"jump", {"blockProcess"}}, + --[name] = {type, {args}}, + } +} diff --git a/sonic-radiance.love/game/skills.lua b/sonic-radiance.love/game/skills.lua index bdbc345..39383ee 100644 --- a/sonic-radiance.love/game/skills.lua +++ b/sonic-radiance.love/game/skills.lua @@ -16,4 +16,24 @@ function SkillManager:skillDataExists(skillname) return (fileinfo ~= nil) 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