17 lines
No EOL
410 B
Lua
17 lines
No EOL
410 B
Lua
local StatHolder = Object:extend()
|
|
|
|
function StatHolder:new(key, datas)
|
|
self.key = key
|
|
self.datas = datas
|
|
self.commands = {}
|
|
end
|
|
|
|
function StatHolder:applyCommand(command, args)
|
|
self.commands[command] = args
|
|
end
|
|
|
|
function StatHolder:reduce(level)
|
|
return self.commands.base + ((self.commands.level or 0) * level) + (self.commands.add or 0) + (self.commands.bonus or 0)
|
|
end
|
|
|
|
return StatHolder |