[BUG] Fixes bug with Metronome freezing the game (#2819)

* Tests MovePhase with new PokemonMove instead of moveset search

* Accounts for metronome call on charging moves

* Update comment in ChargeAttr to be clearer
This commit is contained in:
schmidtc1 2024-07-15 13:13:04 -04:00 committed by GitHub
parent b215de1628
commit 4261ab37ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -2280,7 +2280,11 @@ export class ChargeAttr extends OverrideMoveEffectAttr {
user.pushMoveHistory({ move: move.id, targets: [ target.getBattlerIndex() ], result: MoveResult.OTHER });
user.getMoveQueue().push({ move: move.id, targets: [ target.getBattlerIndex() ], ignorePP: true });
if (this.sameTurn) {
user.scene.pushMovePhase(new MovePhase(user.scene, user, [ target.getBattlerIndex() ], user.moveset.find(m => m.moveId === move.id), true), this.followUpPriority);
let movesetMove = user.moveset.find(m => m.moveId === move.id);
if (!movesetMove) { // account for any move that calls a ChargeAttr move when the ChargeAttr move does not exist in moveset
movesetMove = new PokemonMove(move.id, 0, 0, true);
}
user.scene.pushMovePhase(new MovePhase(user.scene, user, [ target.getBattlerIndex() ], movesetMove, true), this.followUpPriority);
}
user.addTag(BattlerTagType.CHARGING, 1, move.id, user.id);
resolve(true);