diff --git a/stats/effects/pandorasbox/pandorasboxenergybreak/pandorasboxenergybreak.lua b/stats/effects/pandorasbox/pandorasboxenergybreak/pandorasboxenergybreak.lua index 094cc870fe9..01997646180 100644 --- a/stats/effects/pandorasbox/pandorasboxenergybreak/pandorasboxenergybreak.lua +++ b/stats/effects/pandorasbox/pandorasboxenergybreak/pandorasboxenergybreak.lua @@ -1,17 +1,17 @@ -require "/scripts/status.lua" -require "/scripts/util.lua" -require "/scripts/interp.lua" - function init() + bonusHandler=effect.addStatModifierGroup({ + {stat = "energyRegenPercentageRate", effectiveMultiplier = 0}, + {stat = "energyRegenBlockTime", effectiveMultiplier = 0} + }) end function update(dt) -if status.overConsumeResource("energy", 0) then - status.setResourceLocked("energy", true); - status.setResourcePercentage("energy", 0); - effect.addStatModifierGroup({ - {stat = "energyRegenPercentageRate", effectiveMultiplier = 0}, - {stat = "energyRegenBlockTime", effectiveMultiplier = 0} - }) - end + if status.isResource("energy") then + status.setResourceLocked("energy", true) + status.setResourcePercentage("energy", 0) + end +end + +function uninit() + effect.removeStatModifierGroup(bonusHandler) end