Module:CharacterStat: Difference between revisions
no edit summary
LeTrashman (talk | contribs) No edit summary |
LeTrashman (talk | contribs) No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1:
local p = {}
-- Cumulative rarity bonus per stat.
local STAT_RARITY_BONUS = {
["attack"] = { 0, 1000, 2200, 3600, 5300 },
["defense"] = { 0, 0, 0, 0, 0 },
["heal"] = { 0, 750, 1750, 2950, 4450 },
["hp"] = { 0, 500, 1200, 2100, 3500 }
Line 12 ⟶ 14:
function p.calculate( frame )
local lvl = tonumber(
local rarity = tonumber (
local stat = frame.args.stat
local val1 = tonumber(
local val100 = tonumber(
return math.ceil(lerp(lvl, 1, 100, val1, val100) * (10000 + STAT_RARITY_BONUS[stat][rarity]) / 10000)
|