Module:Skills/Agility: Difference between revisions

Update for v1.0.3
No edit summary
(Update for v1.0.3)
Line 46: Line 46:
   end
   end
   return result
   return result
end
function p._getObstacleRequirements(obstacle)
local resultPart = {}
if obstacle.category == nil then
-- Pillar
table.insert(resultPart, Icons._SkillReq('Agility', 99))
elseif obstacle.category > 0 then
-- Obstacle
table.insert(resultPart, Icons._SkillReq('Agility', obstacle.category * 10))
end
if type(obstacle.skillRequirements) == 'table' then
for i, skillReq in ipairs(obstacle.skillRequirements) do
local skillName = Constants.getSkillName(skillReq.skill)
if skillName ~= nil then
table.insert(resultPart, Icons._SkillReq(skillName, skillReq.level))
end
end
end
return table.concat(resultPart, '<br/>')
end
end


Line 100: Line 120:


     --Grabbing requirements to create
     --Grabbing requirements to create
     result = result..'||'
     result = result..'|| ' .. p._getObstacleRequirements(obst)
    if obst.category > 0 then
      result = result..Icons._SkillReq('Agility', obst.category * 10)
    end
    if obst.requirements ~= nil and obst.requirements.skillLevel ~= nil then
      for j, skillReq in ipairs(obst.requirements.skillLevel) do
        result = result..'<br/>'..Icons._SkillReq(Constants.getSkillName(skillReq[1]), skillReq[2])
      end
    end


     --Finally, the cost
     --Finally, the cost