Module:HeroDataArrays: Difference between revisions

Jump to navigation Jump to search
m better (?) comments
m starting dps table
Line 42: Line 42:


p.heroHealthTable = function(frame)
p.heroHealthTable = function(frame)
-- Pull data
heroHealthData = heroDataArray({"Name", "MaxHealth", "LevelScaling>Health"})
heroHealthData = heroDataArray({"Name", "MaxHealth", "LevelScaling>Health"})


-- Input table will be called a, output wikitable will be called z
-- From a to z, haha get it
z = "{| class=\"wikitable sortable mw-collapsible\" style=\"text-align:center\" \n"..
z = "{| class=\"wikitable sortable mw-collapsible\" style=\"text-align:center\" \n"..
"|+ Hero Base Health Stats \n"..
"|+ Hero Base Health Stats \n"..
"! Hero !! Starting !! Added per PI !! At Max PI \n"
"! Hero !! Starting !! Added per PI !! At Max PI \n"
 
-- Iterate over heroes adding a new row to the wikitable for each
for i,a in pairs(heroHealthData) do
for i,a in pairs(heroHealthData) do
z = z..
z = z..
"|- \n"..
"|- \n"..
"| style=\"text-align:left;\" | "..frame:expandTemplate{title="PageRef", args={a["Name"], ['type']="Hero"}}..
"| style=\"text-align:left;\" | "..
frame:expandTemplate{title="PageRef", args={a["Name"], ["type"]="Hero"}}..
" || "..a["MaxHealth"].." || +"..a["LevelScaling>Health"].." || "..
" || "..a["MaxHealth"].." || +"..a["LevelScaling>Health"].." || "..
tostring(tonumber(a["MaxHealth"])+tonumber(a["LevelScaling>Health"])*14).." \n"
tostring(tonumber(a["MaxHealth"])+tonumber(a["LevelScaling>Health"])*14).." \n"
end
end
-- Cap it off
z = z.."|}"
z = z.."|}"
Line 61: Line 67:
end
end


p.heroDpsTable = function(frame)
heroDpsData = heroDataArray({"Name","ReloadSingle","ReloadDelay","ReloadTime",
"ClipSize","RoundsPerSecond","BulletDamage","BulletsPerShot"})
 
    mw.logObject(heroDpsData)
end
return p
return p