bdd-creature/classes/dataholders/statholder.lua

17 lines
408 B
Lua
Raw Normal View History

2024-08-02 08:39:28 +02:00
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)
2024-08-02 09:06:50 +02:00
return self.commands.base + ((self.commands.lvl or 0) * level) + (self.commands.add or 0) + (self.commands.bonus or 0)
2024-08-02 08:39:28 +02:00
end
return StatHolder