- 428
- Posts
- 5
- Years
- Zekko
- Seen Nov 21, 2023
Infinite loop crash when Storm Drain tries checking if the move's used by a foe or not before redirecting it to the ability holder. Alternatively Storm Drain redirects every Water move undesirably.
Storm Drain's effect redirects every Water attack used to hit the user. Even if the redirected Water attack was used by the Pokemon with Storm Drain or his allies. This turns the ability into a huge handicap for Water Pokemon.
Storm Drain did look like this.
And then, I changed it to look like this.
This resulted in crashes whenever any Water move is used.
This also results in crashes and an infinite loop whenever any Water move is used:
The error message says this:
Storm Drain's effect redirects every Water attack used to hit the user. Even if the redirected Water attack was used by the Pokemon with Storm Drain or his allies. This turns the ability into a huge handicap for Water Pokemon.
Storm Drain did look like this.
Code:
targets = pbChangeTargetByAbility(:STORMDRAIN, :WATER, move, user, targets, priority, nearOnly)
And then, I changed it to look like this.
Code:
if target.opposes?(user)
targets = pbChangeTargetByAbility(:STORMDRAIN, :WATER, move, user, targets, priority, nearOnly)
return targets
else
return targets
end
end
This resulted in crashes whenever any Water move is used.
This also results in crashes and an infinite loop whenever any Water move is used:
Code:
targets = pbChangeTargetByAbility(:STORMDRAIN, :WATER, move, user, targets, priority, AllFoes)
end
Code:
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.2]
Exception: NameError
Message: uninitialized constant Battle::Battler::AllFoes
Backtrace:
167:Battler_UseMoveTargeting:143:in `pbChangeTargets'
166:Battler_UseMove:253:in `pbUseMove'
166:Battler_UseMove:52:in `block in pbProcessTurn'
012:PBDebug:6:in `logonerr'
166:Battler_UseMove:51:in `pbProcessTurn'
156:Battle_AttackPhase:128:in `block (2 levels) in pbAttackPhaseMoves'
156:Battle_AttackPhase:124:in `each'
156:Battle_AttackPhase:124:in `block in pbAttackPhaseMoves'
156:Battle_AttackPhase:110:in `loop'
156:Battle_AttackPhase:110:in `pbAttackPhaseMoves'