From b1e1ef614fbbeb40efbd196c35d1945939cc8307 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 3 Jul 2021 08:56:57 +0200 Subject: [PATCH] chore: use constant for stat names --- sonic-radiance.love/datas/consts/stats.lua | 27 ++++++++++++++-------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/sonic-radiance.love/datas/consts/stats.lua b/sonic-radiance.love/datas/consts/stats.lua index e1f09b3..3c2e677 100644 --- a/sonic-radiance.love/datas/consts/stats.lua +++ b/sonic-radiance.love/datas/consts/stats.lua @@ -1,5 +1,14 @@ local CONST = {} +CONST.HPMAX = "hpmax" +CONST.PPMAX = "ppmax" +CONST.ATTACK = "attack" +CONST.POWER = "power" +CONST.DEFENSE = "defense" +CONST.MIND = "mind" +CONST.TECHNIC = "technic" +CONST.SPEED = "speed" + CONST.RANK_E = 10 CONST.RANK_D = 25 CONST.RANK_C = 40 @@ -8,17 +17,17 @@ CONST.RANK_A = 80 CONST.RANK_S = 100 CONST.MULT_HP = 4.5 -CONST.LIST = {"hpmax", "ppmax", "attack", "power", "defense", "mind", "technic", "speed"} +CONST.LIST = {CONST.HPMAX, CONST.PPMAX, CONST.ATTACK, CONST.POWER, CONST.DEFENSE, CONST.MIND, CONST.TECHNIC, CONST.SPEED} CONST.SIMPLENAME = {} -CONST.SIMPLENAME["hpmax"] = "HP" -CONST.SIMPLENAME["ppmax"] = "PP" -CONST.SIMPLENAME["attack"] = "ATK" -CONST.SIMPLENAME["power"] = "POW" -CONST.SIMPLENAME["defense"] = "DEF" -CONST.SIMPLENAME["mind"] = "MND" -CONST.SIMPLENAME["technic"] = "TEK" -CONST.SIMPLENAME["speed"] = "SPD" +CONST.SIMPLENAME[CONST.HPMAX] = "HP" +CONST.SIMPLENAME[CONST.PPMAX] = "PP" +CONST.SIMPLENAME[CONST.ATTACK] = "ATK" +CONST.SIMPLENAME[CONST.POWER] = "POW" +CONST.SIMPLENAME[CONST.DEFENSE] = "DEF" +CONST.SIMPLENAME[CONST.MIND] = "MND" +CONST.SIMPLENAME[CONST.TECHNIC] = "TEK" +CONST.SIMPLENAME[CONST.SPEED] = "SPD" CONST.EXP_MULTIPLICATOR = 4 CONST.EXP_RATIO = 5