4,951
edits
m (Amend indentation) |
Falterfire (talk | contribs) (added code to show special attacks in the Modifiers table for equipment because it seemed like the thing to do) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
local Constants = require('Module:Constants') | local Constants = require('Module:Constants') | ||
Line 198: | Line 196: | ||
if includeModifiers then | if includeModifiers then | ||
table.insert(resultPart, '\r\n|style="text-align:left;padding:0 0.5em 0 0.5em;"|') | table.insert(resultPart, '\r\n|style="text-align:left;padding:0 0.5em 0 0.5em;"|') | ||
table.insert( | local txtLines = {} | ||
local modTxt = Constants.getModifiersText(item.modifiers, true) | |||
if modTxt ~= '' then | |||
table.insert(txtLines, modTxt) | |||
end | |||
--For items with a special attack, show the details | |||
if item.hasSpecialAttack then | |||
table.insert(txtLines, "'''Special Attack:'''") | |||
for i, spAtt in ipairs(item.specialAttacks) do | |||
table.insert(txtLines, spAtt.defaultChance .. '% chance for ' .. spAtt.name .. ':') | |||
table.insert(txtLines, spAtt.description) | |||
end | |||
end | |||
table.insert(resultPart, table.concat(txtLines, '<br/>')) | |||
end | end | ||
--If requested, add description | --If requested, add description | ||
Line 224: | Line 235: | ||
if includeModifiers then | if includeModifiers then | ||
table.insert(resultPart, '\r\n|style="text-align:left;padding:0 0.5em 0 0.5em;"|') | table.insert(resultPart, '\r\n|style="text-align:left;padding:0 0.5em 0 0.5em;"|') | ||
table.insert( | local txtLines = {} | ||
local modTxt = Constants.getModifiersText(item.modifiers, true) | |||
if modTxt ~= '' then | |||
table.insert(txtLines, modTxt) | |||
end | |||
--For items with a special attack, show the details | |||
if item.hasSpecialAttack then | |||
table.insert(txtLines, "'''Special Attack:'''") | |||
for i, spAtt in ipairs(item.specialAttacks) do | |||
table.insert(txtLines, spAtt.defaultChance .. '% chance for ' .. spAtt.name .. ':') | |||
table.insert(txtLines, spAtt.description) | |||
end | |||
end | |||
table.insert(resultPart, table.concat(txtLines, '<br/>')) | |||
end | end | ||
--If requested, add description | --If requested, add description | ||
Line 237: | Line 261: | ||
return table.concat(resultPart) | return table.concat(resultPart) | ||
end | end | ||
Line 302: | Line 269: | ||
local itemList = Items.getItems(function(item) | local itemList = Items.getItems(function(item) | ||
-- Exclude Golbin raid exclusives for now, such that they don't | |||
-- pollute various equipment tables | |||
if item.golbinRaidExclusive ~= nil and item.golbinRaidExclusive then | |||
return false | |||
end | |||
local isMatch = true | local isMatch = true | ||
if style == 'Melee' then | if style == 'Melee' then |