Module:Items/ComparisonTables: Difference between revisions

Remove separation of one-handed & two-handed weapons
m (Fix typo in Enhancement3)
(Remove separation of one-handed & two-handed weapons)
Line 23: Line 23:


local slotOverrides = {
local slotOverrides = {
['2hWeapons'] = 'melvorD:2hWeapons',
['Enhancement'] = 'melvorD:Enhancement'
['Enhancement'] = 'melvorD:Enhancement'
}
}
Line 95: Line 94:
for _, slotLocalID in ipairs(item.validSlots) do
for _, slotLocalID in ipairs(item.validSlots) do
local newSlotID = slotLocalID
local newSlotID = slotLocalID
-- Separate two-handed weapons from other weapons
if slotLocalID == 'Weapon' and Items._getItemStat(item, 'isTwoHanded') then
newSlotID = '2hWeapons'
-- Classify javelins and throwing knives as weapons
-- Classify javelins and throwing knives as weapons
elseif slotLocalID == 'Quiver' and Shared.contains({'Javelins', 'ThrowingKnives'}, item.ammoType) then
if slotLocalID == 'Quiver' and Shared.contains({'Javelins', 'ThrowingKnives'}, item.ammoType) then
newSlotID = 'Weapon'
newSlotID = 'Weapon'
-- Combine all enhancements
-- Combine all enhancements
Line 107: Line 103:
equipEntry.slots[newSlotID] = true
equipEntry.slots[newSlotID] = true
end
end
equipEntry.isWeapon = equipEntry.slots['Weapon'] or equipEntry.slots['2hWeapons'] or Shared.contains(occupiesSlots, 'Weapon')
equipEntry.isWeapon = equipEntry.slots['Weapon'] or Shared.contains(occupiesSlots, 'Weapon')


-- Determine the style of the item (Melee, Ranged, Magic, Other)
-- Determine the style of the item (Melee, Ranged, Magic, Other)
Line 327: Line 323:
:toTable()
:toTable()
 
 
local isWeapon = (slot == 'Weapon' or slot == '2hWeapons')
local isWeapon = (slot == 'Weapon')
local itemColspan = 3
local itemColspan = 3
if isWeapon == true then itemColspan = 4 end
if isWeapon == true then itemColspan = 4 end