Code: Select all
-- Overwrite equilibrium to properly treat sustains
function _M:incEquilibrium(v)
-- Only need to check sustain when decreasing equilibrium
if v < 0 then
local total_sustain = 0
for tid, act in pairs(self.sustain_talents) do
local t = self:getTalentFromId(tid)
if t.sustain_equilibrium then
total_sustain = total_sustain + t.sustain_equilibrium
end
end
v = math.max(v, total_sustain - self:getEquilibrium())
end
engine.interface.ActorResource.incEquilibrium(self, v)
end