2019-08-22 21:33:13 +02:00
|
|
|
local SkillManager = Object:extend()
|
|
|
|
|
|
|
|
function SkillManager:new(controller)
|
|
|
|
self.controller = controller
|
|
|
|
end
|
|
|
|
|
|
|
|
function SkillManager:getSkillData(skillname)
|
2021-05-15 21:43:15 +02:00
|
|
|
if core.datas:exists("skills", skillname) then
|
|
|
|
return core.datas:get("skills", skillname)
|
2019-08-22 21:33:13 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function SkillManager:skillDataExists(skillname)
|
2021-05-15 21:43:15 +02:00
|
|
|
return core.datas:exists("skills", skillname)
|
2019-08-22 21:33:13 +02:00
|
|
|
end
|
|
|
|
|
2020-08-04 23:21:45 +02:00
|
|
|
function SkillManager:getEnnemySkillData(skillname)
|
2021-05-15 21:43:15 +02:00
|
|
|
if core.datas:exists("badskills", skillname) then
|
|
|
|
return core.datas:get("badskills", skillname)
|
2020-08-04 23:21:45 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function SkillManager:ennemySkillDataExists(skillname)
|
2021-05-15 21:43:15 +02:00
|
|
|
return core.datas:exists("badskills", skillname)
|
2020-08-04 23:21:45 +02:00
|
|
|
end
|
|
|
|
|
2019-08-25 15:53:56 +02:00
|
|
|
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
|
|
|
|
|
2019-08-22 21:33:13 +02:00
|
|
|
return SkillManager
|