2016-01-16 01:26:33 -05:00
|
|
|
-----------------------------------
|
2021-04-01 15:10:15 -04:00
|
|
|
-- xi.effect.STR_BOOST
|
2016-01-16 01:26:33 -05:00
|
|
|
-----------------------------------
|
2024-08-24 21:26:29 -04:00
|
|
|
---@type TEffect
|
2022-10-06 17:22:04 +03:00
|
|
|
local effectObject = {}
|
2016-01-16 01:26:33 -05:00
|
|
|
|
2022-10-06 17:22:04 +03:00
|
|
|
effectObject.onEffectGain = function(target, effect)
|
2021-04-01 15:10:15 -04:00
|
|
|
target:addMod(xi.mod.STR, effect:getPower())
|
2018-08-07 19:36:44 -04:00
|
|
|
end
|
2016-01-16 01:26:33 -05:00
|
|
|
|
2022-10-06 17:22:04 +03:00
|
|
|
effectObject.onEffectTick = function(target, effect)
|
2016-01-16 01:26:33 -05:00
|
|
|
-- the effect loses strengh of 1 every 3 ticks depending on the source of the boost
|
2022-12-03 09:20:16 -05:00
|
|
|
local boostSTREffectSize = effect:getPower()
|
|
|
|
|
if boostSTREffectSize > 0 then
|
|
|
|
|
effect:setPower(boostSTREffectSize - 1)
|
2021-04-01 15:10:15 -04:00
|
|
|
target:delMod(xi.mod.STR, 1)
|
2016-01-16 01:26:33 -05:00
|
|
|
end
|
2018-08-07 19:36:44 -04:00
|
|
|
end
|
2016-01-16 01:26:33 -05:00
|
|
|
|
2022-10-06 17:22:04 +03:00
|
|
|
effectObject.onEffectLose = function(target, effect)
|
2022-12-03 09:20:16 -05:00
|
|
|
local boostSTREffectSize = effect:getPower()
|
|
|
|
|
if boostSTREffectSize > 0 then
|
|
|
|
|
target:delMod(xi.mod.STR, boostSTREffectSize)
|
2016-01-16 01:26:33 -05:00
|
|
|
end
|
2018-08-07 19:36:44 -04:00
|
|
|
end
|
2021-01-07 03:22:42 -05:00
|
|
|
|
2022-10-06 17:22:04 +03:00
|
|
|
return effectObject
|