Module:Param Parse: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
No edit summary
(parse.name_export_rarity_class)
Line 117: Line 117:
smw_property = 'Name',
smw_property = 'Name',
category_incomplete = 'Needs name',
category_incomplete = 'Needs name',
}
local rarities = {"Common", "Uncommon", "Rare", "Epic"}
function parse.get_rarity_func(name)
for _, rarity in ipairs(rarities) do
if name:sub(1, #rarity) == rarity then
return rarity
end
end
return nil
end
parse.name_export_rarity_class = {
name = 'name_rarity',
func = {name = parse.get_rarity_func, params = {Infobox.raw_param('name')}}
}
}
-- Standardized examine function
-- Standardized examine function