diff --git a/src/data/ability.ts b/src/data/ability.ts index 95609fb0831..ea2bad7e092 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -4687,7 +4687,7 @@ export class TerrainEventTypeChangeAbAttr extends PostSummonAbAttr { super(true); } - apply(pokemon: Pokemon, passive: boolean, simulated: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { + apply(pokemon: Pokemon, _passive: boolean, _simulated: boolean, _cancelled: Utils.BooleanHolder, _args: any[]): boolean { if (pokemon.isTerastallized()) { return false; } diff --git a/src/field/arena.ts b/src/field/arena.ts index 52b535ef3bf..09faee49d56 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -10,7 +10,14 @@ import Move from "#app/data/move"; import { ArenaTag, ArenaTagSide, ArenaTrapTag, getArenaTag } from "#app/data/arena-tag"; import { BattlerIndex } from "#app/battle"; import { Terrain, TerrainType } from "#app/data/terrain"; -import { applyAbAttrs, applyPostTerrainChangeAbAttrs, applyPostWeatherChangeAbAttrs, PostTerrainChangeAbAttr, PostWeatherChangeAbAttr, TerrainEventTypeChangeAbAttr } from "#app/data/ability"; +import { + applyAbAttrs, + applyPostTerrainChangeAbAttrs, + applyPostWeatherChangeAbAttrs, + PostTerrainChangeAbAttr, + PostWeatherChangeAbAttr, + TerrainEventTypeChangeAbAttr +} from "#app/data/ability"; import Pokemon from "#app/field/pokemon"; import Overrides from "#app/overrides"; import { TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena"; diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 2e2254be048..ff096add798 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1245,8 +1245,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } // the type added to Pokemon from moves like Forest's Curse or Trick Or Treat - if (this.summonData?.addedType && !types.includes(this.summonData?.addedType)) { - types.push(this.summonData?.addedType); + if (this.summonData && this.summonData.addedType && !types.includes(this.summonData.addedType)) { + types.push(this.summonData.addedType); } // this.scene potentially can be undefined for a fainted pokemon in doubles diff --git a/src/test/abilities/mimicry.test.ts b/src/test/abilities/mimicry.test.ts index a4c6cad496e..d950caa5f48 100644 --- a/src/test/abilities/mimicry.test.ts +++ b/src/test/abilities/mimicry.test.ts @@ -38,16 +38,15 @@ describe("Abilities - Mimicry", () => { game.override.enemyAbility(Abilities.MISTY_SURGE); await game.classicMode.startBattle([ Species.FEEBAS, Species.ABRA ]); - const playerPokemon1 = game.scene.getPlayerPokemon(); + const [ playerPokemon1, playerPokemon2 ] = game.scene.getParty(); game.move.select(Moves.SPLASH); await game.toNextTurn(); - expect(playerPokemon1?.getTypes().includes(Type.FAIRY)).toBe(true); + expect(playerPokemon1.getTypes().includes(Type.FAIRY)).toBe(true); game.doSwitchPokemon(1); await game.toNextTurn(); - const playerPokemon2 = game.scene.getPlayerPokemon(); - expect(playerPokemon2?.getTypes().includes(Type.FAIRY)).toBe(true); + expect(playerPokemon2.getTypes().includes(Type.FAIRY)).toBe(true); }); it("Pokemon should revert back to its original, root type once terrain ends", async () => {