Anonymous

Module:Items: Difference between revisions

From Melvor Idle
Fixed DamageType image linking to resistances
(Change sellsForCurrency check to namespace check)
(Fixed DamageType image linking to resistances)
Line 716: Line 716:


local resistance, resistanceText = p._getItemResistance(item)
local resistance, resistanceText = p._getItemResistance(item)
local damageType = p._getItemStat(item, 'damageType') == 'melvorItA:Abyssal' and 'Abyssal' or 'Normal'


local ico = {
local ico = {
Line 725: Line 726:
["Strength"] = Icons.Icon({'Strength', type='skill', notext=true}),
["Strength"] = Icons.Icon({'Strength', type='skill', notext=true}),
["Slayer"] = Icons.Icon({'Slayer', type='skill', notext=true}),
["Slayer"] = Icons.Icon({'Slayer', type='skill', notext=true}),
["Resistance"] = Icons.Icon({resistanceText, notext=true})
["Resistance"] = Icons.Icon({resistanceText, notext=true}),
["DamageType"] = Icons.Icon({(damageType .. ' Damage'), type="damage", notext=true})
}
}
local reqCount = item.equipRequirements ~= nil and Shared.tableCount(item.equipRequirements) or 0
local reqCount = item.equipRequirements ~= nil and Shared.tableCount(item.equipRequirements) or 0
local emptyRow = '\r\n!colspan="2"|'
local emptyRow = '\r\n!colspan="2"|'
local damageType = p._getItemStat(item, 'damageType') == 'melvorItA:Abyssal' and 'Abyssal' or 'Normal'
local resultPart = {}
local resultPart = {}
Line 743: Line 744:


table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| Damage Type')
table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| Damage Type')
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. ico['Resistance'] .. damageType)
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. ico['DamageType'] .. damageType)
table.insert(resultPart, '\r\n!style="text-align:right;"| ' .. ico['Resistance'] .. resistanceText)
table.insert(resultPart, '\r\n!style="text-align:right;"| ' .. ico['DamageType'] .. resistanceText)
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. resistance .. '%')
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. resistance .. '%')