Module:Items: Difference between revisions

added code to quickly find all lifesteal weapons. Not used anywhere, but I'm saving it in case it's useful later
(getStatChangeString: Re-structure for potential performance benefits, and correct issue where certain skills may be omitted)
(added code to quickly find all lifesteal weapons. Not used anywhere, but I'm saving it in case it's useful later)
Line 850: Line 850:
table.insert(resultPart, '\r\n|}')
table.insert(resultPart, '\r\n|}')
return table.concat(resultPart)
return table.concat(resultPart)
end
function p.getLifestealWeapons()
local items = p.getItems(function(item)
if item.specialAttacks ~= nil and not Shared.tableIsEmpty(item.specialAttacks) then
for i, spAttID in ipairs(item.specialAttacks) do
local spAtt = GameData.getEntityByID('attacks', spAttID)
if spAtt ~= nil then
return spAtt.lifesteal > 0
end
end
end
return false
end)
for i, item in ipairs(items) do
mw.log(item.name)
end
end
end


return p
return p