Anonymous

Module:Sandbox/AuronTest/ComparisonTables: Difference between revisions

From Melvor Idle
m
no edit summary
mNo edit summary
mNo edit summary
Line 322: Line 322:


   local itemList = Items.getItems(function(item)
   local itemList = Items.getItems(function(item)
       local isMatch = true
       local isMatch = item.isEquipment
       local levelReqs = Items._processEquipmentLevelReqs(item.equipRequirements)
       if isMatch then
      if style == 'Melee' then
        local levelReqs = Items._processEquipmentLevelReqs(item.equipRequirements)
        if (levelReqs['Defence'] == nil and levelReqs['Attack'] == nil) and not Shared.contains(styleOverrides.Melee, item.name) then isMatch = false end
        if style == 'Melee' then
      elseif style == 'Ranged' then
          if (levelReqs['Defence'] == nil and levelReqs['Attack'] == nil) and not Shared.contains(styleOverrides.Melee, item.name) then isMatch = false end
        if levelReqs['Ranged'] == nil and not Shared.contains(styleOverrides.Ranged, item.name) then isMatch = false end
        elseif style == 'Ranged' then
      elseif style == 'Magic' then
          if levelReqs['Ranged'] == nil and not Shared.contains(styleOverrides.Ranged, item.name) then isMatch = false end
        if levelReqs['Magic'] == nil and not Shared.contains(styleOverrides.Magic, item.name) then isMatch = false end
        elseif style == 'Magic' then
      elseif style == 'None' then
          if levelReqs['Magic'] == nil and not Shared.contains(styleOverrides.Magic, item.name) then isMatch = false end
        if (levelReqs['Defence'] ~= nil or levelReqs['Ranged'] ~= nil or levelReqs['Magic'] ~= nil or
        elseif style == 'None' then
          Shared.contains(styleOverrides.Melee, item.name) or Shared.contains(styleOverrides.Ranged, item.name) or Shared.contains(styleOverrides.Magic, item.name)) and
          if (levelReqs['Defence'] ~= nil or levelReqs['Ranged'] ~= nil or levelReqs['Magic'] ~= nil or
          not Shared.contains(styleOverrides.None, item.name) then
            Shared.contains(styleOverrides.Melee, item.name) or Shared.contains(styleOverrides.Ranged, item.name) or Shared.contains(styleOverrides.Magic, item.name)) and
          isMatch = false
            not Shared.contains(styleOverrides.None, item.name) then
            isMatch = false
          end
         end
         end
      end
        if slot == nil or not Shared.contains(item.validSlots, slot) then isMatch = false end
      if slot == nil or not Shared.contains(item.validSlots, slot) then isMatch = false end


      if isMatch and other ~= nil then
        if isMatch and other ~= nil then
        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
            if other == 'Arrows' then
            if item.ammoTypeRequired ~= 0 then isMatch = false end
              if item.ammoTypeRequired ~= 0 then isMatch = false end
          elseif other == 'Bolts' then
            elseif other == 'Bolts' then
            if item.ammoTypeRequired ~= 1 then isMatch = false end
              if item.ammoTypeRequired ~= 1 then isMatch = false end
          end
            end
        elseif slot == 'Quiver' then
          elseif slot == 'Quiver' then
          if other == 'Arrows' then
            if other == 'Arrows' then
            if item.ammoType ~= 0 then isMatch = false end
              if item.ammoType ~= 0 then isMatch = false end
          elseif other == 'Bolts' then
            elseif other == 'Bolts' then
            if item.ammoType ~= 1 then isMatch = false end
              if item.ammoType ~= 1 then isMatch = false end
          elseif other == 'Javelins' then
            elseif other == 'Javelins' then
            if item.ammoType ~= 2 then isMatch = false end
              if item.ammoType ~= 2 then isMatch = false end
          elseif other == 'Throwing Knives' then
            elseif other == 'Throwing Knives' then
            if item.ammoType ~= 3 then isMatch = false end
              if item.ammoType ~= 3 then isMatch = false end
          elseif other == 'Thrown' then
            elseif other == 'Thrown' then
            if item.ammoType ~= 2 and item.ammoType ~= 3 then isMatch = false end
              if item.ammoType ~= 2 and item.ammoType ~= 3 then isMatch = false end
            end
           end
           end
         end
         end