-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Move][Ability] Fully Implement Forest's Curse / Trick Or Treat / Mim…
…icry (#4682) * addedType variable * basic mimicry implementation * eslint * rage * quick change * made files * added mimicry activation message * test for moves done * hahahhaha * done? for now? * laklhaflhasd * Apply suggestions from code review Co-authored-by: NightKev <[email protected]> * time to start... ughhh * reflect type * Added new message * Update src/field/pokemon.ts Co-authored-by: PigeonBar <[email protected]> * Update src/data/ability.ts Co-authored-by: flx-sta <[email protected]> * added overrides * some checks * removed comments * Apply suggestions from code review Co-authored-by: NightKev <[email protected]> --------- Co-authored-by: frutescens <info@laptop> Co-authored-by: NightKev <[email protected]> Co-authored-by: PigeonBar <[email protected]> Co-authored-by: flx-sta <[email protected]>
- Loading branch information
1 parent
38a6bf0
commit fb2d3e4
Showing
8 changed files
with
350 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import { Abilities } from "#enums/abilities"; | ||
import { Moves } from "#enums/moves"; | ||
import { Species } from "#enums/species"; | ||
import { Type } from "#app/data/type"; | ||
import GameManager from "#test/utils/gameManager"; | ||
import Phaser from "phaser"; | ||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; | ||
|
||
describe("Abilities - Mimicry", () => { | ||
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 | ||
.moveset([ Moves.SPLASH ]) | ||
.ability(Abilities.MIMICRY) | ||
.battleType("single") | ||
.disableCrits() | ||
.enemySpecies(Species.MAGIKARP) | ||
.enemyMoveset(Moves.SPLASH); | ||
}); | ||
|
||
it("Mimicry activates after the Pokémon with Mimicry is switched in while terrain is present, or whenever there is a change in terrain", async () => { | ||
game.override.enemyAbility(Abilities.MISTY_SURGE); | ||
await game.classicMode.startBattle([ Species.FEEBAS, Species.ABRA ]); | ||
|
||
const [ playerPokemon1, playerPokemon2 ] = game.scene.getParty(); | ||
game.move.select(Moves.SPLASH); | ||
await game.toNextTurn(); | ||
expect(playerPokemon1.getTypes().includes(Type.FAIRY)).toBe(true); | ||
|
||
game.doSwitchPokemon(1); | ||
await game.toNextTurn(); | ||
|
||
expect(playerPokemon2.getTypes().includes(Type.FAIRY)).toBe(true); | ||
}); | ||
|
||
it("Pokemon should revert back to its original, root type once terrain ends", async () => { | ||
game.override | ||
.moveset([ Moves.SPLASH, Moves.TRANSFORM ]) | ||
.enemyAbility(Abilities.MIMICRY) | ||
.enemyMoveset([ Moves.SPLASH, Moves.PSYCHIC_TERRAIN ]); | ||
await game.classicMode.startBattle([ Species.REGIELEKI ]); | ||
|
||
const playerPokemon = game.scene.getPlayerPokemon(); | ||
game.move.select(Moves.TRANSFORM); | ||
await game.forceEnemyMove(Moves.PSYCHIC_TERRAIN); | ||
await game.toNextTurn(); | ||
expect(playerPokemon?.getTypes().includes(Type.PSYCHIC)).toBe(true); | ||
|
||
if (game.scene.arena.terrain) { | ||
game.scene.arena.terrain.turnsLeft = 1; | ||
} | ||
|
||
game.move.select(Moves.SPLASH); | ||
await game.forceEnemyMove(Moves.SPLASH); | ||
await game.toNextTurn(); | ||
expect(playerPokemon?.getTypes().includes(Type.ELECTRIC)).toBe(true); | ||
}); | ||
|
||
it("If the Pokemon is under the effect of a type-adding move and an equivalent terrain activates, the move's effect disappears", async () => { | ||
game.override | ||
.enemyMoveset([ Moves.FORESTS_CURSE, Moves.GRASSY_TERRAIN ]); | ||
await game.classicMode.startBattle([ Species.FEEBAS ]); | ||
|
||
const playerPokemon = game.scene.getPlayerPokemon(); | ||
game.move.select(Moves.SPLASH); | ||
await game.forceEnemyMove(Moves.FORESTS_CURSE); | ||
await game.toNextTurn(); | ||
|
||
expect(playerPokemon?.summonData.addedType).toBe(Type.GRASS); | ||
|
||
game.move.select(Moves.SPLASH); | ||
await game.forceEnemyMove(Moves.GRASSY_TERRAIN); | ||
await game.phaseInterceptor.to("TurnEndPhase"); | ||
|
||
expect(playerPokemon?.summonData.addedType).toBeNull(); | ||
expect(playerPokemon?.getTypes().includes(Type.GRASS)).toBe(true); | ||
}); | ||
}); |
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,47 @@ | ||
import { Abilities } from "#enums/abilities"; | ||
import { Moves } from "#enums/moves"; | ||
import { Species } from "#enums/species"; | ||
import { Type } from "#app/data/type"; | ||
import GameManager from "#test/utils/gameManager"; | ||
import Phaser from "phaser"; | ||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; | ||
|
||
describe("Moves - Forest's Curse", () => { | ||
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 | ||
.moveset([ Moves.FORESTS_CURSE, Moves.TRICK_OR_TREAT ]) | ||
.ability(Abilities.BALL_FETCH) | ||
.battleType("single") | ||
.disableCrits() | ||
.enemySpecies(Species.MAGIKARP) | ||
.enemyAbility(Abilities.BALL_FETCH) | ||
.enemyMoveset(Moves.SPLASH); | ||
}); | ||
|
||
it("will replace the added type from Trick Or Treat", async () => { | ||
await game.classicMode.startBattle([ Species.FEEBAS ]); | ||
|
||
const enemyPokemon = game.scene.getEnemyPokemon(); | ||
game.move.select(Moves.TRICK_OR_TREAT); | ||
await game.phaseInterceptor.to("TurnEndPhase"); | ||
expect(enemyPokemon!.summonData.addedType).toBe(Type.GHOST); | ||
|
||
game.move.select(Moves.FORESTS_CURSE); | ||
await game.phaseInterceptor.to("TurnEndPhase"); | ||
expect(enemyPokemon?.summonData.addedType).toBe(Type.GRASS); | ||
}); | ||
}); |
Oops, something went wrong.