feat: implémentation du modulo

This commit is contained in:
Kazhnuz 2024-08-06 22:25:27 +02:00
parent ce9c4ee89f
commit 158da18b0a

View file

@ -11,7 +11,10 @@ function StatHolder:applyCommand(command, args)
end end
function StatHolder:reduce(level) 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 end
return StatHolder return StatHolder