Module:Sandbox/One Bar: Difference between revisionsGive feedback
m null check |
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][ | 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() | ||
-- 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 | ||
end | |||
else | else | ||
hero_row:tag('td'):wikitext(""):done() | hero_row:tag('td'):wikitext(""):done() | ||