Module:LevelTables: Difference between revisionsGive feedback
Null check missing hero properties |
Corrected bullet damage calculation for multi-shot weapons that only hit once (e.g., Drifter) by checking the HitOnceAcrossAllBullets flag. Also improved module robustness by adding a nil-check for LevelScaling data to prevent script errors. |
||
| Line 67: | Line 67: | ||
for _, hero in ipairs(filtered_heroes) do | for _, hero in ipairs(filtered_heroes) do | ||
local base = math.floor((hero[property] or 0) * 100) / 100 | local base = math.floor((hero[property] or 0) * 100) / 100 | ||
local | local level_scaling = hero["LevelScaling"] and hero["LevelScaling"][property] or 0 | ||
local level = math.floor(level_scaling * 100) / 100 | |||
local shots = (hero["BulletsPerShot"] or 1) | local shots = (hero["BulletsPerShot"] or 1) | ||
local burst = (hero["BulletsPerBurst"] or 1) | local burst = (hero["BulletsPerBurst"] or 1) | ||
| Line 74: | Line 75: | ||
local hero_suffix = "" | local hero_suffix = "" | ||
if (property == "BulletDamage" and bullet_mult > 1) then | if (property == "BulletDamage" and bullet_mult > 1) then | ||
base = base * bullet_mult | local hit_once = hero["HitOnceAcrossAllBullets"] or false | ||
if (not hit_once) then | |||
base = base * bullet_mult | |||
level = level * bullet_mult | |||
end | |||
if (shots > 1) then hero_suffix = hero_suffix .. " (" .. shots .. " pellets)" end | if (shots > 1) then hero_suffix = hero_suffix .. " (" .. shots .. " pellets)" end | ||
if (burst > 1) then hero_suffix = hero_suffix .. " (" .. burst .. " bullets)" end | if (burst > 1) then hero_suffix = hero_suffix .. " (" .. burst .. " bullets)" end | ||