Module:Items/ComparisonTables: Difference between revisions

Shrink equipment table header icons; Fixed resistance stats
(Add abyssal level and AR support to _getEquipmentTable; Shrunk Icons to 32px; Add DLC column)
(Shrink equipment table header icons; Fixed resistance stats)
Line 58: Line 58:
'rangedStrengthBonus', 'magicDamageBonus', 'meleeDefenceBonus',
'rangedStrengthBonus', 'magicDamageBonus', 'meleeDefenceBonus',
'rangedDefenceBonus', 'magicDefenceBonus', 'damageReduction',
'rangedDefenceBonus', 'magicDefenceBonus', 'damageReduction',
'resistance', 'attackLevelRequired', 'strengthLevelRequired',  
'resistanceAbyssal', 'resistanceEternal', 'attackLevelRequired',
'defenceLevelRequired', 'rangedLevelRequired', 'magicLevelRequired',
'strengthLevelRequired', 'defenceLevelRequired', 'rangedLevelRequired',
'attackAbyssalLevel', 'strengthAbyssalLevel','defenceAbyssalLevel',
'magicLevelRequired', 'attackAbyssalLevel', 'strengthAbyssalLevel',
'rangedAbyssalLevel', 'magicAbyssalLevel'
'defenceAbyssalLevel', 'rangedAbyssalLevel', 'magicAbyssalLevel'
}
}


Line 129: Line 129:
table.insert(resultPart, '\r\n!colspan="1"|DR')
table.insert(resultPart, '\r\n!colspan="1"|DR')
end
end
if Shared.contains(statColumns, 'resistance') then
if Shared.contains(statColumns, 'resistanceAbyssal') then
table.insert(resultPart, '\r\n!colspan="1"|AR')
table.insert(resultPart, '\r\n!colspan="1"|AR')
end
if Shared.contains(statColumns, 'resistanceEternal') then
table.insert(resultPart, '\r\n!colspan="1"|ER')
end
end
if lvlReqCols > 0 then
if lvlReqCols > 0 then
Line 155: Line 158:
--Attack bonuses
--Attack bonuses
if Shared.contains(statColumns, 'slashAttackBonus') then
if Shared.contains(statColumns, 'slashAttackBonus') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Attack', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Attack', type='skill', size=20, notext='true'}))
end
end
if Shared.contains(statColumns, 'stabAttackBonus') then
if Shared.contains(statColumns, 'stabAttackBonus') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Strength', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Strength', type='skill', size=20, notext='true'}))
end
end
if Shared.contains(statColumns, 'blockAttackBonus') then
if Shared.contains(statColumns, 'blockAttackBonus') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Defence', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Defence', type='skill', size=20, notext='true'}))
end
end
if Shared.contains(statColumns, 'rangedAttackBonus') then
if Shared.contains(statColumns, 'rangedAttackBonus') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Ranged', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Ranged', type='skill', size=20, notext='true'}))
end
end
if Shared.contains(statColumns, 'magicAttackBonus') then
if Shared.contains(statColumns, 'magicAttackBonus') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Magic', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Magic', type='skill', size=20, notext='true'}))
end
end
--Strength bonuses
--Strength bonuses
if Shared.contains(statColumns, 'meleeStrengthBonus') then
if Shared.contains(statColumns, 'meleeStrengthBonus') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Strength', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Strength', type='skill', size=20, notext='true'}))
end
end
if Shared.contains(statColumns, 'rangedStrengthBonus') then
if Shared.contains(statColumns, 'rangedStrengthBonus') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Ranged', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Ranged', type='skill', size=20, notext='true'}))
end
end
if Shared.contains(statColumns, 'magicDamageBonus') then
if Shared.contains(statColumns, 'magicDamageBonus') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Magic', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Magic', type='skill', size=20, notext='true'}))
end
end
--Defence bonuses
--Defence bonuses
if Shared.contains(statColumns, 'meleeDefenceBonus') then
if Shared.contains(statColumns, 'meleeDefenceBonus') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Defence', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Defence', type='skill', size=20, notext='true'}))
end
end
if Shared.contains(statColumns, 'rangedDefenceBonus') then
if Shared.contains(statColumns, 'rangedDefenceBonus') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Ranged', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Ranged', type='skill', size=20, notext='true'}))
end
end
if Shared.contains(statColumns, 'magicDefenceBonus') then
if Shared.contains(statColumns, 'magicDefenceBonus') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Magic', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Magic', type='skill', size=20, notext='true'}))
end
end
if Shared.contains(statColumns, 'damageReduction') then
if Shared.contains(statColumns, 'damageReduction') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Damage Reduction', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Damage Reduction', size=20, notext='true'}))
end
if Shared.contains(statColumns, 'resistanceAbyssal') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Abyssal Resistance', size=20, notext='true'}))
end
end
if Shared.contains(statColumns, 'resistance') then
if Shared.contains(statColumns, 'resistanceEternal') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Abyssal Resistance', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Eternal Resistance', size=20, notext='true'}))
end
end
--Level requirements
--Level requirements
if Shared.contains(statColumns, 'attackLevelRequired') then
if Shared.contains(statColumns, 'attackLevelRequired') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Attack', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Attack', type='skill', size=20, notext='true'}))
end
end
if Shared.contains(statColumns, 'strengthLevelRequired') then
if Shared.contains(statColumns, 'strengthLevelRequired') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Strength', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Strength', type='skill', size=20, notext='true'}))
end
end
if Shared.contains(statColumns, 'defenceLevelRequired') then
if Shared.contains(statColumns, 'defenceLevelRequired') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Defence', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Defence', type='skill', size=20, notext='true'}))
end
end
if Shared.contains(statColumns, 'rangedLevelRequired') then
if Shared.contains(statColumns, 'rangedLevelRequired') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Ranged', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Ranged', type='skill', size=20, notext='true'}))
end
end
if Shared.contains(statColumns, 'magicLevelRequired') then
if Shared.contains(statColumns, 'magicLevelRequired') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Magic', type='skill', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Magic', type='skill', size=20, notext='true'}))
end
end
if Shared.contains(statColumns, 'attackAbyssalLevel') then
if Shared.contains(statColumns, 'attackAbyssalLevel') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Attack', type='skill', class='abyss-icon', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Attack', type='skill', size=20, class='abyss-icon', notext='true'}))
end
end
if Shared.contains(statColumns, 'strengthAbyssalLevel') then
if Shared.contains(statColumns, 'strengthAbyssalLevel') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Strength', type='skill', class='abyss-icon', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Strength', type='skill', size=20, class='abyss-icon', notext='true'}))
end
end
if Shared.contains(statColumns, 'defenceAbyssalLevel') then
if Shared.contains(statColumns, 'defenceAbyssalLevel') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Defence', type='skill', class='abyss-icon', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Defence', type='skill', size=20, class='abyss-icon', notext='true'}))
end
end
if Shared.contains(statColumns, 'rangedAbyssalLevel') then
if Shared.contains(statColumns, 'rangedAbyssalLevel') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Ranged', type='skill', class='abyss-icon', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Ranged', type='skill', size=20, class='abyss-icon', notext='true'}))
end
end
if Shared.contains(statColumns, 'magicAbyssalLevel') then
if Shared.contains(statColumns, 'magicAbyssalLevel') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Magic', type='skill', class='abyss-icon', notext='true'}))
table.insert(resultPart, '\r\n!'..Icons.Icon({'Magic', type='skill', size=20, class='abyss-icon', notext='true'}))
end
end
--If includeModifiers is set to 'true', add the Modifiers column
--If includeModifiers is set to 'true', add the Modifiers column
Line 261: Line 267:
end
end
table.insert(resultPart, '"|'..Num.formatnum(statValue))
table.insert(resultPart, '"|'..Num.formatnum(statValue))
if statName == 'magicDamageBonus' or statName == 'damageReduction' or statName == 'resistance' then table.insert(resultPart, '%') end
if statName == 'magicDamageBonus' or statName == 'damageReduction' or Shared.contains(statName, 'resistance') then table.insert(resultPart, '%') end
end
end
--If requested, add the item Modifiers
--If requested, add the item Modifiers
Line 292: Line 298:
--Building rows for armour
--Building rows for armour
table.insert(resultPart, '\r\n|-')
table.insert(resultPart, '\r\n|-')
table.insert(resultPart, '\r\n|'..Icons.Icon({(item.name or 'Unknown'), type='item', size=32, notext=true}))
table.insert(resultPart, '\r\n|'..Icons.Icon({(item.name or 'Unknown'), type='item', notext=true}))
table.insert(resultPart, '\r\n|'..Icons.Icon({item.name, type='item', noicon=true}))
table.insert(resultPart, '\r\n|'..Icons.Icon({item.name, type='item', noicon=true}))
table.insert(resultPart, '\r\n|'..Icons.getDLCColumnIcon(item.id))
table.insert(resultPart, '\r\n|'..Icons.getDLCColumnIcon(item.id))
Line 304: Line 310:
end
end
table.insert(resultPart, '"|'..Num.formatnum(statValue))
table.insert(resultPart, '"|'..Num.formatnum(statValue))
if statName == 'magicDamageBonus' or statName == 'damageReduction' or statName == 'resistance' then table.insert(resultPart, '%') end
if statName == 'magicDamageBonus' or statName == 'damageReduction' or Shared.contains(statName, 'resistance') then table.insert(resultPart, '%') end
end
end
--If requested, add the item Modifiers
--If requested, add the item Modifiers