Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Move] Remove .edgeCase() from fully implemented moves #4876

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/data/move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9876,11 +9876,9 @@ export function initMoves() {
.ignoresSubstitute()
.partial(), // Does not steal stats
new AttackMove(Moves.SUNSTEEL_STRIKE, Type.STEEL, MoveCategory.PHYSICAL, 100, 100, 5, -1, 0, 7)
.ignoresAbilities()
.edgeCase(), // Should not ignore abilities when called virtually (metronome)
.ignoresAbilities(),
new AttackMove(Moves.MOONGEIST_BEAM, Type.GHOST, MoveCategory.SPECIAL, 100, 100, 5, -1, 0, 7)
.ignoresAbilities()
.edgeCase(), // Should not ignore abilities when called virtually (metronome)
.ignoresAbilities(),
new StatusMove(Moves.TEARFUL_LOOK, Type.NORMAL, -1, 20, -1, 0, 7)
.attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPATK ], -1),
new AttackMove(Moves.ZING_ZAP, Type.ELECTRIC, MoveCategory.PHYSICAL, 80, 100, 10, 30, 0, 7)
Expand All @@ -9903,8 +9901,7 @@ export function initMoves() {
.punchingMove(),
new AttackMove(Moves.PHOTON_GEYSER, Type.PSYCHIC, MoveCategory.SPECIAL, 100, 100, 5, -1, 0, 7)
.attr(PhotonGeyserCategoryAttr)
.ignoresAbilities()
.edgeCase(), // Should not ignore abilities when called virtually (metronome)
.ignoresAbilities(),
/* Unused */
new AttackMove(Moves.LIGHT_THAT_BURNS_THE_SKY, Type.PSYCHIC, MoveCategory.SPECIAL, 200, -1, 1, -1, 0, 7)
.attr(PhotonGeyserCategoryAttr)
Expand Down
59 changes: 59 additions & 0 deletions src/test/moves/moongeist_beam.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { allMoves, RandomMoveAttr } from "#app/data/move";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import GameManager from "#test/utils/gameManager";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";

describe("Moves - Moongeist Beam", () => {
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
.moveset([ Moves.MOONGEIST_BEAM, Moves.METRONOME ])
.ability(Abilities.BALL_FETCH)
.startingLevel(200)
.battleType("single")
.disableCrits()
.enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.STURDY)
.enemyMoveset(Moves.SPLASH);
});

// Also covers Photon Geyser and Sunsteel Strike
it("should ignore enemy abilities", async () => {
await game.classicMode.startBattle([ Species.MILOTIC ]);

const enemy = game.scene.getEnemyPokemon()!;

game.move.select(Moves.MOONGEIST_BEAM);
await game.phaseInterceptor.to("BerryPhase");

expect(enemy.isFainted()).toBe(true);
});

// Also covers Photon Geyser and Sunsteel Strike
it("should not ignore enemy abilities when called by another move, such as metronome", async () => {
await game.classicMode.startBattle([ Species.MILOTIC ]);
vi.spyOn(allMoves[Moves.METRONOME].getAttrs(RandomMoveAttr)[0], "getMoveOverride").mockReturnValue(Moves.MOONGEIST_BEAM);

game.move.select(Moves.METRONOME);
await game.phaseInterceptor.to("BerryPhase");

expect(game.scene.getEnemyPokemon()!.isFainted()).toBe(false);
expect(game.scene.getPlayerPokemon()!.getLastXMoves()[0].move).toBe(Moves.MOONGEIST_BEAM);
});
});
Loading