Module:Abilities/details table: Difference between revisions

m fixed "other" prop key
No edit summary
Line 53: Line 53:
local scale_value = prop.Scale and prop.Scale.Value or nil
local scale_value = prop.Scale and prop.Scale.Value or nil
rows = rows .. create_row(attr, prop.Value, scale_type, scale_value)
rows = rows .. create_row(attr, prop.Value, scale_type, scale_value)
end
end
return rows
end
p.get_upgrades_table = function(frame)
local hero_name = frame.args[1]
local ability_num = frame.args[2]
local ability = utils.get_ability_card_data(hero_name, ability_num)
if(ability == nil) then error(string.format('Ability %s#%s not found', hero_name, ability_num)) end
local rows = ''
local upgrades = ability.Upgrades
for i, upgrade in pairs(upgrades) do
rows = rows .. ''
for key, value in pairs(upgrade) do
if key ~= 'DescKey' then
local scale_type = upgrade.Scale and upgrade.Scale.Type or nil
local scale_value = upgrade.Scale and upgrade.Scale.Value or nil
rows = rows .. create_row(key, value, scale_type, scale_value)
end
end
end
end
end
Line 71: Line 95:
return '\n|-\n'..row
return '\n|-\n'..row
end
function create_upgrade_row(key, upgrades)
local row = ''
for i, upgrade in paris(upgrades) do
local scale_type = prop.Scale and prop.Scale.Type or nil
local scale_value = prop.Scale and prop.Scale.Value or nil
row = row .. upgrade[key]
end
return row
end
end


return p
return p