Module:HeroData: Difference between revisionsGive feedback
Jump to navigation
Jump to search
m get_hero_var now supports passing hero key |
m write_stat_infoboxes now uses hero key instead of hero name |
||
| Line 279: | Line 279: | ||
--{{#invoke:HeroData|write_stat_infoboxes| | --{{#invoke:HeroData|write_stat_infoboxes|HERO_KEY}} | ||
--Creates {{Infobox_stat}}'s' for the 3 categories Weapon, Vitality, Spirit | --Creates {{Infobox_stat}}'s' for the 3 categories Weapon, Vitality, Spirit | ||
p.write_stat_infoboxes = function(frame) | p.write_stat_infoboxes = function(frame) | ||
local | local hero_key = frame.args[1] | ||
if( | if(hero_key == nil) then return "Hero parameter missing" end | ||
-- Use expandTemplate to evaluate the Infobox_hero template | -- Use expandTemplate to evaluate the Infobox_hero template | ||
| Line 295: | Line 295: | ||
local postfix --current stat's postfix | local postfix --current stat's postfix | ||
local stat_value --current stat's numerical value in the hero data | local stat_value --current stat's numerical value in the hero data | ||
local hero_data = | local hero_data = heroes_data[hero_key] | ||
local stats --stats of the current category | local stats --stats of the current category | ||
local image_file_name --name of the image_file to check | local image_file_name --name of the image_file to check | ||
| Line 301: | Line 301: | ||
local extra_blank_cell --add a blank cell after certain stats | local extra_blank_cell --add a blank cell after certain stats | ||
local stats_to_add_blank_after = {BulletLifesteal = true, CritDamageReceivedScale = true} | local stats_to_add_blank_after = {BulletLifesteal = true, CritDamageReceivedScale = true} | ||
if (hero_data == nil) then return "Hero Not Found | if (hero_data == nil) then return "Hero Not Found" end | ||
local category_data = attribute_module.get_category_data() | local category_data = attribute_module.get_category_data() | ||
local should_display | local should_display | ||