diff --git a/src/data/ability.ts b/src/data/ability.ts index 320ffb4eca5..10ae51ec6d4 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -4778,7 +4778,7 @@ export class TerrainEventTypeChangeAbAttr extends PostSummonAbAttr { } override apply(pokemon: Pokemon, _passive: boolean, _simulated: boolean, _cancelled: Utils.BooleanHolder, _args: any[]): boolean { - if (pokemon.isTerastallized()) { + if (pokemon.isTerastallized) { return false; } const currentTerrain = globalScene.arena.getTerrainType(); diff --git a/src/data/move.ts b/src/data/move.ts index af4f5bc00e9..955a53b3c59 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -4658,7 +4658,7 @@ export class TeraStarstormTypeAttr extends VariableMoveTypeAttr { * @returns `true` if the move type is changed to {@linkcode Type.STELLAR}, `false` otherwise */ override apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - if (user.isTerastallized() && (user.hasFusionSpecies(Species.TERAPAGOS) || user.species.speciesId === Species.TERAPAGOS)) { + if (user.isTerastallized && (user.hasFusionSpecies(Species.TERAPAGOS) || user.species.speciesId === Species.TERAPAGOS)) { const moveType = args[0] as Utils.NumberHolder; moveType.value = Type.STELLAR; diff --git a/src/test/abilities/libero.test.ts b/src/test/abilities/libero.test.ts index 42627da51a3..f6e85979c69 100644 --- a/src/test/abilities/libero.test.ts +++ b/src/test/abilities/libero.test.ts @@ -11,7 +11,7 @@ import { Species } from "#enums/species"; import { WeatherType } from "#enums/weather-type"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; describe("Abilities - Libero", () => { @@ -258,7 +258,7 @@ describe("Abilities - Libero", () => { const leadPokemon = game.scene.getPlayerPokemon()!; expect(leadPokemon).not.toBe(undefined); - vi.spyOn(leadPokemon, "isTerastallized").mockReturnValue(true); + leadPokemon.isTerastallized = true; game.move.select(Moves.SPLASH); await game.phaseInterceptor.to(TurnEndPhase); diff --git a/src/test/abilities/protean.test.ts b/src/test/abilities/protean.test.ts index 787834f8a9d..c7d04b9e1c8 100644 --- a/src/test/abilities/protean.test.ts +++ b/src/test/abilities/protean.test.ts @@ -11,7 +11,7 @@ import { Species } from "#enums/species"; import { WeatherType } from "#enums/weather-type"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; -import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest"; describe("Abilities - Protean", () => { @@ -258,7 +258,7 @@ describe("Abilities - Protean", () => { const leadPokemon = game.scene.getPlayerPokemon()!; expect(leadPokemon).not.toBe(undefined); - vi.spyOn(leadPokemon, "isTerastallized").mockReturnValue(true); + leadPokemon.isTerastallized = true; game.move.select(Moves.SPLASH); await game.phaseInterceptor.to(TurnEndPhase); diff --git a/src/test/moves/tera_blast.test.ts b/src/test/moves/tera_blast.test.ts index 44dc29f68b5..e53cb8f10b3 100644 --- a/src/test/moves/tera_blast.test.ts +++ b/src/test/moves/tera_blast.test.ts @@ -34,7 +34,6 @@ describe("Moves - Tera Blast", () => { .starterSpecies(Species.FEEBAS) .moveset([ Moves.TERA_BLAST ]) .ability(Abilities.BALL_FETCH) - .startingHeldItems([{ name: "TERA_SHARD", type: Type.FIRE }]) .enemySpecies(Species.MAGIKARP) .enemyMoveset(Moves.SPLASH) .enemyAbility(Abilities.BALL_FETCH) @@ -44,13 +43,15 @@ describe("Moves - Tera Blast", () => { }); it("changes type to match user's tera type", async () => { - game.override - .enemySpecies(Species.FURRET) - .startingHeldItems([{ name: "TERA_SHARD", type: Type.FIGHTING }]); + game.override.enemySpecies(Species.FURRET); await game.startBattle(); const enemyPokemon = game.scene.getEnemyPokemon()!; vi.spyOn(enemyPokemon, "apply"); + const playerPokemon = game.scene.getPlayerPokemon()!; + playerPokemon.teraType = Type.FIGHTING; + playerPokemon.isTerastallized = true; + game.move.select(Moves.TERA_BLAST); await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]); await game.phaseInterceptor.to("MoveEffectPhase"); @@ -59,10 +60,12 @@ describe("Moves - Tera Blast", () => { }, 20000); it("increases power if user is Stellar tera type", async () => { - game.override.startingHeldItems([{ name: "TERA_SHARD", type: Type.STELLAR }]); - await game.startBattle(); + const playerPokemon = game.scene.getPlayerPokemon()!; + playerPokemon.teraType = Type.STELLAR; + playerPokemon.isTerastallized = true; + game.move.select(Moves.TERA_BLAST); await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]); await game.phaseInterceptor.to("MoveEffectPhase"); @@ -71,13 +74,15 @@ describe("Moves - Tera Blast", () => { }, 20000); it("is super effective against terastallized targets if user is Stellar tera type", async () => { - game.override.startingHeldItems([{ name: "TERA_SHARD", type: Type.STELLAR }]); - await game.startBattle(); + const playerPokemon = game.scene.getPlayerPokemon()!; + playerPokemon.teraType = Type.STELLAR; + playerPokemon.isTerastallized = true; + const enemyPokemon = game.scene.getEnemyPokemon()!; vi.spyOn(enemyPokemon, "apply"); - vi.spyOn(enemyPokemon, "isTerastallized").mockReturnValue(true); + enemyPokemon.isTerastallized = true; game.move.select(Moves.TERA_BLAST); await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]); @@ -94,6 +99,7 @@ describe("Moves - Tera Blast", () => { const playerPokemon = game.scene.getPlayerPokemon()!; playerPokemon.stats[Stat.ATK] = 100; playerPokemon.stats[Stat.SPATK] = 1; + playerPokemon.isTerastallized = true; game.move.select(Moves.TERA_BLAST); await game.phaseInterceptor.to("TurnEndPhase"); @@ -101,10 +107,11 @@ describe("Moves - Tera Blast", () => { }, 20000); it("causes stat drops if user is Stellar tera type", async () => { - game.override.startingHeldItems([{ name: "TERA_SHARD", type: Type.STELLAR }]); await game.startBattle(); const playerPokemon = game.scene.getPlayerPokemon()!; + playerPokemon.teraType = Type.STELLAR; + playerPokemon.isTerastallized = true; game.move.select(Moves.TERA_BLAST); await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]); diff --git a/src/test/moves/tera_starstorm.test.ts b/src/test/moves/tera_starstorm.test.ts index 22dd5b3c4d1..1e934b88c86 100644 --- a/src/test/moves/tera_starstorm.test.ts +++ b/src/test/moves/tera_starstorm.test.ts @@ -29,8 +29,7 @@ describe("Moves - Tera Starstorm", () => { .enemyAbility(Abilities.BALL_FETCH) .enemyMoveset(Moves.SPLASH) .enemyLevel(30) - .enemySpecies(Species.MAGIKARP) - .startingHeldItems([{ name: "TERA_SHARD", type: Type.FIRE }]); + .enemySpecies(Species.MAGIKARP); }); it("changes type to Stellar when used by Terapagos in its Stellar Form", async () => { @@ -38,19 +37,22 @@ describe("Moves - Tera Starstorm", () => { await game.classicMode.startBattle([ Species.TERAPAGOS ]); const terapagos = game.scene.getPlayerPokemon()!; + terapagos.isTerastallized = true; vi.spyOn(terapagos, "getMoveType"); game.move.select(Moves.TERA_STARSTORM); await game.phaseInterceptor.to("TurnEndPhase"); - expect(terapagos.isTerastallized()).toBe(true); expect(terapagos.getMoveType).toHaveReturnedWith(Type.STELLAR); }); it("targets both opponents in a double battle when used by Terapagos in its Stellar Form", async () => { await game.classicMode.startBattle([ Species.MAGIKARP, Species.TERAPAGOS ]); + const terapagos = game.scene.getPlayerParty()[1]; + terapagos.isTerastallized = true; + game.move.select(Moves.TERA_STARSTORM, 0, BattlerIndex.ENEMY); game.move.select(Moves.TERA_STARSTORM, 1); @@ -82,6 +84,8 @@ describe("Moves - Tera Starstorm", () => { fusionedMon.fusionGender = magikarp.gender; fusionedMon.fusionLuck = magikarp.luck; + fusionedMon.isTerastallized = true; + vi.spyOn(fusionedMon, "getMoveType"); game.move.select(Moves.TERA_STARSTORM, 0); @@ -90,7 +94,6 @@ describe("Moves - Tera Starstorm", () => { // Fusion and terastallized expect(fusionedMon.isFusion()).toBe(true); - expect(fusionedMon.isTerastallized()).toBe(true); // Move effects should be applied expect(fusionedMon.getMoveType).toHaveReturnedWith(Type.STELLAR); expect(game.scene.getEnemyField().every(pokemon => pokemon.isFullHp())).toBe(false);