feat: implémentation du modulo
This commit is contained in:
parent
ce9c4ee89f
commit
158da18b0a
1 changed files with 4 additions and 1 deletions
|
@ -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
|
Loading…
Reference in a new issue