Skip to content

Commit

Permalink
pb energy break stat group spam fix. also, more performant
Browse files Browse the repository at this point in the history
  • Loading branch information
Kherae committed Apr 20, 2024
1 parent 8bb2335 commit 2b9d958
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2b9d958

Please sign in to comment.