Module:Sandbox/One Bar: Difference between revisions

One Bar (talk | contribs)
No edit summary
One Bar (talk | contribs)
No edit summary
Line 35: Line 35:
if (spirit_scaling ~= nil) then
if (spirit_scaling ~= nil) then
for k, v in pairs(spirit_scaling) do
for k, v in pairs(spirit_scaling) do
stats_text = stats_text .. k ..": ".. hero[k] .. "+" .. v .. "\n"
stats_text = stats_text .. (k or "nil") ..": ".. (hero[k] or "nil") .. "+" .. (v or "nil") .. "\n"
end
end
else
else
Line 51: Line 51:
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"] ..": "  
ability_text = ability_text .. (prop["Name"] or "nil") ..": "  
.. prop["Value"] .. " + " .. prop["Scale"]["Value"] .. "\n"
.. (prop["Value"] or "nil") .. " + " .. (prop["Scale"]["Value"] or "nil") .. "\n"
end
end
end
end