Module:Calculator/AgilityObstacle: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 35: Line 35:
local function getObstacle(name)
local function getObstacle(name)
name = Shared.specialTitleCase(name)
name = Shared.specialTitleCase(name)
local obstacle = Agility.getObstacle(name)
local obstacle = Agility.getObstacle(name) or Agility.getPillar(name)
if obstacle == nil then
if obstacle == nil then
return nil
return nil
end
end
 
-- TODO: Handle pillars and return the same format/table.
-- Resolve obstacle slot.
-- if obstacle == pillar.....
local slot = 0
if string.find(name, 'Pillar') then
if string.find(name, 'Elite') then
slot = 'Elite Pillar'
else
slot = 'Pillar'
end
else
slot = obstacle.category + 1
end
local obstacleInfo = {
local obstacleInfo = {
Name = obstacle.name,
Name = obstacle.name,
Slot = obstacle.category + 1,
Slot = slot,
LevelRequirements = Agility.getObstacleRequirements(obstacle),
LevelRequirements = Agility.getObstacleRequirements(obstacle),
ItemCosts = Agility.getObstacleCosts(obstacle),
ItemCosts = Agility.getObstacleCosts(obstacle),
2,875

edits