2,869
edits
No edit summary |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 17: | Line 17: | ||
local GameData = require('Module:GameData') | local GameData = require('Module:GameData') | ||
local SkillData = GameData.skillData | local SkillData = GameData.skillData | ||
local Num = require('Module:Number') | |||
-- This excludes certain checks pertinent to all skills, like equipment | -- This excludes certain checks pertinent to all skills, like equipment | ||
Line 1,238: | Line 1,239: | ||
processed['entityName'] = gatherable.name | processed['entityName'] = gatherable.name | ||
elseif skillName == 'Mining' then | elseif skillName == 'Mining' then | ||
processed['subType'] = node. | processed['subType'] = node.category | ||
elseif skillName == 'Farming' then | elseif skillName == 'Farming' then | ||
processed['entityName'] = gatherable.name | processed['entityName'] = gatherable.name | ||
Line 1,337: | Line 1,338: | ||
table.insert(extraReqs, Shop._getPurchaseIcon({req.purchase})) | table.insert(extraReqs, Shop._getPurchaseIcon({req.purchase})) | ||
elseif req.type == 'totalMastery' then | elseif req.type == 'totalMastery' then | ||
table.insert(extraReqs, | table.insert(extraReqs, Num.formatnum(req.mastery) .. ' ' .. Icons.Icon({req.skill, type='skill', notext=true}) .. ' ' .. Icons.Icon({'Mastery'})) | ||
elseif req.type == 'TownshipBuilding' then | elseif req.type == 'TownshipBuilding' then | ||
local building = Township._getBuildingByID(req.buildingID) | local building = Township._getBuildingByID(req.buildingID) | ||
Line 1,391: | Line 1,392: | ||
if entity.subType == 'fish' then | if entity.subType == 'fish' then | ||
iconType = 'item' | iconType = 'item' | ||
elseif | elseif Shared.contains({ | ||
'melvorD:Ore', | |||
'melvorD:Essence', | |||
'melvorD:Gem', | |||
'melvorItA:AbyssalOre', | |||
'melvorItA:AbyssalGem', | |||
'melvorItA:Outcrop', | |||
'melvorItA:AbyssalEssence' | |||
}, entity.subType) then | |||
iconType = 'rock' | iconType = 'rock' | ||
else | else | ||
Line 1,449: | Line 1,458: | ||
end | end | ||
function p._getSkillUnlockTable(skillName) | function p._getSkillUnlockTable(skillName, args) | ||
local itemsOnly = args.itemsOnly ~= nil and args.itemsOnly or false | |||
-- TODO: Pass these min/max level params along to filter by them | |||
local minLevel = args.minLevel ~= nil and args.minLevel or 0 | |||
local maxLevel = args.maxLevel ~= nil and args.maxLevel or 999 | |||
-- What do we need to check for this skill? Avoid checking everything for | -- What do we need to check for this skill? Avoid checking everything for | ||
-- every skill to save time, except for a few broad things | -- every skill to save time, except for a few broad things | ||
local entityList = {} | local entityList = {} | ||
entityList = p._addItemsWithSkillRequirement(entityList, skillName) | entityList = p._addItemsWithSkillRequirement(entityList, skillName) | ||
-- Now loop through the stuff relevant to this skill | if not itemsOnly then | ||
entityList = p._addShopPurchasesWithSkillRequirements(entityList, skillName) | |||
entityList = p._addTraderItemsWithSkillRequirements(entityList, skillName) | |||
entityList = p._addAgilityObstaclesWithSkillRequirements(entityList, skillName) | |||
-- Now loop through the stuff relevant to this skill | |||
for i, dataSource in ipairs(SKILL_CHECK_MAP[skillName]) do | |||
entityList = SOURCE_FUNCS[dataSource](entityList, skillName) | |||
end | |||
end | end | ||
Line 1,548: | Line 1,565: | ||
function p.getSkillUnlockTable(frame) | function p.getSkillUnlockTable(frame) | ||
local | local args = frame.args ~= nil and frame.args or frame | ||
return p._getSkillUnlockTable(skillName | local skillName = args[1] | ||
return p._getSkillUnlockTable(skillName, args) | |||
end | end | ||
return p | return p |
edits