landsandboat/scripts/effects/curse.lua
WinterSolstice8 dd12553960 Audit HP/MP calculations (incl curse, weakness, hp%, food)
Add new mods for weakness/curse as they are not additive to hpp/mpp
Move everything to correct places based on retail testing
Move HP/MP traits to "base" HP/MP via new mods
2024-11-26 15:11:37 -08:00

22 lines
746 B
Lua

-----------------------------------
-- xi.effect.CURSE
-----------------------------------
---@type TEffect
local effectObject = {}
effectObject.onEffectGain = function(target, effect)
--NOTE: The power amount dictates the amount to REDUCE MAX VALUES BY. E.g. Power=75 means 'reduce max hp/mp by 75%'
target:addMod(xi.mod.CURSE_PCT, -effect:getPower())
target:addMod(xi.mod.MOVE_SPEED_WEIGHT_PENALTY, effect:getPower())
end
effectObject.onEffectTick = function(target, effect)
end
effectObject.onEffectLose = function(target, effect)
--restore HP and MP to its former state.
target:delMod(xi.mod.CURSE_PCT, -effect:getPower())
target:delMod(xi.mod.MOVE_SPEED_WEIGHT_PENALTY, effect:getPower())
end
return effectObject