From 5d4e93b009f14e3257f99acd06f4f389eb38d969 Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Wed, 30 Jul 2025 18:08:14 -0400 Subject: [PATCH] Removed bangs from `getEnemyParty` and `getPlayerParty` --- test/abilities/disguise.test.ts | 2 +- test/boss-pokemon.test.ts | 12 +++++------- test/moves/dragon-tail.test.ts | 14 +++++++------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/test/abilities/disguise.test.ts b/test/abilities/disguise.test.ts index bf271c81e4d..426e07c458a 100644 --- a/test/abilities/disguise.test.ts +++ b/test/abilities/disguise.test.ts @@ -134,7 +134,7 @@ describe("Abilities - Disguise", () => { }); await game.classicMode.startBattle([SpeciesId.FURRET, SpeciesId.MIMIKYU]); - const mimikyu = game.scene.getPlayerParty()[1]!; + const mimikyu = game.scene.getPlayerParty()[1]; expect(mimikyu.formIndex).toBe(bustedForm); game.move.select(MoveId.SPLASH); diff --git a/test/boss-pokemon.test.ts b/test/boss-pokemon.test.ts index 0a7c71c95e7..5f09214a46d 100644 --- a/test/boss-pokemon.test.ts +++ b/test/boss-pokemon.test.ts @@ -64,11 +64,9 @@ describe("Boss Pokemon / Shields", () => { it("should reduce the number of shields if we are in a double battle", async () => { game.override.battleStyle("double").startingWave(150); // Floor 150 > 2 shields / 3 health segments - await game.classicMode.startBattle([SpeciesId.MEWTWO]); - const boss1: EnemyPokemon = game.scene.getEnemyParty()[0]!; - const boss2: EnemyPokemon = game.scene.getEnemyParty()[1]!; + const [boss1, boss2] = game.scene.getEnemyParty(); expect(boss1.isBoss()).toBe(true); expect(boss1.bossSegments).toBe(2); expect(boss2.isBoss()).toBe(true); @@ -112,7 +110,7 @@ describe("Boss Pokemon / Shields", () => { // In this test we want to break through 3 shields at once const brokenShields = 3; - const boss1: EnemyPokemon = game.scene.getEnemyParty()[0]!; + const boss1: EnemyPokemon = game.scene.getEnemyParty()[0]; const boss1SegmentHp = boss1.getMaxHp() / boss1.bossSegments; const requiredDamageBoss1 = boss1SegmentHp * (1 + Math.pow(2, brokenShields)); expect(boss1.isBoss()).toBe(true); @@ -124,7 +122,7 @@ describe("Boss Pokemon / Shields", () => { expect(boss1.bossSegmentIndex).toBe(1); expect(boss1.hp).toBe(boss1.getMaxHp() - toDmgValue(boss1SegmentHp * 3)); - const boss2: EnemyPokemon = game.scene.getEnemyParty()[1]!; + const boss2: EnemyPokemon = game.scene.getEnemyParty()[1]; const boss2SegmentHp = boss2.getMaxHp() / boss2.bossSegments; const requiredDamageBoss2 = boss2SegmentHp * (1 + Math.pow(2, brokenShields)); @@ -144,7 +142,7 @@ describe("Boss Pokemon / Shields", () => { await game.classicMode.startBattle([SpeciesId.MEWTWO]); - const boss1: EnemyPokemon = game.scene.getEnemyParty()[0]!; + const boss1: EnemyPokemon = game.scene.getEnemyParty()[0]; const boss1SegmentHp = boss1.getMaxHp() / boss1.bossSegments; const singleShieldDamage = Math.ceil(boss1SegmentHp); expect(boss1.isBoss()).toBe(true); @@ -167,7 +165,7 @@ describe("Boss Pokemon / Shields", () => { expect(getTotalStatStageBoosts(boss1)).toBe(totalStatStages); } - const boss2: EnemyPokemon = game.scene.getEnemyParty()[1]!; + const boss2: EnemyPokemon = game.scene.getEnemyParty()[1]; const boss2SegmentHp = boss2.getMaxHp() / boss2.bossSegments; const requiredDamage = boss2SegmentHp * (1 + Math.pow(2, shieldsToBreak - 1)); diff --git a/test/moves/dragon-tail.test.ts b/test/moves/dragon-tail.test.ts index 487647784f7..efc4fbd5cee 100644 --- a/test/moves/dragon-tail.test.ts +++ b/test/moves/dragon-tail.test.ts @@ -76,10 +76,10 @@ 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 leadPokemon = game.scene.getPlayerParty()[0]; - const enemyLeadPokemon = game.scene.getEnemyParty()[0]!; - const enemySecPokemon = game.scene.getEnemyParty()[1]!; + const enemyLeadPokemon = game.scene.getEnemyParty()[0]; + const enemySecPokemon = game.scene.getEnemyParty()[1]; game.move.select(MoveId.DRAGON_TAIL, 0, BattlerIndex.ENEMY); game.move.select(MoveId.SPLASH, 1); @@ -105,11 +105,11 @@ 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 = game.scene.getPlayerParty()[0]; + const secPokemon = game.scene.getPlayerParty()[1]; - const enemyLeadPokemon = game.scene.getEnemyParty()[0]!; - const enemySecPokemon = game.scene.getEnemyParty()[1]!; + const enemyLeadPokemon = game.scene.getEnemyParty()[0]; + const enemySecPokemon = game.scene.getEnemyParty()[1]; game.move.select(MoveId.DRAGON_TAIL, 0, BattlerIndex.ENEMY); // target the same pokemon, second move should be redirected after first flees