Module:Sandbox/Skills/Agility: Difference between revisions

_getObstacleRequirements: Implement
(Testing for 1.0.3)
 
(_getObstacleRequirements: Implement)
Line 46: Line 46:
   end
   end
   return result
   return result
end
function p._getObstacleRequirements(obstacle)
local resultPart = {}
if obstacle.category > 0 then
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 116:


     --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.skillRequirements ~= nil then
      for j, skillReq in ipairs(obst.skillRequirements) do
        result = result..'<br/>'..Icons._SkillReq(Constants.getSkillName(skillReq.skill), skillReq.level)
      end
    end


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