4,951
edits
(getEquipmentTable: Remove unused function (then following this, ItemData is also unused)) |
Falterfire (talk | contribs) (added code to show special attacks in the Modifiers table for equipment because it seemed like the thing to do) |
||
Line 196: | 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 222: | 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 |