Add Comment

This commit is contained in:
Athebyne 2024-05-09 14:37:19 -04:00 committed by GitHub
parent 8dbb3f1606
commit b732992ffd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2211,6 +2211,7 @@ export class MovePhase extends BattlePhase {
? new Utils.IntegerHolder(this.targets[0]) ? new Utils.IntegerHolder(this.targets[0])
: null; : null;
if (moveTarget) { if (moveTarget) {
//If user has an ability preventing moves from being redirected, or is using a move that can not be redirected (i.e. Snipe Shot), don't redirect it.
if (!(this.pokemon.hasAbilityWithAttr(BlockRedirectAbAttr) || this.move.getMove().getAttrs(BypassRedirectAttr).length) ) if (!(this.pokemon.hasAbilityWithAttr(BlockRedirectAbAttr) || this.move.getMove().getAttrs(BypassRedirectAttr).length) )
{ {
this.scene.getField(true).filter(p => p !== this.pokemon).forEach(p => applyAbAttrs(RedirectMoveAbAttr, p, null, this.move.moveId, moveTarget)); this.scene.getField(true).filter(p => p !== this.pokemon).forEach(p => applyAbAttrs(RedirectMoveAbAttr, p, null, this.move.moveId, moveTarget));