From 38a266b3ddf3a13390c5a13a1a6a18091ddf2e4e Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Thu, 5 Sep 2024 21:30:10 -0700 Subject: [PATCH] Make `OPP_MOVESET_OVERRIDE` fully override the enemy's moveset --- src/field/pokemon.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index f522d50f357..9be8e66e427 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -985,8 +985,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { // Overrides moveset based on arrays specified in overrides.ts const overrideArray: Array = this.isPlayer() ? Overrides.MOVESET_OVERRIDE : Overrides.OPP_MOVESET_OVERRIDE; if (overrideArray.length > 0) { + if (!this.isPlayer()) { + this.moveset = []; + } overrideArray.forEach((move: Moves, index: number) => { - const ppUsed = this.moveset[index]?.ppUsed || 0; + const ppUsed = this.moveset[index]?.ppUsed ?? 0; this.moveset[index] = new PokemonMove(move, Math.min(ppUsed, allMoves[move].pp)); }); }