2024-09-01 19:57:07 -07:00
|
|
|
import { BattlerIndex } from "#app/battle";
|
|
|
|
import { allMoves } from "#app/data/move";
|
|
|
|
import { Abilities } from "#app/enums/abilities";
|
|
|
|
import { StatusEffect } from "#app/enums/status-effect";
|
|
|
|
import { Moves } from "#enums/moves";
|
|
|
|
import { Species } from "#enums/species";
|
2025-02-22 22:52:07 -06:00
|
|
|
import GameManager from "#test/testUtils/gameManager";
|
2024-09-01 19:57:07 -07:00
|
|
|
import Phaser from "phaser";
|
|
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
|
|
|
|
2024-09-20 14:05:45 -07:00
|
|
|
|
2024-09-01 19:57:07 -07:00
|
|
|
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
|
|
|
|
.battleType("single")
|
|
|
|
.disableCrits()
|
|
|
|
.enemySpecies(Species.MAGIKARP)
|
|
|
|
.enemyAbility(Abilities.ICE_SCALES)
|
2024-10-04 13:08:31 +08:00
|
|
|
.enemyMoveset([ Moves.HOWL ])
|
2024-09-01 19:57:07 -07:00
|
|
|
.startingLevel(10)
|
|
|
|
.enemyLevel(10)
|
|
|
|
.starterSpecies(Species.FEEBAS)
|
|
|
|
.ability(Abilities.BALL_FETCH)
|
2024-10-04 13:08:31 +08:00
|
|
|
.moveset([ Moves.BURNING_JEALOUSY, Moves.GROWL ]);
|
2024-09-01 19:57:07 -07:00
|
|
|
|
|
|
|
});
|
|
|
|
|
2024-09-02 22:12:34 -04:00
|
|
|
it("should burn the opponent if their stat stages were raised", async () => {
|
2024-09-01 19:57:07 -07:00
|
|
|
await game.classicMode.startBattle();
|
|
|
|
|
|
|
|
const enemy = game.scene.getEnemyPokemon()!;
|
|
|
|
|
|
|
|
game.move.select(Moves.BURNING_JEALOUSY);
|
2024-10-04 13:08:31 +08:00
|
|
|
await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]);
|
2024-09-01 19:57:07 -07:00
|
|
|
await game.phaseInterceptor.to("BerryPhase");
|
|
|
|
|
|
|
|
expect(enemy.status?.effect).toBe(StatusEffect.BURN);
|
2024-09-20 14:05:45 -07:00
|
|
|
});
|
2024-09-01 19:57:07 -07:00
|
|
|
|
2024-09-02 22:12:34 -04:00
|
|
|
it("should still burn the opponent if their stat stages were both raised and lowered in the same turn", async () => {
|
2024-09-01 19:57:07 -07:00
|
|
|
game.override
|
|
|
|
.starterSpecies(0)
|
|
|
|
.battleType("double");
|
2024-10-04 13:08:31 +08:00
|
|
|
await game.classicMode.startBattle([ Species.FEEBAS, Species.ABRA ]);
|
2024-09-01 19:57:07 -07:00
|
|
|
|
|
|
|
const enemy = game.scene.getEnemyPokemon()!;
|
|
|
|
|
|
|
|
game.move.select(Moves.BURNING_JEALOUSY);
|
|
|
|
game.move.select(Moves.GROWL, 1);
|
2024-10-04 13:08:31 +08:00
|
|
|
await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER_2, BattlerIndex.PLAYER, BattlerIndex.ENEMY_2 ]);
|
2024-09-01 19:57:07 -07:00
|
|
|
await game.phaseInterceptor.to("BerryPhase");
|
|
|
|
|
|
|
|
expect(enemy.status?.effect).toBe(StatusEffect.BURN);
|
2024-09-20 14:05:45 -07:00
|
|
|
});
|
2024-09-01 19:57:07 -07:00
|
|
|
|
2024-09-02 22:12:34 -04:00
|
|
|
it("should ignore stat stages raised by IMPOSTER", async () => {
|
2024-09-01 19:57:07 -07:00
|
|
|
game.override
|
|
|
|
.enemySpecies(Species.DITTO)
|
|
|
|
.enemyAbility(Abilities.IMPOSTER)
|
2024-09-09 09:55:11 -07:00
|
|
|
.enemyMoveset(Moves.SPLASH);
|
2024-09-01 19:57:07 -07:00
|
|
|
await game.classicMode.startBattle();
|
|
|
|
|
|
|
|
const enemy = game.scene.getEnemyPokemon()!;
|
|
|
|
|
|
|
|
game.move.select(Moves.BURNING_JEALOUSY);
|
|
|
|
await game.phaseInterceptor.to("BerryPhase");
|
|
|
|
|
|
|
|
expect(enemy.status?.effect).toBeUndefined();
|
2024-09-20 14:05:45 -07:00
|
|
|
});
|
2024-09-01 19:57:07 -07:00
|
|
|
|
2025-01-12 15:33:05 -08:00
|
|
|
// TODO: Make this test if WP is implemented
|
|
|
|
it.todo("should ignore weakness policy", async () => {
|
2024-09-01 19:57:07 -07:00
|
|
|
await game.classicMode.startBattle();
|
2024-09-20 14:05:45 -07:00
|
|
|
});
|
2024-09-01 19:57:07 -07:00
|
|
|
|
2024-09-02 22:12:34 -04:00
|
|
|
it("should be boosted by Sheer Force even if opponent didn't raise stat stages", async () => {
|
2024-09-01 19:57:07 -07:00
|
|
|
game.override
|
|
|
|
.ability(Abilities.SHEER_FORCE)
|
2024-09-09 09:55:11 -07:00
|
|
|
.enemyMoveset(Moves.SPLASH);
|
2024-09-01 19:57:07 -07:00
|
|
|
vi.spyOn(allMoves[Moves.BURNING_JEALOUSY], "calculateBattlePower");
|
|
|
|
await game.classicMode.startBattle();
|
|
|
|
|
|
|
|
game.move.select(Moves.BURNING_JEALOUSY);
|
|
|
|
await game.phaseInterceptor.to("BerryPhase");
|
|
|
|
|
|
|
|
expect(allMoves[Moves.BURNING_JEALOUSY].calculateBattlePower).toHaveReturnedWith(allMoves[Moves.BURNING_JEALOUSY].power * 5461 / 4096);
|
2024-09-20 14:05:45 -07:00
|
|
|
});
|
2024-09-01 19:57:07 -07:00
|
|
|
});
|