Removed outdated modifier test

This commit is contained in:
Bertie690 2025-06-09 19:05:48 -04:00
parent 69bcbdcaa1
commit 1c2cefea51

View File

@ -1,17 +1,13 @@
import { allMoves } from "#app/data/data-lists";
import type Pokemon from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon";
import { MoveId } from "#enums/move-id"; import { MoveId } from "#enums/move-id";
import { AbilityId } from "#enums/ability-id"; import { AbilityId } from "#enums/ability-id";
import { SpeciesId } from "#enums/species-id"; import { SpeciesId } from "#enums/species-id";
import { BerryModifier } from "#app/modifier/modifier";
import { BattleType } from "#enums/battle-type"; import { BattleType } from "#enums/battle-type";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { BerryType } from "#enums/berry-type";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import { StealHeldItemChanceAttr } from "#app/data/moves/move";
describe("Field - Pokemon ID Checks", () => { describe("Field - Pokemon ID Checks", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -55,33 +51,7 @@ describe("Field - Pokemon ID Checks", () => {
expect(ids).toHaveLength(uniqueIds.length); expect(ids).toHaveLength(uniqueIds.length);
}); });
it("should not prevent item theft with PID of 0", async () => { it("should not prevent Battler Tags from triggering if user has PID of 0", async () => {
game.override.enemyHeldItems([{ name: "BERRY", count: 1, type: BerryType.APICOT }]);
// Mock thief's steal chance to be 100% guaranteed
vi.spyOn(allMoves[MoveId.THIEF], "attrs", "get").mockReturnValue([new StealHeldItemChanceAttr(1.0)]);
await game.classicMode.startBattle([SpeciesId.TREECKO]);
const player = game.scene.getPlayerPokemon()!;
const enemy = game.scene.getEnemyPokemon()!;
// Override enemy pokemon PID to be 0
enemy.id = 0;
game.scene.getModifiers(BerryModifier, false).forEach(modifier => {
modifier.pokemonId = enemy.id;
});
expect(enemy.getHeldItems()).toHaveLength(1);
expect(player.getHeldItems()).toHaveLength(0);
game.move.use(MoveId.THIEF);
await game.toNextTurn();
expect(enemy.getHeldItems()).toHaveLength(0);
expect(player.getHeldItems()).toHaveLength(1);
});
it("should not prevent Destiny Bond from triggering if user has PID of 0", async () => {
await game.classicMode.startBattle([SpeciesId.TREECKO, SpeciesId.AERODACTYL]); await game.classicMode.startBattle([SpeciesId.TREECKO, SpeciesId.AERODACTYL]);
const player = game.field.getPlayerPokemon(); const player = game.field.getPlayerPokemon();
@ -99,6 +69,7 @@ describe("Field - Pokemon ID Checks", () => {
const dBondTag = player.getTag(BattlerTagType.DESTINY_BOND)!; const dBondTag = player.getTag(BattlerTagType.DESTINY_BOND)!;
expect(dBondTag).toBeDefined(); expect(dBondTag).toBeDefined();
expect(dBondTag.sourceId).toBe(0); expect(dBondTag.sourceId).toBe(0);
expect(dBondTag.getSourcePokemon()).toBe(player);
await game.phaseInterceptor.to("MoveEndPhase"); await game.phaseInterceptor.to("MoveEndPhase");