pokerogue/test/moves/taunt.test.ts

55 lines
1.7 KiB
TypeScript
Raw Normal View History

[Moves][Ability] Implement Torment / Taunt / Imprison + Aroma Veil (#4378) * Torment * Taunt and Imprison * ability immunities * Aroma Veil * Imprison * Test Files * Added exceptions for Rollout and check for active ability * adding tests so that git doesn't auto-fail * Blah * please * some documentation * Removed random newlines * Added check for ability's presence mid battle * Changed BattlerTagImmunityAbAttr to look at lists instead * Work? * Imprison and Taunt Tests * Tests * Final tests before documentation * documentation blah * Imports * Flx Change * flx - adding overrides * Update src/data/arena-tag.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * flx fixes * quick docs * privated retrieveField * Handling undefined * Update src/data/arena-tag.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * forget to remove partials for heal block * Apply suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Marked Torment as partial * Update src/test/moves/torment.test.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * tsdocs * Prevents test pokemon from being immune to torment * Update src/data/arena-tag.ts Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com> * Torranx Fixes * Check for this.source * why * lighting things with my mind on fire * aRHGHSHDKSHD --------- Co-authored-by: frutescens <info@laptop> Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
2024-09-25 14:52:48 -07:00
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import { Abilities } from "#enums/abilities";
import GameManager from "#test/testUtils/gameManager";
[Moves][Ability] Implement Torment / Taunt / Imprison + Aroma Veil (#4378) * Torment * Taunt and Imprison * ability immunities * Aroma Veil * Imprison * Test Files * Added exceptions for Rollout and check for active ability * adding tests so that git doesn't auto-fail * Blah * please * some documentation * Removed random newlines * Added check for ability's presence mid battle * Changed BattlerTagImmunityAbAttr to look at lists instead * Work? * Imprison and Taunt Tests * Tests * Final tests before documentation * documentation blah * Imports * Flx Change * flx - adding overrides * Update src/data/arena-tag.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * flx fixes * quick docs * privated retrieveField * Handling undefined * Update src/data/arena-tag.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * forget to remove partials for heal block * Apply suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Marked Torment as partial * Update src/test/moves/torment.test.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * tsdocs * Prevents test pokemon from being immune to torment * Update src/data/arena-tag.ts Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com> * Torranx Fixes * Check for this.source * why * lighting things with my mind on fire * aRHGHSHDKSHD --------- Co-authored-by: frutescens <info@laptop> Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
2024-09-25 14:52:48 -07:00
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import { MoveResult } from "#app/field/pokemon";
import { BattlerTagType } from "#enums/battler-tag-type";
describe("Moves - Taunt", () => {
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")
.enemyAbility(Abilities.BALL_FETCH)
2024-10-04 13:08:31 +08:00
.enemyMoveset([ Moves.TAUNT, Moves.SPLASH ])
[Moves][Ability] Implement Torment / Taunt / Imprison + Aroma Veil (#4378) * Torment * Taunt and Imprison * ability immunities * Aroma Veil * Imprison * Test Files * Added exceptions for Rollout and check for active ability * adding tests so that git doesn't auto-fail * Blah * please * some documentation * Removed random newlines * Added check for ability's presence mid battle * Changed BattlerTagImmunityAbAttr to look at lists instead * Work? * Imprison and Taunt Tests * Tests * Final tests before documentation * documentation blah * Imports * Flx Change * flx - adding overrides * Update src/data/arena-tag.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * flx fixes * quick docs * privated retrieveField * Handling undefined * Update src/data/arena-tag.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * forget to remove partials for heal block * Apply suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Marked Torment as partial * Update src/test/moves/torment.test.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * tsdocs * Prevents test pokemon from being immune to torment * Update src/data/arena-tag.ts Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com> * Torranx Fixes * Check for this.source * why * lighting things with my mind on fire * aRHGHSHDKSHD --------- Co-authored-by: frutescens <info@laptop> Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
2024-09-25 14:52:48 -07:00
.enemySpecies(Species.SHUCKLE)
2024-10-04 13:08:31 +08:00
.moveset([ Moves.GROWL ]);
[Moves][Ability] Implement Torment / Taunt / Imprison + Aroma Veil (#4378) * Torment * Taunt and Imprison * ability immunities * Aroma Veil * Imprison * Test Files * Added exceptions for Rollout and check for active ability * adding tests so that git doesn't auto-fail * Blah * please * some documentation * Removed random newlines * Added check for ability's presence mid battle * Changed BattlerTagImmunityAbAttr to look at lists instead * Work? * Imprison and Taunt Tests * Tests * Final tests before documentation * documentation blah * Imports * Flx Change * flx - adding overrides * Update src/data/arena-tag.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * flx fixes * quick docs * privated retrieveField * Handling undefined * Update src/data/arena-tag.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * forget to remove partials for heal block * Apply suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Marked Torment as partial * Update src/test/moves/torment.test.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * tsdocs * Prevents test pokemon from being immune to torment * Update src/data/arena-tag.ts Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com> * Torranx Fixes * Check for this.source * why * lighting things with my mind on fire * aRHGHSHDKSHD --------- Co-authored-by: frutescens <info@laptop> Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
2024-09-25 14:52:48 -07:00
});
it("Pokemon should not be able to use Status Moves", async () => {
2024-10-04 13:08:31 +08:00
await game.classicMode.startBattle([ Species.REGIELEKI ]);
[Moves][Ability] Implement Torment / Taunt / Imprison + Aroma Veil (#4378) * Torment * Taunt and Imprison * ability immunities * Aroma Veil * Imprison * Test Files * Added exceptions for Rollout and check for active ability * adding tests so that git doesn't auto-fail * Blah * please * some documentation * Removed random newlines * Added check for ability's presence mid battle * Changed BattlerTagImmunityAbAttr to look at lists instead * Work? * Imprison and Taunt Tests * Tests * Final tests before documentation * documentation blah * Imports * Flx Change * flx - adding overrides * Update src/data/arena-tag.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * flx fixes * quick docs * privated retrieveField * Handling undefined * Update src/data/arena-tag.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * forget to remove partials for heal block * Apply suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Marked Torment as partial * Update src/test/moves/torment.test.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * tsdocs * Prevents test pokemon from being immune to torment * Update src/data/arena-tag.ts Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com> * Torranx Fixes * Check for this.source * why * lighting things with my mind on fire * aRHGHSHDKSHD --------- Co-authored-by: frutescens <info@laptop> Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
2024-09-25 14:52:48 -07:00
const playerPokemon = game.scene.getPlayerPokemon()!;
// First turn, Player Pokemon succeeds using Growl without Taunt
game.move.select(Moves.GROWL);
await game.forceEnemyMove(Moves.TAUNT);
await game.toNextTurn();
const move1 = playerPokemon.getLastXMoves(1)[0]!;
expect(move1.move).toBe(Moves.GROWL);
expect(move1.result).toBe(MoveResult.SUCCESS);
expect(playerPokemon?.getTag(BattlerTagType.TAUNT)).toBeDefined();
// Second turn, Taunt forces Struggle to occur
game.move.select(Moves.GROWL);
await game.forceEnemyMove(Moves.SPLASH);
await game.toNextTurn();
const move2 = playerPokemon.getLastXMoves(1)[0]!;
expect(move2.move).toBe(Moves.STRUGGLE);
});
});