sonic-radiance/sonic-radiance.love/game/utils/characters.lua

34 lines
933 B
Lua
Raw Normal View History

local CharUtils = {}
2021-05-15 22:50:06 +02:00
local CONST = require "datas.stats"
function CharUtils.getExpValue(level)
return math.floor( ( CONST.EXP_MULTIPLICATOR * ( level ^ 3 ) ) / CONST.EXP_RATIO )
end
2020-08-06 19:10:54 +02:00
function CharUtils.getRelativeExpValue(exp, level)
return exp - CharUtils.getExpValue(level)
end
function CharUtils.getLevelExpRange(level)
return CharUtils.getExpValue(level + 1) - CharUtils.getExpValue(level)
end
function CharUtils.getRemainingExp(exp, level)
return CharUtils.getExpValue(level + 1) - exp
end
function CharUtils.getStatValue(level, base)
return math.floor( (((base * CONST.MULT_STAT) * level)/100) ) + CONST.BASE_STAT
end
function CharUtils.getHPValue(level, base)
2020-08-02 21:26:49 +02:00
return math.floor( (((CONST.SALT_HP + base * CONST.MULT_HP) * level)/100) ) + CONST.BASE_HP + level
end
function CharUtils.getPPValue(level, base)
return math.floor( (((base * CONST.MULT_MP) * level)/100) ) + CONST.BASE_MP
end
return CharUtils