pokerogue/src/test/abilities/disguise.test.ts

211 lines
6.7 KiB
TypeScript
Raw Normal View History

import { BattleStat } from "#app/data/battle-stat";
import { StatusEffect } from "#app/data/status-effect";
import { CommandPhase } from "#app/phases/command-phase";
import { MoveEffectPhase } from "#app/phases/move-effect-phase";
import { MoveEndPhase } from "#app/phases/move-end-phase";
import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { TurnInitPhase } from "#app/phases/turn-init-phase";
import { Mode } from "#app/ui/ui";
import { toDmgValue } from "#app/utils";
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import GameManager from "#test/utils/gameManager";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
import { SPLASH_ONLY } from "../utils/testUtils";
const TIMEOUT = 20 * 1000;
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
describe("Abilities - Disguise", () => {
let phaserGame: Phaser.Game;
let game: GameManager;
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
const bustedForm = 1;
const disguisedForm = 0;
beforeAll(() => {
phaserGame = new Phaser.Game({
type: Phaser.HEADLESS,
});
});
afterEach(() => {
game.phaseInterceptor.restoreOg();
});
beforeEach(() => {
game = new GameManager(phaserGame);
2024-07-25 14:48:48 -07:00
game.override.battleType("single");
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
game.override.enemySpecies(Species.MIMIKYU);
game.override.enemyMoveset(SPLASH_ONLY);
game.override.starterSpecies(Species.REGIELEKI);
game.override.moveset([Moves.SHADOW_SNEAK, Moves.VACUUM_WAVE, Moves.TOXIC_THREAD, Moves.SPLASH]);
}, TIMEOUT);
it("takes no damage from attacking move and transforms to Busted form, takes 1/8 max HP damage from the disguise breaking", async () => {
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
await game.startBattle();
const mimikyu = game.scene.getEnemyPokemon()!;
const maxHp = mimikyu.getMaxHp();
const disguiseDamage = toDmgValue(maxHp / 8);
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
expect(mimikyu.formIndex).toBe(disguisedForm);
game.move.select(Moves.SHADOW_SNEAK);
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
await game.phaseInterceptor.to(MoveEndPhase);
expect(mimikyu.hp).equals(maxHp - disguiseDamage);
expect(mimikyu.formIndex).toBe(bustedForm);
}, TIMEOUT);
it("doesn't break disguise when attacked with ineffective move", async () => {
await game.startBattle();
const mimikyu = game.scene.getEnemyPokemon()!;
expect(mimikyu.formIndex).toBe(disguisedForm);
game.move.select(Moves.VACUUM_WAVE);
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
await game.phaseInterceptor.to(MoveEndPhase);
expect(mimikyu.formIndex).toBe(disguisedForm);
}, TIMEOUT);
it("takes no damage from the first hit of a multihit move and transforms to Busted form, then takes damage from the second hit", async () => {
game.override.moveset([Moves.SURGING_STRIKES]);
game.override.enemyLevel(5);
await game.startBattle();
const mimikyu = game.scene.getEnemyPokemon()!;
const maxHp = mimikyu.getMaxHp();
const disguiseDamage = toDmgValue(maxHp / 8);
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
expect(mimikyu.formIndex).toBe(disguisedForm);
game.move.select(Moves.SURGING_STRIKES);
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
// First hit
await game.phaseInterceptor.to(MoveEffectPhase);
expect(mimikyu.hp).equals(maxHp - disguiseDamage);
expect(mimikyu.formIndex).toBe(disguisedForm);
// Second hit
await game.phaseInterceptor.to(MoveEffectPhase);
expect(mimikyu.hp).lessThan(maxHp - disguiseDamage);
expect(mimikyu.formIndex).toBe(bustedForm);
}, TIMEOUT);
it("takes effects from status moves and damage from status effects", async () => {
await game.startBattle();
const mimikyu = game.scene.getEnemyPokemon()!;
expect(mimikyu.hp).toBe(mimikyu.getMaxHp());
game.move.select(Moves.TOXIC_THREAD);
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
await game.phaseInterceptor.to(TurnEndPhase);
expect(mimikyu.formIndex).toBe(disguisedForm);
expect(mimikyu.status?.effect).toBe(StatusEffect.POISON);
expect(mimikyu.summonData.battleStats[BattleStat.SPD]).toBe(-1);
expect(mimikyu.hp).toBeLessThan(mimikyu.getMaxHp());
}, TIMEOUT);
it("persists form change when switched out", async () => {
game.override.enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK));
game.override.starterSpecies(0);
await game.startBattle([Species.MIMIKYU, Species.FURRET]);
const mimikyu = game.scene.getPlayerPokemon()!;
const maxHp = mimikyu.getMaxHp();
const disguiseDamage = toDmgValue(maxHp / 8);
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
game.move.select(Moves.SPLASH);
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
await game.phaseInterceptor.to(TurnEndPhase);
expect(mimikyu.formIndex).toBe(bustedForm);
expect(mimikyu.hp).equals(maxHp - disguiseDamage);
await game.toNextTurn();
game.doSwitchPokemon(1);
await game.phaseInterceptor.to(TurnEndPhase);
expect(mimikyu.formIndex).toBe(bustedForm);
}, TIMEOUT);
it("persists form change when wave changes with no arena reset", async () => {
game.override.starterSpecies(0);
game.override.starterForms({
[Species.MIMIKYU]: bustedForm
});
await game.startBattle([Species.FURRET, Species.MIMIKYU]);
const mimikyu = game.scene.getParty()[1]!;
expect(mimikyu.formIndex).toBe(bustedForm);
game.move.select(Moves.SPLASH);
await game.doKillOpponents();
await game.toNextWave();
expect(mimikyu.formIndex).toBe(bustedForm);
}, TIMEOUT);
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
it("reverts to Disguised form on arena reset", async () => {
game.override.startingWave(4);
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
game.override.starterSpecies(Species.MIMIKYU);
game.override.starterForms({
[Species.MIMIKYU]: bustedForm
});
await game.startBattle();
const mimikyu = game.scene.getPlayerPokemon()!;
expect(mimikyu.formIndex).toBe(bustedForm);
game.move.select(Moves.SPLASH);
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
await game.doKillOpponents();
await game.toNextWave();
[Fix] Refactor Disguise to work like Ice Face (#2684) * Fix typos in `src/data/egg.ts` comments * Refactor Disguise using Ice Face as a base i18n { Co-authored-by: Arxxer <javiptn7@gmail.com> Co-authored-by: GoldTra <162721984+GoldTra@users.noreply.github.com> Co-authored-by: sodam <66295123+sodaMelon@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: mercurius-00 <80205689+mercurius-00@users.noreply.github.com> } Update tests * Update jsdoc * Make recoil damage a parameter * Fix Ice Face i18n parameter name * Add i18n placeholder strings for translation * Update disguise test with override helper functions * Move a form change from `battle-scene.ts` to `ability.ts` * Remove a bit of obsolete code from the Disguise test * Add some translations Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> * Add translation placeholder strings for Japanese and Catalan * Update for strict-null * Remove unused parameter from the `BattlerTag` class * Remove species checks, fusion doesn't seem to be an issue (any more?) * Move Ice Face weather-based code to a subclass * Condense conditionals Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-08-12 03:52:39 -07:00
expect(mimikyu.formIndex).toBe(disguisedForm);
}, TIMEOUT);
it("reverts to Disguised form on biome change when fainted", async () => {
game.override.startingWave(10);
game.override.starterSpecies(0);
game.override.starterForms({
[Species.MIMIKYU]: bustedForm
});
await game.startBattle([Species.MIMIKYU, Species.FURRET]);
const mimikyu1 = game.scene.getPlayerPokemon()!;
expect(mimikyu1.formIndex).toBe(bustedForm);
game.move.select(Moves.SPLASH);
await game.killPokemon(mimikyu1);
game.doSelectPartyPokemon(1);
await game.toNextTurn();
game.move.select(Moves.SPLASH);
await game.doKillOpponents();
game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => { // TODO: Make tests run in set mode instead of switch mode
game.setMode(Mode.MESSAGE);
game.endPhase();
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase));
game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => {
game.setMode(Mode.MESSAGE);
game.endPhase();
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase));
await game.phaseInterceptor.to("PartyHealPhase");
expect(mimikyu1.formIndex).toBe(disguisedForm);
}, TIMEOUT);
});