Module:Items: Difference between revisions

added a note that an item is passive in the description
(Fixed attack type error)
(added a note that an item is passive in the description)
Line 207: Line 207:
local resultPart = {}
local resultPart = {}
--For equipment, show the slot they go in
--For equipment, show the slot they go in
local isPassive = false
if item.validSlots ~= nil then
if item.validSlots ~= nil then
local slotLinkMap = {
local slotLinkMap = {
Line 232: Line 233:
else
else
table.insert(slotText, '[[' .. slotLink .. '|' .. slot .. ']]')
table.insert(slotText, '[[' .. slotLink .. '|' .. slot .. ']]')
end
if slot == 'Passive' then
isPassive = true
end
end
end
end
Line 266: Line 271:
--For items with modifiers, show what those are
--For items with modifiers, show what those are
if item.modifiers ~= nil and not Shared.tableIsEmpty(item.modifiers) then
if item.modifiers ~= nil and not Shared.tableIsEmpty(item.modifiers) then
table.insert(resultPart, "\r\n|-\r\n|'''Modifiers:'''\r\n"..Constants.getModifiersText(item.modifiers, true, false, 10))
table.insert(resultPart, "\r\n|-\r\n|'''Modifiers:'''")
if isPassive then
table.insert(resultPart, '\r\n<span style="color:green">Passive:</span>')
end
table.insert(resultPart, "\r\n"..Constants.getModifiersText(item.modifiers, true, false, 10))
end
end
return table.concat(resultPart)
return table.concat(resultPart)