Module:HeroData: Difference between revisions

Jump to navigation Jump to search
Sur (talk | contribs)
m get_hero_scalar_str slightly reworked
Sur (talk | contribs)
m arg1 for ss/ls call renamed to 1
Line 39: Line 39:


--If the hero scales with the stat, it returns {{Ss|value}} or {{Ls|value}}, else blank string
--If the hero scales with the stat, it returns {{Ss|value}} or {{Ls|value}}, else blank string
--{{#invoke:HeroData|get_hero_scalar|HERO_NAME|SPIRIT_OR_LEVEL|STAT_NAME}}--
--{{#invoke:HeroData|get_hero_scalar_str_invoke|HERO_NAME|SPIRIT_OR_LEVEL|STAT_NAME}}--
p.get_hero_scalar_str_invoke = function(frame)
p.get_hero_scalar_str_invoke = function(frame)
local hero_name = frame.args[1]
local hero_name = frame.args[1]
Line 74: Line 74:
local template_args = {}
local template_args = {}
template_args["arg1"] = hero_scalar
template_args["1"] = hero_scalar
local template_call = mw.getCurrentFrame():expandTemplate{ title = template_title, args = template_args }
local template_call = mw.getCurrentFrame():expandTemplate{ title = template_title, args = template_args }