Module:Sandbox/One Bar: Difference between revisions

Jump to navigation Jump to search
One Bar (talk | contribs)
m null check
One Bar (talk | contribs)
m Fix abilities
Line 47: Line 47:
hero_row:tag('td'):wikitext(stats_text):done()
hero_row:tag('td'):wikitext(stats_text):done()
for i=1,4 do
for i=1,4 do
local ability = ability_data[hero_key][tostring(i)]
local ability = ability_data[hero_key][i]
local ability_text = ""
if (ability ~= nil) then
if (ability ~= nil) then
hero_row:tag('td'):wikitext(ability["Name"]):done()
hero_row:tag('td'):wikitext(ability["Name"]):done()
local ability_text = ""
-- Nowhere close to all the instances of ability spirit scaling
-- Nowhere close to all the instances of ability spirit scaling
-- probably too much nil check but I want the table to print for now
-- probably too much nil check but I want the table to print for now
Line 56: Line 56:
and ability["Info1"]["Main"]["Props"] ~= nil) then
and 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) then
if (prop["Scale"] ~= nil and prop["Scale"]["Type"] == "spirit" and prop["Scale"]["Value"] ~= 0) then
ability_text = ability_text .. format_spirit_scale(frame, prop["Name"], prop["Value"], prop["Scale"]["Value"])
ability_text = ability_text .. format_spirit_scale(frame, prop["Name"], prop["Value"], prop["Scale"]["Value"])
end
end
end
end
else
end
ability_text = "-"
end
else
else
hero_row:tag('td'):wikitext(""):done()
hero_row:tag('td'):wikitext(""):done()