Module:Sandbox/LVL: Difference between revisions

LVL (talk | contribs)
No edit summary
LVL (talk | contribs)
No edit summary
Line 196: Line 196:
                     local level_scale = compute_dps_scaling(hero_data, alt_stats, dps_type, "Level")
                     local level_scale = compute_dps_scaling(hero_data, alt_stats, dps_type, "Level")
                     local spirit_scale = compute_dps_scaling(hero_data, alt_stats, dps_type, "Spirit")
                     local spirit_scale = compute_dps_scaling(hero_data, alt_stats, dps_type, "Spirit")
                    -- round to 5 significant figures to match bot output
                    level_scale = util_module.round_to_sig_fig(level_scale, 5)
                    spirit_scale = util_module.round_to_sig_fig(spirit_scale, 5)
                     scaling_data = {}
                     scaling_data = {}
                     if level_scale ~= 0 then scaling_data[level_scale] = "Level" end
                     if level_scale ~= 0 then scaling_data[level_scale] = "Level" end
Line 350: Line 353:
                         if attr_key ~= "ClipSize" then
                         if attr_key ~= "ClipSize" then
                             local alt_scaling = hero_data_module.get_hero_scaling_data(hero_data, attr_key .. "AltFire")
                             local alt_scaling = hero_data_module.get_hero_scaling_data(hero_data, attr_key .. "AltFire")
                            -- Check if it's a non-empty table
                             if alt_scaling and next(alt_scaling) ~= nil then
                             if alt_scaling and next(alt_scaling) ~= nil then
                                 if not (hero_entry.key == "hero_shiv" and attr_key == "BulletDamage") then
                                 if not (hero_entry.key == "hero_shiv" and attr_key == "BulletDamage") then
Line 368: Line 370:
                                     local lv = compute_dps_scaling(hero_data, alt_stats, dps_type, "Level")
                                     local lv = compute_dps_scaling(hero_data, alt_stats, dps_type, "Level")
                                     local sp = compute_dps_scaling(hero_data, alt_stats, dps_type, "Spirit")
                                     local sp = compute_dps_scaling(hero_data, alt_stats, dps_type, "Spirit")
                                    lv = util_module.round_to_sig_fig(lv, 5)
                                    sp = util_module.round_to_sig_fig(sp, 5)
                                     if lv ~= 0 or sp ~= 0 then
                                     if lv ~= 0 or sp ~= 0 then
                                         stats_with_any_scaling[attr_key] = true
                                         stats_with_any_scaling[attr_key] = true