Module:LevelTables: Difference between revisions

LVL (talk | contribs)
Filter for name as well
m Use Icon module instead of template calls for hero icons
Line 1: Line 1:
local p = {};
local p = {};
local Icon = require('Module:Icon')


-- Loads the necessary data from the wiki's JSON pages.
-- Loads the necessary data from the wiki's JSON pages.
Line 65: Line 67:
end
end
end
end
local max_boons = #pi_souls_list
local max_boons = #pi_souls_list
 
-- Define the milestones to display in the summary table.
-- Define the milestones to display in the summary table.
local milestones = {10, 20, max_boons}
local milestones = {10, 20, max_boons}
Line 108: Line 111:
local function addHeroRows(hero_data, is_alt_fire)
local function addHeroRows(hero_data, is_alt_fire)
local base, level, suffix
local base, level, suffix
local hero_icon_wikitext = frame:expandTemplate{ title = "HeroIcon", args = {hero_data["Name"]}}
local hero_icon_wikitext = Icon._render(hero_data['Name'])
-- Determine if this is a main weapon or an alt-fire and set the correct data.
-- Determine if this is a main weapon or an alt-fire and set the correct data.
Line 307: Line 310:
local shots = get_stat_value(hero, "BulletsPerShot")
local shots = get_stat_value(hero, "BulletsPerShot")
local hit_once = get_stat_value(hero, "HitOnceAcrossAllBullets")
local hit_once = get_stat_value(hero, "HitOnceAcrossAllBullets")
local hero_icon = frame:expandTemplate{ title = "HeroIcon", args = {hero["Name"]}}
local hero_icon = Icon._render(hero["Name"])
-- Checks for the special property and changes the output text accordingly.
-- Checks for the special property and changes the output text accordingly.
Line 326: Line 329:
local level = math.floor(hero["LevelScaling"]["BulletDamage"] * 100) / 100
local level = math.floor(hero["LevelScaling"]["BulletDamage"] * 100) / 100
local shots = get_stat_value(hero, "BulletsPerBurst")
local shots = get_stat_value(hero, "BulletsPerBurst")
local hero_icon = frame:expandTemplate{ title = "HeroIcon", args = {hero["Name"]}}
local hero_icon = Icon._render(hero["Name"])
local stat_str = "* " .. hero_icon .. ": " .. shots .. " rounds, "  
local stat_str = "* " .. hero_icon .. ": " .. shots .. " rounds, "  
.. base .. "/bullet, +" .. level .. "/bullet\n"
.. base .. "/bullet, +" .. level .. "/bullet\n"