Anonymous

Module:Items/ComparisonTables: Difference between revisions

From Melvor Idle
_getEquipmentTable: Implement Strength level requirement column
m (I'm dumb. Properly fixed the DR table)
(_getEquipmentTable: Implement Strength level requirement column)
Line 25: Line 25:
--Getting some lists set up here that will be used later
--Getting some lists set up here that will be used later
--First, the list of columns used by both weapons & armour
--First, the list of columns used by both weapons & armour
local statColumns = {'stabAttackBonus', 'slashAttackBonus','blockAttackBonus','rangedAttackBonus', 'magicAttackBonus', 'meleeStrengthBonus', 'rangedStrengthBonus', 'magicDamageBonus', 'meleeDefenceBonus', 'rangedDefenceBonus', 'magicDefenceBonus', 'damageReduction', 'attackLevelRequired', 'defenceLevelRequired', 'rangedLevelRequired', 'magicLevelRequired'}
local statColumns = {
'stabAttackBonus', 'slashAttackBonus', 'blockAttackBonus',  
'rangedAttackBonus', 'magicAttackBonus', 'meleeStrengthBonus',
'rangedStrengthBonus', 'magicDamageBonus', 'meleeDefenceBonus',
'rangedDefenceBonus', 'magicDefenceBonus', 'damageReduction',
'attackLevelRequired', 'strengthLevelRequired', 'defenceLevelRequired',
'rangedLevelRequired', 'magicLevelRequired'
}


if Shared.tableIsEmpty(itemList) then
if Shared.tableIsEmpty(itemList) then
Line 51: Line 58:
local strBonusCols = 2
local strBonusCols = 2
local defBonusCols = 3
local defBonusCols = 3
local lvlReqCols = 4
local lvlReqCols = 5
local ndx = 1
local ndx = 1
while Shared.tableCount(statColumns) >= ndx do
while Shared.tableCount(statColumns) >= ndx do
Line 149: Line 156:
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', notext='true'}))
end
if Shared.contains(statColumns, 'strengthLevelRequired') then
table.insert(resultPart, '\r\n!'..Icons.Icon({'Strength', type='skill', notext='true'}))
end
end
if Shared.contains(statColumns, 'defenceLevelRequired') then
if Shared.contains(statColumns, 'defenceLevelRequired') then