Module:Sandbox/One Bar: Difference between revisions

Jump to navigation Jump to search
One Bar (talk | contribs)
No edit summary
One Bar (talk | contribs)
No edit summary
Line 5: Line 5:


p.write_multishot_stats = function(frame)
p.write_multishot_stats = function(frame)
local function hero_sort(h1, h2)
return h1["Name"] < h2["Name"]
end
local spreadshot_heroes = {}
local burst_heroes = {}
local burst_heroes = {}
local spreadshot_heroes = {}
for _, hero in pairs(heroes_data) do
for _, hero in pairs(heroes_data) do
if (hero["BulletsPerShot"] > 1 and not hero["IsDisabled"]) then
if (hero["BulletsPerShot"] > 1 and not hero["IsDisabled"]) then
Line 14: Line 17:
end
end
end
end
table.sort(spreadshot_heroes, hero_sort)
table.sort(burst_heroes, hero_sort)
local multishot_str = "Weapons with multiple projectiles (Spreadshot):\n"
local multishot_str = "Weapons with multiple projectiles (Spreadshot):\n"
Line 76: Line 82:
local ability_text = ""
local ability_text = ""
-- Nowhere close to all the instances of ability spirit scaling
-- Nowhere close to all the instances of ability spirit scaling
if (ability["Info1"]["Main"]["Props"] ~= nil and next(ability["Info1"]["Main"]["Props"]) ~= nil) then
-- probably too much nil check but I want the table to print for now
if (ability["Info1"] ~= nil and ability["Info1"]["Main"] ~= nil
and ability["Info1"]["Main"]["Props"] ~= nil  
and next(ability["Info1"]["Main"]["Props"]) ~= nil) then
for _, prop in ipairs(ability["Info1"]["Main"]["Props"]) do
for _, prop in ipairs(ability["Info1"]["Main"]["Props"]) do
if (prop["Scale"] ~= nil and next(prop["Scale"]) ~= nil) then
if (prop["Scale"] ~= nil and next(prop["Scale"]) ~= nil) then
ability_text = ability_text .. prop["Name"] ..": " .. prop["Value"] .. " + " .. prop["Scale"]["Value"] .. "\n"
ability_text = ability_text .. prop["Name"] ..": "  
.. prop["Value"] .. " + " .. prop["Scale"]["Value"] .. "\n"
end
end
end
end