Anonymous

Module:Items/ComparisonTables: Difference between revisions

From Melvor Idle
_getCategoryTable: Correct weapon & quiver item selection rules
(Amend descriptions)
(_getCategoryTable: Correct weapon & quiver item selection rules)
Line 301: Line 301:
end
end
if slot == 'Weapon' then --For quiver slot or weapon slot, 'other' is the ammo type
if slot == 'Weapon' then --For quiver slot or weapon slot, 'other' is the ammo type
if other == 'Arrows' then
isMatch = other == item.ammoTypeRequired
if item.ammoTypeRequired ~= 0 then isMatch = false end
elseif other == 'Bolts' then
if item.ammoTypeRequired ~= 1 then isMatch = false end
end
elseif slot == 'Quiver' then
elseif slot == 'Quiver' then
if other == 'Arrows' then
if other == 'Thrown' and Shared.contains({'Javelins', 'ThrowingKnives'}, item.ammoType) then
if item.ammoType ~= 0 then isMatch = false end
isMatch = true
elseif other == 'Bolts' then
else
if item.ammoType ~= 1 then isMatch = false end
isMatch = other == item.ammoType
elseif other == 'Javelins' then
if item.ammoType ~= 2 then isMatch = false end
elseif other == 'Throwing Knives' then
if item.ammoType ~= 3 then isMatch = false end
elseif other == 'Thrown' then
if item.ammoType ~= 2 and item.ammoType ~= 3 then isMatch = false end
end
end
end
end