Anonymous

Module:Items/UseTables: Difference between revisions

From Melvor Idle
_getItemUses: Classify items with special attacks as used in combat
(updated hitpoints skillcape -> HP skillcape)
(_getItemUses: Classify items with special attacks as used in combat)
(One intermediate revision by one other user not shown)
Line 91: Line 91:


   --If the item has any modifiers that affect a given skill, add it to those lists
   --If the item has any modifiers that affect a given skill, add it to those lists
   if item.modifiers ~= nil then
  --Added an exception for Mastery Tokens since they were being incorrectly flagged as usable for all skills
   if item.modifiers ~= nil and (item.isToken == nil or not item.isToken) then
     local skillArray = Constants.getModifierSkills(item.modifiers)
     local skillArray = Constants.getModifierSkills(item.modifiers)
     for i, skillName in Shared.skpairs(skillArray) do
     for i, skillName in Shared.skpairs(skillArray) do
Line 99: Line 100:


   --First things added to the list are non-skill things that are easy to check
   --First things added to the list are non-skill things that are easy to check
   if Items.hasCombatStats(item) or Shared.contains(itemUseArray.Combat, item.name) then
   if Items.hasCombatStats(item) or item.specialAttacks ~= nil or Shared.contains(itemUseArray.Combat, item.name) then
     table.insert(useArray, chr..Icons.Icon({'Combat'}))
     table.insert(useArray, chr..Icons.Icon({'Combat'}))
   end
   end