Module:Skills/Agility: Difference between revisions

_getObstacleLevel: Remove in favour of getRecipeLevel from Module:Skills
(Added IDs to Agility Obstacle table to allow forcibly linking to specific obstacles)
(_getObstacleLevel: Remove in favour of getRecipeLevel from Module:Skills)
Line 5: Line 5:
local GameData = require('Module:GameData')
local GameData = require('Module:GameData')
local SkillData = GameData.skillData
local SkillData = GameData.skillData
local Skills = require('Module:Skills')
local Items = require('Module:Items')
local Items = require('Module:Items')
local Icons = require('Module:Icons')
local Icons = require('Module:Icons')
Line 37: Line 38:
end
end
return result
return result
end
function p._getObstacleLevel(obstacle)
if obstacle.category ~= nil then
if obstacle.category == 0 then
return 1
else
return SkillData.Agility.obstacleUnlockLevels[obstacle.category]
end
else
local _, localID = GameData.getLocalID(obstacle.id)
if localID ~= nil then
if string.find(localID, '^Pillar') ~= nil then
return 99
elseif string.find(localID, '^ElitePillar') ~= nil then
return 120
end
end
end
end
end


function p._getObstacleRequirements(obstacle)
function p._getObstacleRequirements(obstacle)
local resultPart = {}
local resultPart = {}
local level = p._getObstacleLevel(obstacle)
local level = Skills.getRecipeLevel('Agility', obstacle)
if level ~= nil then
if level ~= nil then
table.insert(resultPart, Icons._SkillReq('Agility', level))
table.insert(resultPart, Icons._SkillReq('Agility', level))