Anonymous

Module:Items: Difference between revisions

From Melvor Idle
Added new Passive Items category
(sorting weapons by name in getSpecialAttackTable)
(Added new Passive Items category)
(2 intermediate revisions by the same user not shown)
Line 12: Line 12:


local Shared = require('Module:Shared')
local Shared = require('Module:Shared')
local Magic = require('Module:Magic')
local Icons = require('Module:Icons')
local Icons = require('Module:Icons')


Line 253: Line 252:
   if item.tier ~= nil then result = result..'[[Category:'..Shared.titleCase(item.tier)..' '..item.type..']]' end
   if item.tier ~= nil then result = result..'[[Category:'..Shared.titleCase(item.tier)..' '..item.type..']]' end
   if item.hasSpecialAttack then result = result..'[[Category:Items With Special Attacks]]' end
   if item.hasSpecialAttack then result = result..'[[Category:Items With Special Attacks]]' end
  if item.isPassiveItem then result = result..'[[Category:Passive Items]]' end
   return result
   return result
end
end
Line 337: Line 337:
   local result = '{|class="wikitable sortable stickyHeader"'
   local result = '{|class="wikitable sortable stickyHeader"'
   result = result..'\r\n|-class="headerRow-0"'
   result = result..'\r\n|-class="headerRow-0"'
   result = result..'\r\n!Weapon(s)!!Name!!Chance!!Effect'
   result = result..'\r\n!style="min-width:180px"|Weapon(s)!!Name!!Chance!!Effect'
   for i, spAttData in Shared.skpairs(spAttTable) do
   for i, spAttData in Shared.skpairs(spAttTable) do
     local spAtt = p.getSpecialAttackByID(i)
     local spAtt = p.getSpecialAttackByID(i)