Module:HeroData: Difference between revisions

Jump to navigation Jump to search
Sur (talk | contribs)
m testing
Sur (talk | contribs)
m get_hero_var now actually requires stat_name param
Line 12: Line 12:
end
end


--{{#invoke:HeroData|get_hero_var|HERO_NAME}}--
--{{#invoke:HeroData|get_hero_var|HERO_NAME|STAT_NAME}}--
p.get_hero_var = function(frame)
p.get_hero_var = function(frame)
local hero_name = frame.args[1]
local hero_name = frame.args[1]
local hero_stat_key = frame.args[2]
local hero = get_json_item(hero_name)
local hero = get_json_item(hero_name)
if(hero == nil) then return "Hero Not Found" end
if(hero == nil) then return "Hero Not Found" end
local var_value = hero["BulletDamage"]
local var_value = hero[hero_stat_key]


return var_value
return var_value