forked from pagefaultgames/pokerogue
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bug] Fix move Chilly Reception (pagefaultgames#3198)
Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: Jannik Tappert <38758606+CodeTappert@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> Co-authored-by: returntoice <dieandbecome@gmail.com> Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com> Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> Co-authored-by: protimita <protimitajp@gmail.com> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: Chapybara-jp <charlie.beer@hotmail.com>
- Loading branch information
1 parent
f2fe430
commit c387f49
Showing
11 changed files
with
100 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { Abilities } from "#app/enums/abilities"; | ||
import { Moves } from "#enums/moves"; | ||
import { Species } from "#enums/species"; | ||
import { WeatherType } from "#enums/weather-type"; | ||
import GameManager from "#test/utils/gameManager"; | ||
import Phaser from "phaser"; | ||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; | ||
|
||
const TIMEOUT = 20 * 1000; | ||
|
||
describe("Moves - Chilly Reception", () => { | ||
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") | ||
.moveset([Moves.CHILLY_RECEPTION, Moves.SNOWSCAPE]) | ||
.enemyMoveset(Array(4).fill(Moves.SPLASH)) | ||
.enemyAbility(Abilities.NONE) | ||
.ability(Abilities.NONE); | ||
|
||
}); | ||
|
||
it("should still change the weather if user can't switch out", async () => { | ||
await game.classicMode.startBattle([Species.SLOWKING]); | ||
|
||
game.move.select(Moves.CHILLY_RECEPTION); | ||
|
||
await game.phaseInterceptor.to("BerryPhase", false); | ||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.SNOW); | ||
}, TIMEOUT); | ||
|
||
it("should switch out even if it's snowing", async () => { | ||
await game.classicMode.startBattle([Species.SLOWKING, Species.MEOWTH]); | ||
// first turn set up snow with snowscape, try chilly reception on second turn | ||
game.move.select(Moves.SNOWSCAPE); | ||
await game.phaseInterceptor.to("BerryPhase", false); | ||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.SNOW); | ||
|
||
await game.phaseInterceptor.to("TurnInitPhase", false); | ||
game.move.select(Moves.CHILLY_RECEPTION); | ||
game.doSelectPartyPokemon(1); | ||
|
||
await game.phaseInterceptor.to("BerryPhase", false); | ||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.SNOW); | ||
expect(game.scene.getPlayerField()[0].species.speciesId).toBe(Species.MEOWTH); | ||
}, TIMEOUT); | ||
|
||
it("happy case - switch out and weather changes", async () => { | ||
|
||
await game.classicMode.startBattle([Species.SLOWKING, Species.MEOWTH]); | ||
|
||
game.move.select(Moves.CHILLY_RECEPTION); | ||
game.doSelectPartyPokemon(1); | ||
|
||
await game.phaseInterceptor.to("BerryPhase", false); | ||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.SNOW); | ||
expect(game.scene.getPlayerField()[0].species.speciesId).toBe(Species.MEOWTH); | ||
}, TIMEOUT); | ||
}); |