Skip to content

Commit 200fa5b

Browse files
committed
update illusion test
1 parent 348a449 commit 200fa5b

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

src/test/abilities/illusion.test.ts

+19-11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import Phaser from "phaser";
33
import GameManager from "#app/test/utils/gameManager";
44
import overrides from "#app/overrides";
55
import { Species } from "#enums/species";
6+
import { Gender } from "../../data/gender";
7+
import { PokeballType } from "../../data/pokeball";
68
import {
79
TurnEndPhase,
810
} from "#app/phases";
@@ -61,7 +63,16 @@ describe("Abilities - Illusion", () => {
6163
expect(zoroark.illusion.active).equals(false);
6264
});
6365

64-
it("trick the enemy", async () => {
66+
it("disappear if the ability is suppressed", async () => {
67+
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NEUTRALIZING_GAS);
68+
await game.startBattle([Species.KOFFING]);
69+
70+
const zorua = game.scene.getEnemyPokemon();
71+
72+
expect(zorua.illusion.active).equals(false);
73+
});
74+
75+
it("trick the enemy AI", async () => {
6576
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.FLAMETHROWER, Moves.PSYCHIC, Moves.TACKLE, Moves.TACKLE]);
6677
await game.startBattle([Species.ZOROARK, Species.AXEW]);
6778

@@ -74,15 +85,6 @@ describe("Abilities - Illusion", () => {
7485
expect(psychicEffectiveness).above(flameThwowerEffectiveness);
7586
});
7687

77-
it("disappear if the ability is suppressed", async () => {
78-
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NEUTRALIZING_GAS);
79-
await game.startBattle([Species.KOFFING]);
80-
81-
const zorua = game.scene.getEnemyPokemon();
82-
83-
expect(zorua.illusion.active).equals(false);
84-
});
85-
8688
it("do not disappear if the pokemon takes indirect damages", async () => {
8789
vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.GIGALITH);
8890
vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SAND_STREAM);
@@ -100,20 +102,26 @@ describe("Abilities - Illusion", () => {
100102
expect(zoroark.illusion.active).equals(true);
101103
});
102104

103-
it("copy the shininess of the pokemon", async () => {
105+
it("copy the the name, the nickname, the gender, the shininess and the pokeball of the pokemon", async () => {
104106
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SCARY_FACE, Moves.SCARY_FACE, Moves.SCARY_FACE, Moves.SCARY_FACE]);
105107

106108
await game.startBattle([Species.ABRA, Species.ZOROARK, Species.AXEW]);
107109

108110
const axew = game.scene.getParty().at(2);
109111
axew.shiny = true;
112+
axew.nickname = btoa(unescape(encodeURIComponent("axew nickname")));
113+
axew.gender = Gender.FEMALE;
114+
axew.pokeball = PokeballType.GREAT_BALL;
110115

111116
game.doSwitchPokemon(1);
112117

113118
await game.phaseInterceptor.to(TurnEndPhase);
114119

115120
const zoroark = game.scene.getPlayerPokemon();
116121
expect(zoroark.name).equals("Axew");
122+
expect(zoroark.getNameToRender()).equals("axew nickname");
123+
expect(zoroark.getGender(false, true)).equals(Gender.FEMALE);
117124
expect(zoroark.isShiny(true)).equals(true);
125+
expect(zoroark.illusion.pokeball).equals(PokeballType.GREAT_BALL);
118126
});
119127
});

0 commit comments

Comments
 (0)