landsandboat/scripts/effects/agi_boost.lua

28 lines
795 B
Lua
Raw Permalink Normal View History

2016-01-16 01:26:33 -05:00
-----------------------------------
2021-04-01 15:10:15 -04:00
-- xi.effect.AGI_BOOST
2016-01-16 01:26:33 -05:00
-----------------------------------
---@type TEffect
local effectObject = {}
2016-01-16 01:26:33 -05:00
effectObject.onEffectGain = function(target, effect)
2021-04-01 15:10:15 -04:00
target:addMod(xi.mod.AGI, effect:getPower())
end
2016-01-16 01:26:33 -05:00
effectObject.onEffectTick = function(target, effect)
2016-01-16 01:26:33 -05:00
-- the effect loses agility of 1 every 3 ticks depending on the source of the agi boost
local boostAGIEffectSize = effect:getPower()
if boostAGIEffectSize > 0 then
effect:setPower(boostAGIEffectSize - 1)
2021-04-01 15:10:15 -04:00
target:delMod(xi.mod.AGI, 1)
2016-01-16 01:26:33 -05:00
end
end
2016-01-16 01:26:33 -05:00
effectObject.onEffectLose = function(target, effect)
local boostAGIEffectSize = effect:getPower()
if boostAGIEffectSize > 0 then
target:delMod(xi.mod.AGI, boostAGIEffectSize)
2016-01-16 01:26:33 -05:00
end
end
return effectObject