More actions
m _get_string > get_string |
m made ability_card_data accept hero_key |
||
Line 5: | Line 5: | ||
local data = mw.loadJsonData("Data:AbilityCards.json") | local data = mw.loadJsonData("Data:AbilityCards.json") | ||
-- returns the table of a specific item | -- returns the table of a specific item' | ||
function p.get_ability_card_data( | function p.get_ability_card_data(hero_key, ability_num) | ||
if(hero_key == nil) then return nil end | if(hero_key == nil) then return nil end | ||
return data[hero_key][tonumber(ability_num)] | return data[hero_key][tonumber(ability_num)] | ||
end | end | ||
function get_hero_key(hero_name) | function p.get_hero_key(hero_name) | ||
for i, hero in pairs(data) do | for i, hero in pairs(data) do | ||
if hero["Name"] == hero_name then | if hero["Name"] == hero_name then |