Module:Abilities/card: Difference between revisionsGive feedback
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary Tag: Manual revert |
||
| Line 9: | Line 9: | ||
function get_hero_key(hero_name) | function get_hero_key(hero_name) | ||
if | if hero_name == nil then return nil end | ||
-- if name starts with "hero_", use it directly as the key | -- if name starts with "hero_", use it directly as the key | ||
if string.sub(hero_name, 1, 5) == "hero_" then return hero_name end | if string.sub(hero_name, 1, 5) == "hero_" then return hero_name end | ||
local resource_lookup = mw.loadJsonData("Data:ResourceLookup.json") | local resource_lookup = mw.loadJsonData("Data:ResourceLookup.json") | ||
return resource_lookup[hero_name:lower()].key | |||
end | end | ||