From e864e67717d0b9896512fb03ae539b063f083050 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 15 May 2021 22:50:06 +0200 Subject: [PATCH] chore: put stats constants together --- sonic-radiance.love/datas/stats.lua | 12 ++++++++++++ sonic-radiance.love/game/utils/characters.lua | 13 +------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/sonic-radiance.love/datas/stats.lua b/sonic-radiance.love/datas/stats.lua index c6d625f..e1f09b3 100644 --- a/sonic-radiance.love/datas/stats.lua +++ b/sonic-radiance.love/datas/stats.lua @@ -20,4 +20,16 @@ CONST.SIMPLENAME["mind"] = "MND" CONST.SIMPLENAME["technic"] = "TEK" CONST.SIMPLENAME["speed"] = "SPD" +CONST.EXP_MULTIPLICATOR = 4 +CONST.EXP_RATIO = 5 + +CONST.BASE_STAT = 5 +CONST.BASE_HP = 15 +CONST.BASE_MP = 8 + +CONST.MULT_STAT = 2 +CONST.MULT_HP = 7.5 +CONST.SALT_HP = 35 +CONST.MULT_MP = 1.5 + return CONST diff --git a/sonic-radiance.love/game/utils/characters.lua b/sonic-radiance.love/game/utils/characters.lua index edfe2b5..e9e4390 100644 --- a/sonic-radiance.love/game/utils/characters.lua +++ b/sonic-radiance.love/game/utils/characters.lua @@ -1,17 +1,6 @@ local CharUtils = {} -local CONST = {} -CONST.EXP_MULTIPLICATOR = 4 -CONST.EXP_RATIO = 5 - -CONST.BASE_STAT = 5 -CONST.BASE_HP = 15 -CONST.BASE_MP = 8 - -CONST.MULT_STAT = 2 -CONST.MULT_HP = 7.5 -CONST.SALT_HP = 35 -CONST.MULT_MP = 1.5 +local CONST = require "datas.stats" function CharUtils.getExpValue(level) return math.floor( ( CONST.EXP_MULTIPLICATOR * ( level ^ 3 ) ) / CONST.EXP_RATIO )