pokerogue/test/moves/burning_jealousy.test.ts
NightKev 9dcb904649
[Misc] Improve enum naming (#5933)
* Rename `Abilities` to `AbilityId`

* Rename `abilities.ts` to `ability-id.ts`

* Rename `Moves` to `MoveId`

* Rename `moves.ts` to `move-id.ts`

* Rename `Species` to `SpeciesId`

* Rename `species.ts` to `species-id.ts`

* Rename `Biome` to `BiomeId`

* Rename `biome.ts` to `biome-id.ts`

* Replace `Abilities` with `AbilityId` in comments

* Replace `Biome` with `BiomeId` in comments

* Replace `Moves` with `MoveId` in comments

* Replace `Species` with `SpeciesId` in comments
2025-06-04 14:54:27 -07:00

96 lines
3.2 KiB
TypeScript

import { BattlerIndex } from "#app/battle";
import { allMoves } from "#app/data/data-lists";
import { AbilityId } from "#enums/ability-id";
import { StatusEffect } from "#app/enums/status-effect";
import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Moves - Burning Jealousy", () => {
let phaserGame: Phaser.Game;
let game: GameManager;
beforeAll(() => {
phaserGame = new Phaser.Game({
type: Phaser.HEADLESS,
});
});
afterEach(() => {
game.phaseInterceptor.restoreOg();
});
beforeEach(() => {
game = new GameManager(phaserGame);
game.override
.battleStyle("single")
.disableCrits()
.enemySpecies(SpeciesId.MAGIKARP)
.enemyAbility(AbilityId.ICE_SCALES)
.enemyMoveset([MoveId.HOWL])
.startingLevel(10)
.enemyLevel(10)
.starterSpecies(SpeciesId.FEEBAS)
.ability(AbilityId.BALL_FETCH)
.moveset([MoveId.BURNING_JEALOUSY, MoveId.GROWL]);
});
it("should burn the opponent if their stat stages were raised", async () => {
await game.classicMode.startBattle();
const enemy = game.scene.getEnemyPokemon()!;
game.move.select(MoveId.BURNING_JEALOUSY);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.phaseInterceptor.to("BerryPhase");
expect(enemy.status?.effect).toBe(StatusEffect.BURN);
});
it("should still burn the opponent if their stat stages were both raised and lowered in the same turn", async () => {
game.override.starterSpecies(0).battleStyle("double");
await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.ABRA]);
const enemy = game.scene.getEnemyPokemon()!;
game.move.select(MoveId.BURNING_JEALOUSY);
game.move.select(MoveId.GROWL, 1);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER_2, BattlerIndex.PLAYER, BattlerIndex.ENEMY_2]);
await game.phaseInterceptor.to("BerryPhase");
expect(enemy.status?.effect).toBe(StatusEffect.BURN);
});
it("should ignore stat stages raised by IMPOSTER", async () => {
game.override.enemySpecies(SpeciesId.DITTO).enemyAbility(AbilityId.IMPOSTER).enemyMoveset(MoveId.SPLASH);
await game.classicMode.startBattle();
const enemy = game.scene.getEnemyPokemon()!;
game.move.select(MoveId.BURNING_JEALOUSY);
await game.phaseInterceptor.to("BerryPhase");
expect(enemy.status?.effect).toBeUndefined();
});
// TODO: Make this test if WP is implemented
it.todo("should ignore weakness policy", async () => {
await game.classicMode.startBattle();
});
it("should be boosted by Sheer Force even if opponent didn't raise stat stages", async () => {
game.override.ability(AbilityId.SHEER_FORCE).enemyMoveset(MoveId.SPLASH);
vi.spyOn(allMoves[MoveId.BURNING_JEALOUSY], "calculateBattlePower");
await game.classicMode.startBattle();
game.move.select(MoveId.BURNING_JEALOUSY);
await game.phaseInterceptor.to("BerryPhase");
expect(allMoves[MoveId.BURNING_JEALOUSY].calculateBattlePower).toHaveReturnedWith(
allMoves[MoveId.BURNING_JEALOUSY].power * 1.3,
);
});
});