Module:HeroDataArrays: Difference between revisionsGive feedback
Jump to navigation
Jump to search
Gammaton32 (talk | contribs) No edit summary |
Gammaton32 (talk | contribs) finished refactoring, added spirit scaling table |
||
| Line 124: | Line 124: | ||
name = name, | name = name, | ||
maxHealth = tonumber(data["MaxHealth"]) or 0, | maxHealth = tonumber(data["MaxHealth"]) or 0, | ||
scalingHealth = tonumber(data["LevelScaling>MaxHealth"]) or 0 | scalingHealth = "+" .. tonumber(data["LevelScaling>MaxHealth"]) or 0, | ||
maxScalingHealth = tonumber(roundValue(data["MaxHealth"] + data["LevelScaling>MaxHealth"] * soul_unlock.get_max("PowerIncrease"))) or 0 | |||
}) | }) | ||
end | end | ||
table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | ||
local tableDefs = { | |||
local | { | ||
" | title = "Hero Base Health Stats", | ||
columns = { | |||
{ label = "Starting", field = "maxHealth" }, | |||
{ label = "Added per Boon", field = "scalingHealth" }, | |||
{ label = "At Max Boon", field = "maxScalingHealth" }, | |||
} | |||
} | |||
} | |||
local output = {} | |||
for _, def in ipairs(tableDefs) do | |||
local t = buildTable(frame, rows, def, def.options) | |||
if t ~= "" then | |||
table.insert(output, t) | |||
end | |||
end | |||
return table.concat(output, "\n\n") | |||
end | end | ||
| Line 298: | Line 302: | ||
}) | }) | ||
end | end | ||
table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | ||
local tableDefs = { | local tableDefs = { | ||
{ | |||
title = "Base Ammo Count", | |||
columns = { | |||
{ label = "Ammo", field = "clipSize" }, | |||
} | |||
}, | |||
{ | { | ||
title = "Alt-Fire Ammo Cost", | title = "Alt-Fire Ammo Cost", | ||
| Line 324: | Line 320: | ||
} | } | ||
local output = | local output = {} | ||
for _, def in ipairs(tableDefs) do | |||
for _, | local t = buildTable(frame, rows, def, def.options) | ||
local | if t ~= "" then | ||
table.insert(output, t) | |||
end | end | ||
end | end | ||
return | return table.concat(output, "\n\n") | ||
end | end | ||
| Line 385: | Line 342: | ||
}) | }) | ||
end | end | ||
table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | ||
local tableDefs = { | local tableDefs = { | ||
{ | |||
title = "Base Fire Rate", | |||
columns = { | |||
{ label = "Rounds/s", field = "roundsPerSecond" }, | |||
} | |||
}, | |||
{ | { | ||
title = "Base Alt-Fire Fire Rate", | title = "Base Alt-Fire Fire Rate", | ||
| Line 411: | Line 359: | ||
} | } | ||
local output = | local output = {} | ||
for _, def in ipairs(tableDefs) do | |||
for _, | local t = buildTable(frame, rows, def, def.options) | ||
local | if t ~= "" then | ||
table.insert(output, t) | |||
end | end | ||
end | end | ||
return | return table.concat(output, "\n\n") | ||
end | end | ||
| Line 476: | Line 385: | ||
}) | }) | ||
end | end | ||
table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | ||
local tableDefs = { | local tableDefs = { | ||
{ | |||
title = "Base Falloff Range", | |||
columns = { | |||
{ label = "Minimum Range (m)", field = "falloffStartRange" }, | |||
{ label = "Maximum Range (m)", field = "falloffEndRange" }, | |||
} | |||
} , | |||
{ | { | ||
title = "Base Alt-Fire Falloff Range", | title = "Base Alt-Fire Falloff Range", | ||
| Line 503: | Line 405: | ||
} | } | ||
local output = | local output = {} | ||
for _, def in ipairs(tableDefs) do | |||
for _, | local t = buildTable(frame, rows, def, def.options) | ||
local | if t ~= "" then | ||
table.insert(output, t) | |||
end | end | ||
end | end | ||
return | return table.concat(output, "\n\n") | ||
end | end | ||
| Line 562: | Line 425: | ||
name = name, | name = name, | ||
bulletDamage = tonumber(data["Weapon>BulletDamage"]) or 0, | bulletDamage = tonumber(data["Weapon>BulletDamage"]) or 0, | ||
scalingDamage = tonumber(data["LevelScaling>BulletDamage"]) or 0, | scalingDamage = "+" .. tonumber(data["LevelScaling>BulletDamage"]) or 0, | ||
maxScalingDamage = tonumber(roundValue(data["Weapon>BulletDamage"] + data["LevelScaling>BulletDamage"] * soul_unlock.get_max("PowerIncrease"))) or 0, | |||
altBulletDamage = tonumber(data["Weapon>AltFire>BulletDamage"]) or 0, | altBulletDamage = tonumber(data["Weapon>AltFire>BulletDamage"]) or 0, | ||
spiritScalingDamage = "+" .. (tonumber(data["SpiritScaling>BulletDamage"]) or 0), | |||
}) | }) | ||
end | end | ||
table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | ||
local | local tableDefs = { | ||
{ | |||
title = "Hero Base Bullet Damage Stats", | |||
columns = { | |||
{ label = "Starting", field = "bulletDamage" }, | |||
{ label = "Added per Boon", field = "scalingDamage" }, | |||
{ label = "At Max Boon", field = "maxScalingDamage" }, | |||
} | |||
}, | |||
} | |||
local output = {} | |||
for _, | for _, def in ipairs(tableDefs) do | ||
local t = buildTable(frame, rows, def, def.options) | |||
if t ~= "" then | |||
table.insert(output, t) | |||
end | |||
end | end | ||
return table.concat(output, "\n\n") | |||
end | end | ||
| Line 596: | Line 464: | ||
name = name, | name = name, | ||
lightMeleeDamage = tonumber(data["LightMeleeDamage"]) or 0, | lightMeleeDamage = tonumber(data["LightMeleeDamage"]) or 0, | ||
scalingDamage = tonumber(data["LevelScaling>LightMeleeDamage"]) or 0 | scalingDamage = "+" .. tonumber(data["LevelScaling>LightMeleeDamage"]) or 0, | ||
maxScalingDamage = tonumber(roundValue(data["LightMeleeDamage"] + data["LevelScaling>LightMeleeDamage"] * soul_unlock.get_max("PowerIncrease"))) or 0, | |||
}) | }) | ||
end | end | ||
table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | ||
local | local tableDefs = { | ||
{ | |||
title = "Hero Base Light Melee Stats", | |||
columns = { | |||
{ label = "Starting", field = "lightMeleeDamage" }, | |||
{ label = "Added per Boon", field = "scalingDamage" }, | |||
{ label = "At Max Boon", field = "maxScalingDamage" }, | |||
} | |||
} | |||
} | |||
local output = {} | |||
for _, def in ipairs(tableDefs) do | |||
local t = buildTable(frame, rows, def, def.options) | |||
if t ~= "" then | |||
table.insert(output, t) | |||
end | |||
end | |||
return table.concat(output, "\n\n") | |||
end | end | ||
| Line 628: | Line 501: | ||
name = name, | name = name, | ||
heavyMeleeDamage = tonumber(data["HeavyMeleeDamage"]) or 0, | heavyMeleeDamage = tonumber(data["HeavyMeleeDamage"]) or 0, | ||
scalingDamage = tonumber(data["LevelScaling>HeavyMeleeDamage"]) or 0 | scalingDamage = "+" .. tonumber(data["LevelScaling>HeavyMeleeDamage"]) or 0, | ||
maxScalingDamage = tonumber(roundValue(data["HeavyMeleeDamage"] + data["LevelScaling>HeavyMeleeDamage"] * soul_unlock.get_max("PowerIncrease"))) or 0, | |||
spiritScalingDamage = "+" .. (tonumber(data["SpiritScaling>HeavyMeleeDamage"]) or 0), | |||
}) | }) | ||
end | end | ||
table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | ||
local | local tableDefs = { | ||
{ | |||
title = "Hero Base Heavy Melee Stats", | |||
columns = { | |||
{ label = "Starting", field = "heavyMeleeDamage" }, | |||
{ label = "Added per Boon", field = "scalingDamage" }, | |||
{ label = "At Max Boon", field = "maxScalingDamage" }, | |||
} | |||
} | |||
} | |||
local output = {} | |||
for _, def in ipairs(tableDefs) do | |||
local t = buildTable(frame, rows, def, def.options) | |||
if t ~= "" then | |||
table.insert(output, t) | |||
end | |||
end | |||
return table.concat(output, "\n\n") | |||
end | end | ||
| Line 664: | Line 543: | ||
table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | ||
local | local tableDefs = { | ||
" | { | ||
title = "Hero Base Stamina Stats", | |||
columns = { | |||
{ label = "Stamina Bars", field = "stamina" }, | |||
{ label = "Cooldown (s)", field = "staminaCooldown" }, | |||
} | |||
} | |||
} | |||
local output = {} | |||
for _, def in ipairs(tableDefs) do | |||
local t = buildTable(frame, rows, def, def.options) | |||
if t ~= "" then | |||
table.insert(output, t) | |||
end | |||
end | |||
return table.concat(output, "\n\n") | |||
end | end | ||
| Line 686: | Line 571: | ||
table.insert(rows, { | table.insert(rows, { | ||
name = name, | name = name, | ||
dashSpeed = data["GroundDashSpeed"] or 0 | |||
}) | }) | ||
end | end | ||
table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | ||
local tableDefs = { | |||
{ | |||
title = "Hero Base Dash Speed Stats", | |||
columns = { | |||
{ label = "Dash Speed (m/s)", field = "dashSpeed" }, | |||
} | |||
} | |||
} | |||
local output = {} | |||
for _, def in ipairs(tableDefs) do | |||
local t = buildTable(frame, rows, def, def.options) | |||
if t ~= "" then | |||
table.insert(output, t) | |||
end | |||
end | |||
return table.concat(output, "\n\n") | |||
end | end | ||
| Line 705: | Line 599: | ||
local heroReloadData = heroDataArray({"Name", "Weapon>ReloadTime"}) | local heroReloadData = heroDataArray({"Name", "Weapon>ReloadTime"}) | ||
local rows = {} | local rows = {} | ||
for name, data in pairs(heroReloadData) do | for name, data in pairs(heroReloadData) do | ||
| Line 714: | Line 607: | ||
end | end | ||
table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | ||
local tableDefs = { | |||
local | { | ||
title = "Hero Base Reload Time Stats", | |||
columns = { | |||
{ label = "Reload Time (s)", field = "reloadTime" }, | |||
} | |||
} | |||
} | |||
local output = {} | |||
for _, def in ipairs(tableDefs) do | |||
local t = buildTable(frame, rows, def, def.options) | |||
if t ~= "" then | |||
table.insert(output, t) | |||
end | |||
end | |||
return table.concat(output, "\n\n") | |||
end | end | ||
| Line 772: | Line 669: | ||
name = name, | name = name, | ||
moveSpeed = tonumber(data["MaxMoveSpeed"]) or 0, | moveSpeed = tonumber(data["MaxMoveSpeed"]) or 0, | ||
sprintSpeed = tonumber(data["SprintSpeed"]) or 0 | sprintSpeed = tonumber(data["SprintSpeed"]) or 0, | ||
totalSpeed = tonumber(data["MaxMoveSpeed"] + data["SprintSpeed"]) or 0, | |||
}) | }) | ||
end | end | ||
table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | ||
local | local tableDefs = { | ||
{ | |||
title = "Hero Base Move Speed Stats", | |||
columns = { | |||
{ label = "Move Speed (m/s)", field = "moveSpeed" }, | |||
{ label = "Sprint Speed (m/s)", field = "sprintSpeed" }, | |||
{ label = "Total Speed (m/s)", field = "totalSpeed" }, | |||
} | |||
} | |||
} | |||
for _, | local output = {} | ||
for _, def in ipairs(tableDefs) do | |||
local t = buildTable(frame, rows, def, def.options) | |||
if t ~= "" then | |||
table.insert(output, t) | |||
end | |||
end | end | ||
return table.concat(output, "\n\n") | |||
end | end | ||
| Line 866: | Line 771: | ||
columns = { | columns = { | ||
{ label = "Crit Bonus Scale (%)", field = "critBonusScale" } | { label = "Crit Bonus Scale (%)", field = "critBonusScale" } | ||
} | |||
} | |||
} | |||
local output = {} | |||
for _, def in ipairs(tableDefs) do | |||
local t = buildTable(frame, rows, def, def.options) | |||
if t ~= "" then | |||
table.insert(output, t) | |||
end | |||
end | |||
return table.concat(output, "\n\n") | |||
end | |||
p.heroSpiritTable = function(frame) | |||
local heroSpiritData = heroDataArray({"Name", "TechPower"}) | |||
local rows = {} | |||
for name, data in pairs(heroCritData) do | |||
table.insert(rows, { | |||
name = name, | |||
spiritScaling = "+".. data["TechPower"] or 0, | |||
maxSpiritScaling = tonumber(data["TechPower"] * soul_unlock.get_max("PowerIncrease")) or 0, | |||
}) | |||
end | |||
table.sort(rows, function(a, b) return a.name:lower() < b.name:lower() end) | |||
local tableDefs = { | |||
{ | |||
title = "Hero Spirit Scaling Stats", | |||
columns = { | |||
{ label = "Spirit Per Boon", field = "spiritScaling" }, | |||
{ label = "At Max Boon", field = "maxSpiritScaling" }, | |||
} | } | ||
} | } | ||