now we sums stacks in effects

This commit is contained in:
neckrat 2026-04-24 11:19:00 +03:00
parent be386be601
commit a9f8816c8e

View File

@ -30,7 +30,10 @@ function behavior:addEffect(effect, stacks, intensity)
-- проверяем эффект на возможности суммирования (aka противоречия) -- проверяем эффект на возможности суммирования (aka противоречия)
for i, ef in ipairs(self.effectsPriority) do for i, ef in ipairs(self.effectsPriority) do
if ef == effect then if ef == effect then
self.effectsProperties[ef] = { stacks = stacks, intensity = intensity } self.effectsProperties[ef] = {
stacks = stacks + self.effectsProperties[ef].stacks,
intensity = intensity
}
local task1 = effect:afterBirth(self.owner, intensity) local task1 = effect:afterBirth(self.owner, intensity)
if task1 then if task1 then
task1(function() end) task1(function() end)
@ -45,7 +48,10 @@ function behavior:addEffect(effect, stacks, intensity)
end end
self.effectsPriority[#self.effectsPriority + 1] = effect self.effectsPriority[#self.effectsPriority + 1] = effect
self.effectsProperties[effect] = { stacks = stacks, intensity = intensity } self.effectsProperties[effect] = {
stacks = stacks,
intensity = intensity
}
print("[Effects]: мы применили эффект!!") print("[Effects]: мы применили эффект!!")
local task1 = effect:afterBirth(self.owner, intensity) local task1 = effect:afterBirth(self.owner, intensity)
if task1 then if task1 then