Anonymous

Module:Items/UseTables: Difference between revisions

From Melvor Idle
m
Change Source Type to 'Downgrade' if the upgrade is a downgrade
m (Add missing class for sticky headers)
m (Change Source Type to 'Downgrade' if the upgrade is a downgrade)
 
Line 457: Line 457:
end
end
end
end
local upgradeCost = Common.getCostString({
["items"] = upgrade.itemCosts,
["currencies"] = upgrade.currencyCosts
})
table.insert(tableData, {
table.insert(tableData, {
['skill'] = 'Upgrade',
['skill'] = 'Upgrade',
['useType'] = '[[Upgrading Items|Upgrade]]',
['useType'] = '[[Upgrading Items|' .. (upgrade.isDowngrade and 'Downgrade' or 'Upgrade') .. ']]',
['reqs'] = reqs,
['reqs'] = reqs,
['costs'] = upgradeCost,
['costs'] = Common.getCostString({ ["items"] = upgrade.itemCosts, ["currencies"] = upgrade.currencyCosts }),
['productName'] = upgradeItem.name,
['productName'] = upgradeItem.name,
['qty'] = (upgrade.quantity or 1)
['qty'] = (upgrade.quantity or 1)
Line 533: Line 529:
end
end
end
end
local costs = Common.getCostString({
["items"] = costDef.itemCosts,
["currencies"] = recipe.currencyCosts
})
table.insert(tableData, {
table.insert(tableData, {
['skill'] = skillName,
['skill'] = skillName,
Line 543: Line 535:
['useType'] = Icons.Icon({skillName, type='skill'}),
['useType'] = Icons.Icon({skillName, type='skill'}),
['reqs'] = (reqs or Icons._SkillReq(skillName, lvl, false, (isAbyssal and "melvorItA:Abyssal" or nil))),
['reqs'] = (reqs or Icons._SkillReq(skillName, lvl, false, (isAbyssal and "melvorItA:Abyssal" or nil))),
['costs'] = costs,
['costs'] = Common.getCostString({ ["items"] = costDef.itemCosts, ["currencies"] = recipe.currencyCosts }),
['productName'] = recipeItem.name,
['productName'] = recipeItem.name,
['qty'] = (recipe.baseQuantity or 1) * (costDef.quantityMultiplier or 1),
['qty'] = (recipe.baseQuantity or 1) * (costDef.quantityMultiplier or 1),
Line 582: Line 574:
local obstacles = Agility.getObstaclesForItem(item.id)
local obstacles = Agility.getObstaclesForItem(item.id)
for i, obstacle in ipairs(obstacles) do
for i, obstacle in ipairs(obstacles) do
local costs = Common.getCostString({
["items"] = obstacle.itemCosts,
["currencies"] = obstacle.currencyCosts
})
table.insert(tableData, {
table.insert(tableData, {
['skill'] = 'Agility',
['skill'] = 'Agility',
Line 592: Line 580:
['useType'] = Icons.Icon({'Agility', type='skill'}),
['useType'] = Icons.Icon({'Agility', type='skill'}),
['reqs'] = Agility._getObstacleRequirements(obstacle),
['reqs'] = Agility._getObstacleRequirements(obstacle),
['costs'] = costs,
['costs'] = Common.getCostString({ ["items"] = obstacle.itemCosts, ["currencies"] = obstacle.currencyCosts }),
['productName'] = obstacle.name,
['productName'] = obstacle.name,
['iconType'] = 'agility',
['iconType'] = 'agility',
Line 640: Line 628:
table.insert(recipeCosts, { id = nonShardItemID, quantity = nonShardQty })
table.insert(recipeCosts, { id = nonShardItemID, quantity = nonShardQty })
end
end
local costs = Common.getCostString({
["items"] = recipeCosts,
["currencies"] = recipe.currencyCosts
})
table.insert(tableData, {
table.insert(tableData, {
['skill'] = 'Summoning',
['skill'] = 'Summoning',
Line 650: Line 634:
['useType'] = Icons.Icon({ 'Summoning', type='skill' }),
['useType'] = Icons.Icon({ 'Summoning', type='skill' }),
['reqs'] = Icons._SkillReq('Summoning', lvl, false, (isAbyssal and 'melvorItA:Abyssal' or nil)),
['reqs'] = Icons._SkillReq('Summoning', lvl, false, (isAbyssal and 'melvorItA:Abyssal' or nil)),
['costs'] = costs,
['costs'] = Common.getCostString({ ["items"] = recipeCosts, ["currencies"] = recipe.currencyCosts }),
['productName'] = recipeItem.name,
['productName'] = recipeItem.name,
['qty'] = recipe.baseQuantity,
['qty'] = recipe.baseQuantity,
Line 874: Line 858:
'Ancient Ring of Mastery',
'Ancient Ring of Mastery',
'Mysterious Stone',
'Mysterious Stone',
'Charge Stone of Rhaelyx',
'Mastery Token (Cooking)',
'Mastery Token (Cooking)',
'Gem Gloves',
'Gem Gloves',