diff --git a/test/abilities/wimp-out.test.ts b/test/abilities/wimp-out.test.ts index a1c19a12fd4..cf8916e28bf 100644 --- a/test/abilities/wimp-out.test.ts +++ b/test/abilities/wimp-out.test.ts @@ -344,8 +344,7 @@ describe("Abilities - Wimp Out", () => { it("Wimp Out activating should not cancel a double battle", async () => { game.override.battleStyle("double").enemyAbility(AbilityId.WIMP_OUT).enemyMoveset([MoveId.SPLASH]).enemyLevel(1); await game.classicMode.startBattle([SpeciesId.WIMPOD, SpeciesId.TYRUNT]); - const enemyLeadPokemon = game.scene.getEnemyParty()[0]; - const enemySecPokemon = game.scene.getEnemyParty()[1]; + const [enemyLeadPokemon, enemySecPokemon] = game.scene.getEnemyParty(); game.move.select(MoveId.FALSE_SWIPE, 0, BattlerIndex.ENEMY); game.move.select(MoveId.SPLASH, 1); diff --git a/test/evolution.test.ts b/test/evolution.test.ts index 172a4e5d3aa..ff254e1dcc1 100644 --- a/test/evolution.test.ts +++ b/test/evolution.test.ts @@ -34,8 +34,7 @@ describe("Evolution", () => { it("should keep hidden ability after evolving", async () => { await game.classicMode.runToSummon([SpeciesId.EEVEE, SpeciesId.TRAPINCH]); - const eevee = game.scene.getPlayerParty()[0]; - const trapinch = game.scene.getPlayerParty()[1]; + const [eevee, trapinch] = game.scene.getPlayerParty(); eevee.abilityIndex = 2; trapinch.abilityIndex = 2; @@ -49,8 +48,7 @@ describe("Evolution", () => { it("should keep same ability slot after evolving", async () => { await game.classicMode.runToSummon([SpeciesId.BULBASAUR, SpeciesId.CHARMANDER]); - const bulbasaur = game.scene.getPlayerParty()[0]; - const charmander = game.scene.getPlayerParty()[1]; + const [bulbasaur, charmander] = game.scene.getPlayerParty(); bulbasaur.abilityIndex = 0; charmander.abilityIndex = 1; @@ -80,8 +78,7 @@ describe("Evolution", () => { nincada.gender = 1; await nincada.evolve(pokemonEvolutions[SpeciesId.NINCADA][0], nincada.getSpeciesForm()); - const ninjask = game.scene.getPlayerParty()[0]; - const shedinja = game.scene.getPlayerParty()[1]; + const [ninjask, shedinja] = game.scene.getPlayerParty(); expect(ninjask.abilityIndex).toBe(2); expect(shedinja.abilityIndex).toBe(1); expect(ninjask.gender).toBe(1); diff --git a/test/items/light-ball.test.ts b/test/items/light-ball.test.ts index a7f41255ff3..1215bf1118c 100644 --- a/test/items/light-ball.test.ts +++ b/test/items/light-ball.test.ts @@ -113,8 +113,7 @@ describe("Items - Light Ball", () => { it("LIGHT_BALL held by fused PIKACHU (base)", async () => { await game.classicMode.startBattle([SpeciesId.PIKACHU, SpeciesId.MAROWAK]); - const partyMember = game.scene.getPlayerParty()[0]; - const ally = game.scene.getPlayerParty()[1]; + const [partyMember, ally] = game.scene.getPlayerParty(); // Fuse party members (taken from PlayerPokemon.fuse(...) function) partyMember.fusionSpecies = ally.species; @@ -152,8 +151,7 @@ describe("Items - Light Ball", () => { it("LIGHT_BALL held by fused PIKACHU (part)", async () => { await game.classicMode.startBattle([SpeciesId.MAROWAK, SpeciesId.PIKACHU]); - const partyMember = game.scene.getPlayerParty()[0]; - const ally = game.scene.getPlayerParty()[1]; + const [partyMember, ally] = game.scene.getPlayerParty(); // Fuse party members (taken from PlayerPokemon.fuse(...) function) partyMember.fusionSpecies = ally.species; diff --git a/test/items/metal-powder.test.ts b/test/items/metal-powder.test.ts index 4dac8dd39b1..19f7b407c1a 100644 --- a/test/items/metal-powder.test.ts +++ b/test/items/metal-powder.test.ts @@ -107,8 +107,7 @@ describe("Items - Metal Powder", () => { it("METAL_POWDER held by fused DITTO (base)", async () => { await game.classicMode.startBattle([SpeciesId.DITTO, SpeciesId.MAROWAK]); - const partyMember = game.scene.getPlayerParty()[0]; - const ally = game.scene.getPlayerParty()[1]; + const [partyMember, ally] = game.scene.getPlayerParty(); // Fuse party members (taken from PlayerPokemon.fuse(...) function) partyMember.fusionSpecies = ally.species; @@ -140,8 +139,7 @@ describe("Items - Metal Powder", () => { it("METAL_POWDER held by fused DITTO (part)", async () => { await game.classicMode.startBattle([SpeciesId.MAROWAK, SpeciesId.DITTO]); - const partyMember = game.scene.getPlayerParty()[0]; - const ally = game.scene.getPlayerParty()[1]; + const [partyMember, ally] = game.scene.getPlayerParty(); // Fuse party members (taken from PlayerPokemon.fuse(...) function) partyMember.fusionSpecies = ally.species; diff --git a/test/items/quick-powder.test.ts b/test/items/quick-powder.test.ts index 2200e8cf96e..b264948dafe 100644 --- a/test/items/quick-powder.test.ts +++ b/test/items/quick-powder.test.ts @@ -107,8 +107,7 @@ describe("Items - Quick Powder", () => { it("QUICK_POWDER held by fused DITTO (base)", async () => { await game.classicMode.startBattle([SpeciesId.DITTO, SpeciesId.MAROWAK]); - const partyMember = game.scene.getPlayerParty()[0]; - const ally = game.scene.getPlayerParty()[1]; + const [partyMember, ally] = game.scene.getPlayerParty(); // Fuse party members (taken from PlayerPokemon.fuse(...) function) partyMember.fusionSpecies = ally.species; @@ -140,8 +139,7 @@ describe("Items - Quick Powder", () => { it("QUICK_POWDER held by fused DITTO (part)", async () => { await game.classicMode.startBattle([SpeciesId.MAROWAK, SpeciesId.DITTO]); - const partyMember = game.scene.getPlayerParty()[0]; - const ally = game.scene.getPlayerParty()[1]; + const [partyMember, ally] = game.scene.getPlayerParty(); // Fuse party members (taken from PlayerPokemon.fuse(...) function) partyMember.fusionSpecies = ally.species; diff --git a/test/items/thick-club.test.ts b/test/items/thick-club.test.ts index c497cef6338..9e139e48724 100644 --- a/test/items/thick-club.test.ts +++ b/test/items/thick-club.test.ts @@ -157,8 +157,7 @@ describe("Items - Thick Club", () => { await game.classicMode.startBattle([species[randSpecies], SpeciesId.PIKACHU]); - const partyMember = game.scene.getPlayerParty()[0]; - const ally = game.scene.getPlayerParty()[1]; + const [partyMember, ally] = game.scene.getPlayerParty(); // Fuse party members (taken from PlayerPokemon.fuse(...) function) partyMember.fusionSpecies = ally.species; @@ -194,8 +193,7 @@ describe("Items - Thick Club", () => { await game.classicMode.startBattle([SpeciesId.PIKACHU, species[randSpecies]]); - const partyMember = game.scene.getPlayerParty()[0]; - const ally = game.scene.getPlayerParty()[1]; + const [partyMember, ally] = game.scene.getPlayerParty(); // Fuse party members (taken from PlayerPokemon.fuse(...) function) partyMember.fusionSpecies = ally.species; diff --git a/test/moves/dragon-tail.test.ts b/test/moves/dragon-tail.test.ts index efc4fbd5cee..7c114fc779d 100644 --- a/test/moves/dragon-tail.test.ts +++ b/test/moves/dragon-tail.test.ts @@ -78,8 +78,7 @@ describe("Moves - Dragon Tail", () => { const leadPokemon = game.scene.getPlayerParty()[0]; - const enemyLeadPokemon = game.scene.getEnemyParty()[0]; - const enemySecPokemon = game.scene.getEnemyParty()[1]; + const [enemyLeadPokemon, enemySecPokemon] = game.scene.getEnemyParty(); game.move.select(MoveId.DRAGON_TAIL, 0, BattlerIndex.ENEMY); game.move.select(MoveId.SPLASH, 1); @@ -105,11 +104,9 @@ describe("Moves - Dragon Tail", () => { game.override.battleStyle("double").enemyMoveset(MoveId.SPLASH).enemyAbility(AbilityId.ROUGH_SKIN); await game.classicMode.startBattle([SpeciesId.DRATINI, SpeciesId.DRATINI, SpeciesId.WAILORD, SpeciesId.WAILORD]); - const leadPokemon = game.scene.getPlayerParty()[0]; - const secPokemon = game.scene.getPlayerParty()[1]; + const [leadPokemon, secPokemon] = game.scene.getPlayerParty(); - const enemyLeadPokemon = game.scene.getEnemyParty()[0]; - const enemySecPokemon = game.scene.getEnemyParty()[1]; + const [enemyLeadPokemon, enemySecPokemon] = game.scene.getEnemyParty(); game.move.select(MoveId.DRAGON_TAIL, 0, BattlerIndex.ENEMY); // target the same pokemon, second move should be redirected after first flees