FANDOM


local data = mw.loadData( 'Module:Calculator/data' )
local tsums = data.tsums
 
local calc = {}
function calc.score(frame)
    name = frame.args[1] or frame.args['name']
    if not tsums[name] then
        return "??"
    end
    base = tsums[name].bscr
    growth = tsums[name].gscr
    lvl = tonumber(frame.args['lvl']) or 1
    return base + growth*lvl
end
 
function calc.scoregr(frame)
    name = frame.args[1] or frame.args['name']
    if not tsums[name] then
        return "??"
    end
    growth = tsums[name].gscr
    return growth
end
 
function calc.hp(frame)
    name = frame.args[1] or frame.args['name']
    if not tsums[name] then
        return "??"
    end
    base = tsums[name].bhp
    growth = tsums[name].ghp
    lvl = tonumber(frame.args['lvl']) or 1
    return base + growth*lvl
end
 
function calc.hpgr(frame)
    name = frame.args[1] or frame.args['name']
    if not tsums[name] then
        return "??"
    end
    growth = tsums[name].ghp
    return growth
end
 
function calc.atk(frame)
    name = frame.args[1] or frame.args['name']
    if not tsums[name] then
        return "??"
    end
    base = tsums[name].batk
    growth = tsums[name].gatk
    lvl = tonumber(frame.args['lvl']) or 1
    return base + growth*lvl
end
 
function calc.atkgr(frame)
    name = frame.args[1] or frame.args['name']
    if not tsums[name] then
        return "??"
    end
    growth = tsums[name].gatk
    return growth
end
 
function calc.def(frame)
    name = frame.args[1] or frame.args['name']
    if not tsums[name] then
        return "??"
    end
    base = tsums[name].bdef
    growth = tsums[name].gdef
    lvl = tonumber(frame.args['lvl']) or 1
    return base + growth*lvl
end
 
function calc.defgr(frame)
    name = frame.args[1] or frame.args['name']
    if not tsums[name] then
        return "??"
    end
    growth = tsums[name].gdef
    return growth
end
 
return calc

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.