From 5a655d9d2513e04643c5e12fa2dbdea3229b17f1 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Sun, 16 Mar 2025 16:43:48 -0700 Subject: [PATCH] Fix merge issue --- src/data/challenge.ts | 2 +- src/system/pokemon-data.ts | 2 +- test/abilities/lightningrod.test.ts | 17 ++++++++--------- test/abilities/neutralizing_gas.test.ts | 7 ++----- test/abilities/storm_drain.test.ts | 17 ++++++++--------- 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/src/data/challenge.ts b/src/data/challenge.ts index dd899a819cf..fabdcb75eeb 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -474,7 +474,7 @@ export class SingleGenerationChallenge extends Challenge { applyPokemonInBattle(pokemon: Pokemon, valid: Utils.BooleanHolder): boolean { const baseGeneration = getPokemonSpecies(pokemon.species.speciesId).generation; - const fusionGeneration = pokemon.isFusion() ? getPokemonSpecies(pokemon.fusionSpecies?.speciesId).generation : 0; + const fusionGeneration = pokemon.isFusion() ? getPokemonSpecies(pokemon.fusionSpecies!.speciesId).generation : 0; if ( pokemon.isPlayer() && (baseGeneration !== this.value || (pokemon.isFusion() && fusionGeneration !== this.value)) diff --git a/src/system/pokemon-data.ts b/src/system/pokemon-data.ts index 0ffee2dc331..2a394df7a09 100644 --- a/src/system/pokemon-data.ts +++ b/src/system/pokemon-data.ts @@ -34,7 +34,7 @@ export default class PokemonData { public stats: number[]; public ivs: number[]; public nature: Nature; - public moveset: (PokemonMove)[]; + public moveset: PokemonMove[]; public status: Status | null; public friendship: number; public metLevel: number; diff --git a/test/abilities/lightningrod.test.ts b/test/abilities/lightningrod.test.ts index 1ca6c6b1e89..986899353ff 100644 --- a/test/abilities/lightningrod.test.ts +++ b/test/abilities/lightningrod.test.ts @@ -24,7 +24,7 @@ describe("Abilities - Lightningrod", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override - .moveset([ Moves.SPLASH, Moves.SHOCK_WAVE ]) + .moveset([Moves.SPLASH, Moves.SHOCK_WAVE]) .ability(Abilities.BALL_FETCH) .battleType("double") .disableCrits() @@ -34,7 +34,7 @@ describe("Abilities - Lightningrod", () => { }); it("should redirect electric type moves", async () => { - await game.classicMode.startBattle([ Species.FEEBAS, Species.MAGIKARP ]); + await game.classicMode.startBattle([Species.FEEBAS, Species.MAGIKARP]); const enemy1 = game.scene.getEnemyField()[0]; const enemy2 = game.scene.getEnemyField()[1]; @@ -49,8 +49,8 @@ describe("Abilities - Lightningrod", () => { }); it("should not redirect non-electric type moves", async () => { - game.override.moveset([ Moves.SPLASH, Moves.AERIAL_ACE ]); - await game.classicMode.startBattle([ Species.FEEBAS, Species.MAGIKARP ]); + game.override.moveset([Moves.SPLASH, Moves.AERIAL_ACE]); + await game.classicMode.startBattle([Species.FEEBAS, Species.MAGIKARP]); const enemy1 = game.scene.getEnemyField()[0]; const enemy2 = game.scene.getEnemyField()[1]; @@ -65,7 +65,7 @@ describe("Abilities - Lightningrod", () => { }); it("should boost the user's spatk without damaging", async () => { - await game.classicMode.startBattle([ Species.FEEBAS, Species.MAGIKARP ]); + await game.classicMode.startBattle([Species.FEEBAS, Species.MAGIKARP]); const enemy2 = game.scene.getEnemyField()[1]; @@ -81,7 +81,7 @@ describe("Abilities - Lightningrod", () => { it("should not redirect moves changed from electric type via ability", async () => { game.override.ability(Abilities.NORMALIZE); - await game.classicMode.startBattle([ Species.FEEBAS, Species.MAGIKARP ]); + await game.classicMode.startBattle([Species.FEEBAS, Species.MAGIKARP]); const enemy1 = game.scene.getEnemyField()[0]; const enemy2 = game.scene.getEnemyField()[1]; @@ -96,9 +96,8 @@ describe("Abilities - Lightningrod", () => { }); it("should redirect moves changed to electric type via ability", async () => { - game.override.ability(Abilities.GALVANIZE) - .moveset(Moves.TACKLE); - await game.classicMode.startBattle([ Species.FEEBAS, Species.MAGIKARP ]); + game.override.ability(Abilities.GALVANIZE).moveset(Moves.TACKLE); + await game.classicMode.startBattle([Species.FEEBAS, Species.MAGIKARP]); const enemy1 = game.scene.getEnemyField()[0]; const enemy2 = game.scene.getEnemyField()[1]; diff --git a/test/abilities/neutralizing_gas.test.ts b/test/abilities/neutralizing_gas.test.ts index 08ab884d806..dbb4b0562be 100644 --- a/test/abilities/neutralizing_gas.test.ts +++ b/test/abilities/neutralizing_gas.test.ts @@ -158,11 +158,8 @@ describe("Abilities - Neutralizing Gas", () => { }); it("should not activate abilities of pokemon no longer on the field", async () => { - game.override - .battleType("single") - .ability(Abilities.NEUTRALIZING_GAS) - .enemyAbility(Abilities.DELTA_STREAM); - await game.classicMode.startBattle([ Species.MAGIKARP ]); + game.override.battleType("single").ability(Abilities.NEUTRALIZING_GAS).enemyAbility(Abilities.DELTA_STREAM); + await game.classicMode.startBattle([Species.MAGIKARP]); const enemy = game.scene.getEnemyPokemon()!; const weatherChangeAttr = enemy.getAbilityAttrs(PostSummonWeatherChangeAbAttr, false)[0]; diff --git a/test/abilities/storm_drain.test.ts b/test/abilities/storm_drain.test.ts index e2a7b3e212e..58ff477fa43 100644 --- a/test/abilities/storm_drain.test.ts +++ b/test/abilities/storm_drain.test.ts @@ -24,7 +24,7 @@ describe("Abilities - Storm Drain", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override - .moveset([ Moves.SPLASH, Moves.WATER_GUN ]) + .moveset([Moves.SPLASH, Moves.WATER_GUN]) .ability(Abilities.BALL_FETCH) .battleType("double") .disableCrits() @@ -34,7 +34,7 @@ describe("Abilities - Storm Drain", () => { }); it("should redirect water type moves", async () => { - await game.classicMode.startBattle([ Species.FEEBAS, Species.MAGIKARP ]); + await game.classicMode.startBattle([Species.FEEBAS, Species.MAGIKARP]); const enemy1 = game.scene.getEnemyField()[0]; const enemy2 = game.scene.getEnemyField()[1]; @@ -49,8 +49,8 @@ describe("Abilities - Storm Drain", () => { }); it("should not redirect non-water type moves", async () => { - game.override.moveset([ Moves.SPLASH, Moves.AERIAL_ACE ]); - await game.classicMode.startBattle([ Species.FEEBAS, Species.MAGIKARP ]); + game.override.moveset([Moves.SPLASH, Moves.AERIAL_ACE]); + await game.classicMode.startBattle([Species.FEEBAS, Species.MAGIKARP]); const enemy1 = game.scene.getEnemyField()[0]; const enemy2 = game.scene.getEnemyField()[1]; @@ -65,7 +65,7 @@ describe("Abilities - Storm Drain", () => { }); it("should boost the user's spatk without damaging", async () => { - await game.classicMode.startBattle([ Species.FEEBAS, Species.MAGIKARP ]); + await game.classicMode.startBattle([Species.FEEBAS, Species.MAGIKARP]); const enemy2 = game.scene.getEnemyField()[1]; @@ -81,7 +81,7 @@ describe("Abilities - Storm Drain", () => { it("should not redirect moves changed from water type via ability", async () => { game.override.ability(Abilities.NORMALIZE); - await game.classicMode.startBattle([ Species.FEEBAS, Species.MAGIKARP ]); + await game.classicMode.startBattle([Species.FEEBAS, Species.MAGIKARP]); const enemy1 = game.scene.getEnemyField()[0]; const enemy2 = game.scene.getEnemyField()[1]; @@ -96,9 +96,8 @@ describe("Abilities - Storm Drain", () => { }); it("should redirect moves changed to water type via ability", async () => { - game.override.ability(Abilities.LIQUID_VOICE) - .moveset(Moves.PSYCHIC_NOISE); - await game.classicMode.startBattle([ Species.FEEBAS, Species.MAGIKARP ]); + game.override.ability(Abilities.LIQUID_VOICE).moveset(Moves.PSYCHIC_NOISE); + await game.classicMode.startBattle([Species.FEEBAS, Species.MAGIKARP]); const enemy1 = game.scene.getEnemyField()[0]; const enemy2 = game.scene.getEnemyField()[1];