@@ -3,6 +3,8 @@ import Phaser from "phaser";
3
3
import GameManager from "#app/test/utils/gameManager" ;
4
4
import overrides from "#app/overrides" ;
5
5
import { Species } from "#enums/species" ;
6
+ import { Gender } from "../../data/gender" ;
7
+ import { PokeballType } from "../../data/pokeball" ;
6
8
import {
7
9
TurnEndPhase ,
8
10
} from "#app/phases" ;
@@ -61,7 +63,16 @@ describe("Abilities - Illusion", () => {
61
63
expect ( zoroark . illusion . active ) . equals ( false ) ;
62
64
} ) ;
63
65
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 ( ) => {
65
76
vi . spyOn ( overrides , "OPP_MOVESET_OVERRIDE" , "get" ) . mockReturnValue ( [ Moves . FLAMETHROWER , Moves . PSYCHIC , Moves . TACKLE , Moves . TACKLE ] ) ;
66
77
await game . startBattle ( [ Species . ZOROARK , Species . AXEW ] ) ;
67
78
@@ -74,15 +85,6 @@ describe("Abilities - Illusion", () => {
74
85
expect ( psychicEffectiveness ) . above ( flameThwowerEffectiveness ) ;
75
86
} ) ;
76
87
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
-
86
88
it ( "do not disappear if the pokemon takes indirect damages" , async ( ) => {
87
89
vi . spyOn ( overrides , "OPP_SPECIES_OVERRIDE" , "get" ) . mockReturnValue ( Species . GIGALITH ) ;
88
90
vi . spyOn ( overrides , "OPP_ABILITY_OVERRIDE" , "get" ) . mockReturnValue ( Abilities . SAND_STREAM ) ;
@@ -100,20 +102,26 @@ describe("Abilities - Illusion", () => {
100
102
expect ( zoroark . illusion . active ) . equals ( true ) ;
101
103
} ) ;
102
104
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 ( ) => {
104
106
vi . spyOn ( overrides , "OPP_MOVESET_OVERRIDE" , "get" ) . mockReturnValue ( [ Moves . SCARY_FACE , Moves . SCARY_FACE , Moves . SCARY_FACE , Moves . SCARY_FACE ] ) ;
105
107
106
108
await game . startBattle ( [ Species . ABRA , Species . ZOROARK , Species . AXEW ] ) ;
107
109
108
110
const axew = game . scene . getParty ( ) . at ( 2 ) ;
109
111
axew . shiny = true ;
112
+ axew . nickname = btoa ( unescape ( encodeURIComponent ( "axew nickname" ) ) ) ;
113
+ axew . gender = Gender . FEMALE ;
114
+ axew . pokeball = PokeballType . GREAT_BALL ;
110
115
111
116
game . doSwitchPokemon ( 1 ) ;
112
117
113
118
await game . phaseInterceptor . to ( TurnEndPhase ) ;
114
119
115
120
const zoroark = game . scene . getPlayerPokemon ( ) ;
116
121
expect ( zoroark . name ) . equals ( "Axew" ) ;
122
+ expect ( zoroark . getNameToRender ( ) ) . equals ( "axew nickname" ) ;
123
+ expect ( zoroark . getGender ( false , true ) ) . equals ( Gender . FEMALE ) ;
117
124
expect ( zoroark . isShiny ( true ) ) . equals ( true ) ;
125
+ expect ( zoroark . illusion . pokeball ) . equals ( PokeballType . GREAT_BALL ) ;
118
126
} ) ;
119
127
} ) ;
0 commit comments