now we sums stacks in effects
This commit is contained in:
parent
be386be601
commit
a9f8816c8e
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user