2024-08-15 10:42:55 +02:00
|
|
|
local BoostHolder = Object:extend()
|
|
|
|
|
|
|
|
function BoostHolder:new(list)
|
|
|
|
self.parent = list
|
|
|
|
self.table = {}
|
|
|
|
end
|
|
|
|
|
|
|
|
function BoostHolder:add(name, val)
|
|
|
|
if (self.table[name] == nil) then
|
|
|
|
self.table[name] = val
|
|
|
|
else
|
|
|
|
self.table[name] = self.table[name] + val
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function BoostHolder:getValue(name, val)
|
|
|
|
if (name == "pv" or name == "pe") then
|
|
|
|
return val * 3
|
|
|
|
else
|
|
|
|
return val * 5
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function BoostHolder:apply()
|
|
|
|
for key, value in pairs(self.table) do
|
2024-09-02 15:51:37 +02:00
|
|
|
-- TODO : a changer entièrement
|
|
|
|
self.parent:addToHolder(key, "lvl", self:getValue(key, value * 2))
|
2024-08-15 10:42:55 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return BoostHolder
|