Module:HeroData: Difference between revisions

Vergir (talk | contribs)
m fix write_scalar_str returning several values (inserting weird zeroes in articles) by returning only the first value
Vergir (talk | contribs)
m replace Ls => PI in the comments to match code
 
Line 303: Line 303:
end
end


--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 {{PI|value}}, else blank string
--{{#invoke:HeroData|get_hero_scalar|HERO_NAME|SCALING_TYPE|STAT_NAME|sig_figs_or_localize}}--
--{{#invoke:HeroData|get_hero_scalar|HERO_NAME|SCALING_TYPE|STAT_NAME|sig_figs_or_localize}}--
p.get_hero_scalar = function(frame)
p.get_hero_scalar = function(frame)
Line 379: Line 379:


-- Retrieve scaling string of a hero's given stat, if it has scaling, else return blank
-- Retrieve scaling string of a hero's given stat, if it has scaling, else return blank
-- Scaling string meaning the expanded template {{Ss|scalar}} or {{Ls|scalar}}
-- Scaling string meaning the expanded template {{Ss|scalar}} or {{PI|scalar}}
function p.write_scalar_str(scaling_value, scaling_type, compact)
function p.write_scalar_str(scaling_value, scaling_type, compact)
local scaling_abbrevs = {Spirit = "Ss", Level = "PI"}
local scaling_abbrevs = {Spirit = "Ss", Level = "PI"}