feat(statholder): ajout des valeurs mins/max

This commit is contained in:
Kazhnuz 2024-08-07 07:20:34 +02:00
parent bd5a68c2a7
commit 55172401dd

View file

@ -14,6 +14,8 @@ function StatHolder:reduce(level)
local stat = self.commands.base + ((self.commands.lvl or 0) * level) + (self.commands.add or 0) + (self.commands.bonus or 0)
local modulo = commands.structs[self.key].modulo or 1
stat = math.floor(stat / modulo) * modulo
stat = math.min(stat, datas.max or 999999)
stat = math.max(stat, datas.min or -99999)
return stat
end