From 158da18b0a8dfd70bd380ecd56760c2c702835ca Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Tue, 6 Aug 2024 22:25:27 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20impl=C3=A9mentation=20du=20modulo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/dataholders/statholder.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/classes/dataholders/statholder.lua b/classes/dataholders/statholder.lua index 62ad3f0..fa38979 100644 --- a/classes/dataholders/statholder.lua +++ b/classes/dataholders/statholder.lua @@ -11,7 +11,10 @@ function StatHolder:applyCommand(command, args) end function StatHolder:reduce(level) - return self.commands.base + ((self.commands.lvl or 0) * level) + (self.commands.add or 0) + (self.commands.bonus or 0) + 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 + return stat end return StatHolder \ No newline at end of file