Module:HeroData: Difference between revisions

Jump to navigation Jump to search
Sur (talk | contribs)
m calling lang module
Sur (talk | contribs)
m bugfixes
Line 88: Line 88:
     local infobox_attributes = {
     local infobox_attributes = {
     Weapon = {"DPS", "ClipSize", "RoundsPerSecond", "ReloadTime"},
     Weapon = {"DPS", "ClipSize", "RoundsPerSecond", "ReloadTime"},
     Vitality = {"MaxHealth", "BulletResist", "SpiritResist", "MaxMoveSpeed"}
     Vitality = {"MaxHealth", "BulletArmorDamageReduction", "TechArmorDamageReduction", "MaxMoveSpeed"}
     }
     }
      
      
Line 107: Line 107:
-- Iterate stats
-- Iterate stats
for _, stat_name in ipairs(stats) do
for _, stat_name in ipairs(stats) do
stat_data = attributes_data[category][stat_name]
attribute_data = attributes_data[category]
if (stat_data == nil) then return "Attribute in infobox_attributes is not in Data:AttributeData" end
if (attribute_data == nil) then return "Category " .. category .. " in infobox_attributes is not in Data:AttributeData" end
stat_data = attribute_data[stat_name]
if (stat_data == nil) then return "Attribute " .. stat_name .. " in infobox_attributes is not in Data:AttributeData" end
-- gets the stat's value
-- gets the stat's value