mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 15:32:18 +02:00
Removed game.startBattle
This commit is contained in:
parent
ff6f9131ae
commit
e30794f491
@ -39,7 +39,7 @@ describe("Abilities - Battery", () => {
|
|||||||
|
|
||||||
vi.spyOn(moveToCheck, "calculateBattlePower");
|
vi.spyOn(moveToCheck, "calculateBattlePower");
|
||||||
|
|
||||||
await game.startBattle([Species.PIKACHU, Species.CHARJABUG]);
|
await game.classicMode.startBattle([Species.PIKACHU, Species.CHARJABUG]);
|
||||||
|
|
||||||
game.move.select(Moves.DAZZLING_GLEAM);
|
game.move.select(Moves.DAZZLING_GLEAM);
|
||||||
game.move.select(Moves.SPLASH, 1);
|
game.move.select(Moves.SPLASH, 1);
|
||||||
@ -54,7 +54,7 @@ describe("Abilities - Battery", () => {
|
|||||||
|
|
||||||
vi.spyOn(moveToCheck, "calculateBattlePower");
|
vi.spyOn(moveToCheck, "calculateBattlePower");
|
||||||
|
|
||||||
await game.startBattle([Species.PIKACHU, Species.CHARJABUG]);
|
await game.classicMode.startBattle([Species.PIKACHU, Species.CHARJABUG]);
|
||||||
|
|
||||||
game.move.select(Moves.BREAKING_SWIPE);
|
game.move.select(Moves.BREAKING_SWIPE);
|
||||||
game.move.select(Moves.SPLASH, 1);
|
game.move.select(Moves.SPLASH, 1);
|
||||||
@ -69,7 +69,7 @@ describe("Abilities - Battery", () => {
|
|||||||
|
|
||||||
vi.spyOn(moveToCheck, "calculateBattlePower");
|
vi.spyOn(moveToCheck, "calculateBattlePower");
|
||||||
|
|
||||||
await game.startBattle([Species.CHARJABUG, Species.PIKACHU]);
|
await game.classicMode.startBattle([Species.CHARJABUG, Species.PIKACHU]);
|
||||||
|
|
||||||
game.move.select(Moves.DAZZLING_GLEAM);
|
game.move.select(Moves.DAZZLING_GLEAM);
|
||||||
game.move.select(Moves.SPLASH, 1);
|
game.move.select(Moves.SPLASH, 1);
|
||||||
|
@ -33,7 +33,7 @@ describe("Abilities - COSTAR", () => {
|
|||||||
test("ability copies positive stat stages", async () => {
|
test("ability copies positive stat stages", async () => {
|
||||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]);
|
||||||
|
|
||||||
let [leftPokemon, rightPokemon] = game.scene.getPlayerField();
|
let [leftPokemon, rightPokemon] = game.scene.getPlayerField();
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ describe("Abilities - COSTAR", () => {
|
|||||||
test("ability copies negative stat stages", async () => {
|
test("ability copies negative stat stages", async () => {
|
||||||
game.override.enemyAbility(Abilities.INTIMIDATE);
|
game.override.enemyAbility(Abilities.INTIMIDATE);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]);
|
||||||
|
|
||||||
let [leftPokemon, rightPokemon] = game.scene.getPlayerField();
|
let [leftPokemon, rightPokemon] = game.scene.getPlayerField();
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ describe("Abilities - Forecast", () => {
|
|||||||
*/
|
*/
|
||||||
const testWeatherFormChange = async (game: GameManager, weather: WeatherType, form: number, initialForm?: number) => {
|
const testWeatherFormChange = async (game: GameManager, weather: WeatherType, form: number, initialForm?: number) => {
|
||||||
game.override.weather(weather).starterForms({ [Species.CASTFORM]: initialForm });
|
game.override.weather(weather).starterForms({ [Species.CASTFORM]: initialForm });
|
||||||
await game.startBattle([Species.CASTFORM]);
|
await game.classicMode.startBattle([Species.CASTFORM]);
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ describe("Abilities - Forecast", () => {
|
|||||||
*/
|
*/
|
||||||
const testRevertFormAgainstAbility = async (game: GameManager, ability: Abilities) => {
|
const testRevertFormAgainstAbility = async (game: GameManager, ability: Abilities) => {
|
||||||
game.override.starterForms({ [Species.CASTFORM]: SUNNY_FORM }).enemyAbility(ability);
|
game.override.starterForms({ [Species.CASTFORM]: SUNNY_FORM }).enemyAbility(ability);
|
||||||
await game.startBattle([Species.CASTFORM]);
|
await game.classicMode.startBattle([Species.CASTFORM]);
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ describe("Abilities - Forecast", () => {
|
|||||||
[Species.GROUDON]: 1,
|
[Species.GROUDON]: 1,
|
||||||
[Species.RAYQUAZA]: 1,
|
[Species.RAYQUAZA]: 1,
|
||||||
});
|
});
|
||||||
await game.startBattle([
|
await game.classicMode.startBattle([
|
||||||
Species.CASTFORM,
|
Species.CASTFORM,
|
||||||
Species.FEEBAS,
|
Species.FEEBAS,
|
||||||
Species.KYOGRE,
|
Species.KYOGRE,
|
||||||
@ -201,7 +201,7 @@ describe("Abilities - Forecast", () => {
|
|||||||
|
|
||||||
it("has no effect on Pokémon other than Castform", async () => {
|
it("has no effect on Pokémon other than Castform", async () => {
|
||||||
game.override.enemyAbility(Abilities.FORECAST).enemySpecies(Species.SHUCKLE);
|
game.override.enemyAbility(Abilities.FORECAST).enemySpecies(Species.SHUCKLE);
|
||||||
await game.startBattle([Species.CASTFORM]);
|
await game.classicMode.startBattle([Species.CASTFORM]);
|
||||||
|
|
||||||
game.move.select(Moves.RAIN_DANCE);
|
game.move.select(Moves.RAIN_DANCE);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to(TurnEndPhase);
|
||||||
@ -212,7 +212,7 @@ describe("Abilities - Forecast", () => {
|
|||||||
|
|
||||||
it("reverts to Normal Form when Forecast is suppressed, changes form to match the weather when it regains it", async () => {
|
it("reverts to Normal Form when Forecast is suppressed, changes form to match the weather when it regains it", async () => {
|
||||||
game.override.enemyMoveset([Moves.GASTRO_ACID]).weather(WeatherType.RAIN);
|
game.override.enemyMoveset([Moves.GASTRO_ACID]).weather(WeatherType.RAIN);
|
||||||
await game.startBattle([Species.CASTFORM, Species.PIKACHU]);
|
await game.classicMode.startBattle([Species.CASTFORM, Species.PIKACHU]);
|
||||||
const castform = game.scene.getPlayerPokemon()!;
|
const castform = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
expect(castform.formIndex).toBe(RAINY_FORM);
|
expect(castform.formIndex).toBe(RAINY_FORM);
|
||||||
@ -243,7 +243,7 @@ describe("Abilities - Forecast", () => {
|
|||||||
|
|
||||||
it("does not change Castform's form until after Stealth Rock deals damage", async () => {
|
it("does not change Castform's form until after Stealth Rock deals damage", async () => {
|
||||||
game.override.weather(WeatherType.RAIN).enemyMoveset([Moves.STEALTH_ROCK]);
|
game.override.weather(WeatherType.RAIN).enemyMoveset([Moves.STEALTH_ROCK]);
|
||||||
await game.startBattle([Species.PIKACHU, Species.CASTFORM]);
|
await game.classicMode.startBattle([Species.PIKACHU, Species.CASTFORM]);
|
||||||
|
|
||||||
// First turn - set up stealth rock
|
// First turn - set up stealth rock
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
@ -267,7 +267,7 @@ describe("Abilities - Forecast", () => {
|
|||||||
it("should be in Normal Form after the user is switched out", async () => {
|
it("should be in Normal Form after the user is switched out", async () => {
|
||||||
game.override.weather(WeatherType.RAIN);
|
game.override.weather(WeatherType.RAIN);
|
||||||
|
|
||||||
await game.startBattle([Species.CASTFORM, Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.CASTFORM, Species.MAGIKARP]);
|
||||||
const castform = game.scene.getPlayerPokemon()!;
|
const castform = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
expect(castform.formIndex).toBe(RAINY_FORM);
|
expect(castform.formIndex).toBe(RAINY_FORM);
|
||||||
|
@ -38,7 +38,7 @@ describe("Abilities - Heatproof", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("reduces Fire type damage by half", async () => {
|
it("reduces Fire type damage by half", async () => {
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
const initialHP = 1000;
|
const initialHP = 1000;
|
||||||
@ -61,7 +61,7 @@ describe("Abilities - Heatproof", () => {
|
|||||||
|
|
||||||
it("reduces Burn damage by half", async () => {
|
it("reduces Burn damage by half", async () => {
|
||||||
game.override.enemyStatusEffect(StatusEffect.BURN).enemySpecies(Species.ABRA);
|
game.override.enemyStatusEffect(StatusEffect.BURN).enemySpecies(Species.ABRA);
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ describe("Abilities - Hyper Cutter", () => {
|
|||||||
// Reference Link: https://bulbapedia.bulbagarden.net/wiki/Hyper_Cutter_(Ability)
|
// Reference Link: https://bulbapedia.bulbagarden.net/wiki/Hyper_Cutter_(Ability)
|
||||||
|
|
||||||
it("only prevents ATK drops", async () => {
|
it("only prevents ATK drops", async () => {
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ describe("Abilities - Libero", () => {
|
|||||||
test("ability applies and changes a pokemon's type", async () => {
|
test("ability applies and changes a pokemon's type", async () => {
|
||||||
game.override.moveset([Moves.SPLASH]);
|
game.override.moveset([Moves.SPLASH]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -54,7 +54,7 @@ describe("Abilities - Libero", () => {
|
|||||||
test.skip("ability applies only once per switch in", async () => {
|
test.skip("ability applies only once per switch in", async () => {
|
||||||
game.override.moveset([Moves.SPLASH, Moves.AGILITY]);
|
game.override.moveset([Moves.SPLASH, Moves.AGILITY]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP, Species.BULBASAUR]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.BULBASAUR]);
|
||||||
|
|
||||||
let leadPokemon = game.scene.getPlayerPokemon()!;
|
let leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -90,7 +90,7 @@ describe("Abilities - Libero", () => {
|
|||||||
test("ability applies correctly even if the pokemon's move has a variable type", async () => {
|
test("ability applies correctly even if the pokemon's move has a variable type", async () => {
|
||||||
game.override.moveset([Moves.WEATHER_BALL]);
|
game.override.moveset([Moves.WEATHER_BALL]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -110,7 +110,7 @@ describe("Abilities - Libero", () => {
|
|||||||
game.override.moveset([Moves.TACKLE]);
|
game.override.moveset([Moves.TACKLE]);
|
||||||
game.override.passiveAbility(Abilities.REFRIGERATE);
|
game.override.passiveAbility(Abilities.REFRIGERATE);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -128,7 +128,7 @@ describe("Abilities - Libero", () => {
|
|||||||
test("ability applies correctly even if the pokemon's move calls another move", async () => {
|
test("ability applies correctly even if the pokemon's move calls another move", async () => {
|
||||||
game.override.moveset([Moves.NATURE_POWER]);
|
game.override.moveset([Moves.NATURE_POWER]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -143,7 +143,7 @@ describe("Abilities - Libero", () => {
|
|||||||
test("ability applies correctly even if the pokemon's move is delayed / charging", async () => {
|
test("ability applies correctly even if the pokemon's move is delayed / charging", async () => {
|
||||||
game.override.moveset([Moves.DIG]);
|
game.override.moveset([Moves.DIG]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -158,7 +158,7 @@ describe("Abilities - Libero", () => {
|
|||||||
game.override.moveset([Moves.TACKLE]);
|
game.override.moveset([Moves.TACKLE]);
|
||||||
game.override.enemyMoveset(Moves.SPLASH);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -176,7 +176,7 @@ describe("Abilities - Libero", () => {
|
|||||||
game.override.moveset([Moves.TACKLE]);
|
game.override.moveset([Moves.TACKLE]);
|
||||||
game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]);
|
game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -191,7 +191,7 @@ describe("Abilities - Libero", () => {
|
|||||||
game.override.moveset([Moves.TACKLE]);
|
game.override.moveset([Moves.TACKLE]);
|
||||||
game.override.enemySpecies(Species.GASTLY);
|
game.override.enemySpecies(Species.GASTLY);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -205,7 +205,7 @@ describe("Abilities - Libero", () => {
|
|||||||
test("ability is not applied if pokemon's type is the same as the move's type", async () => {
|
test("ability is not applied if pokemon's type is the same as the move's type", async () => {
|
||||||
game.override.moveset([Moves.SPLASH]);
|
game.override.moveset([Moves.SPLASH]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -220,7 +220,7 @@ describe("Abilities - Libero", () => {
|
|||||||
test("ability is not applied if pokemon is terastallized", async () => {
|
test("ability is not applied if pokemon is terastallized", async () => {
|
||||||
game.override.moveset([Moves.SPLASH]);
|
game.override.moveset([Moves.SPLASH]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -236,7 +236,7 @@ describe("Abilities - Libero", () => {
|
|||||||
test("ability is not applied if pokemon uses struggle", async () => {
|
test("ability is not applied if pokemon uses struggle", async () => {
|
||||||
game.override.moveset([Moves.STRUGGLE]);
|
game.override.moveset([Moves.STRUGGLE]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -250,7 +250,7 @@ describe("Abilities - Libero", () => {
|
|||||||
test("ability is not applied if the pokemon's move fails", async () => {
|
test("ability is not applied if the pokemon's move fails", async () => {
|
||||||
game.override.moveset([Moves.BURN_UP]);
|
game.override.moveset([Moves.BURN_UP]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -265,7 +265,7 @@ describe("Abilities - Libero", () => {
|
|||||||
game.override.moveset([Moves.TRICK_OR_TREAT]);
|
game.override.moveset([Moves.TRICK_OR_TREAT]);
|
||||||
game.override.enemySpecies(Species.GASTLY);
|
game.override.enemySpecies(Species.GASTLY);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -279,7 +279,7 @@ describe("Abilities - Libero", () => {
|
|||||||
test("ability applies correctly and the pokemon curses itself", async () => {
|
test("ability applies correctly and the pokemon curses itself", async () => {
|
||||||
game.override.moveset([Moves.CURSE]);
|
game.override.moveset([Moves.CURSE]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
|
@ -46,7 +46,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
it("ability should prevent damage caused by weather", async () => {
|
it("ability should prevent damage caused by weather", async () => {
|
||||||
game.override.weather(WeatherType.SANDSTORM);
|
game.override.weather(WeatherType.SANDSTORM);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
//Toxic keeps track of the turn counters -> important that Magic Guard keeps track of post-Toxic turns
|
//Toxic keeps track of the turn counters -> important that Magic Guard keeps track of post-Toxic turns
|
||||||
game.override.statusEffect(StatusEffect.POISON);
|
game.override.statusEffect(StatusEffect.POISON);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
game.override.enemyMoveset([Moves.WORRY_SEED, Moves.WORRY_SEED, Moves.WORRY_SEED, Moves.WORRY_SEED]);
|
game.override.enemyMoveset([Moves.WORRY_SEED, Moves.WORRY_SEED, Moves.WORRY_SEED, Moves.WORRY_SEED]);
|
||||||
game.override.statusEffect(StatusEffect.POISON);
|
game.override.statusEffect(StatusEffect.POISON);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
game.override.enemyStatusEffect(StatusEffect.BURN);
|
game.override.enemyStatusEffect(StatusEffect.BURN);
|
||||||
game.override.enemyAbility(Abilities.MAGIC_GUARD);
|
game.override.enemyAbility(Abilities.MAGIC_GUARD);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
game.override.enemyStatusEffect(StatusEffect.TOXIC);
|
game.override.enemyStatusEffect(StatusEffect.TOXIC);
|
||||||
game.override.enemyAbility(Abilities.MAGIC_GUARD);
|
game.override.enemyAbility(Abilities.MAGIC_GUARD);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
const newTag = getArenaTag(ArenaTagType.SPIKES, 5, Moves.SPIKES, 0, 0, ArenaTagSide.BOTH)!;
|
const newTag = getArenaTag(ArenaTagType.SPIKES, 5, Moves.SPIKES, 0, 0, ArenaTagSide.BOTH)!;
|
||||||
game.scene.arena.tags.push(newTag);
|
game.scene.arena.tags.push(newTag);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
@ -184,7 +184,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
game.scene.arena.tags.push(playerTag);
|
game.scene.arena.tags.push(playerTag);
|
||||||
game.scene.arena.tags.push(enemyTag);
|
game.scene.arena.tags.push(enemyTag);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
@ -206,7 +206,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("Magic Guard prevents against damage from volatile status effects", async () => {
|
it("Magic Guard prevents against damage from volatile status effects", async () => {
|
||||||
await game.startBattle([Species.DUSKULL]);
|
await game.classicMode.startBattle([Species.DUSKULL]);
|
||||||
game.override.moveset([Moves.CURSE]);
|
game.override.moveset([Moves.CURSE]);
|
||||||
game.override.enemyAbility(Abilities.MAGIC_GUARD);
|
game.override.enemyAbility(Abilities.MAGIC_GUARD);
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
|
|
||||||
it("Magic Guard prevents crash damage", async () => {
|
it("Magic Guard prevents crash damage", async () => {
|
||||||
game.override.moveset([Moves.HIGH_JUMP_KICK]);
|
game.override.moveset([Moves.HIGH_JUMP_KICK]);
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
|
|
||||||
it("Magic Guard prevents damage from recoil", async () => {
|
it("Magic Guard prevents damage from recoil", async () => {
|
||||||
game.override.moveset([Moves.TAKE_DOWN]);
|
game.override.moveset([Moves.TAKE_DOWN]);
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -266,7 +266,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
|
|
||||||
it("Magic Guard does not prevent damage from Struggle's recoil", async () => {
|
it("Magic Guard does not prevent damage from Struggle's recoil", async () => {
|
||||||
game.override.moveset([Moves.STRUGGLE]);
|
game.override.moveset([Moves.STRUGGLE]);
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
//This tests different move attributes than the recoil tests above
|
//This tests different move attributes than the recoil tests above
|
||||||
it("Magic Guard prevents self-damage from attacking moves", async () => {
|
it("Magic Guard prevents self-damage from attacking moves", async () => {
|
||||||
game.override.moveset([Moves.STEEL_BEAM]);
|
game.override.moveset([Moves.STEEL_BEAM]);
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -301,7 +301,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
it("Magic Guard does not prevent self-damage from confusion", async () => {
|
it("Magic Guard does not prevent self-damage from confusion", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
game.move.select(Moves.CHARM);
|
game.move.select(Moves.CHARM);
|
||||||
|
|
||||||
@ -311,7 +311,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
|
|
||||||
it("Magic Guard does not prevent self-damage from non-attacking moves", async () => {
|
it("Magic Guard does not prevent self-damage from non-attacking moves", async () => {
|
||||||
game.override.moveset([Moves.BELLY_DRUM]);
|
game.override.moveset([Moves.BELLY_DRUM]);
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -333,7 +333,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
game.override.enemyMoveset([Moves.SPORE, Moves.SPORE, Moves.SPORE, Moves.SPORE]);
|
game.override.enemyMoveset([Moves.SPORE, Moves.SPORE, Moves.SPORE, Moves.SPORE]);
|
||||||
game.override.enemyAbility(Abilities.BAD_DREAMS);
|
game.override.enemyAbility(Abilities.BAD_DREAMS);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -355,7 +355,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
game.override.moveset([Moves.TACKLE]);
|
game.override.moveset([Moves.TACKLE]);
|
||||||
game.override.enemyAbility(Abilities.AFTERMATH);
|
game.override.enemyAbility(Abilities.AFTERMATH);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -379,7 +379,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
game.override.moveset([Moves.TACKLE]);
|
game.override.moveset([Moves.TACKLE]);
|
||||||
game.override.enemyAbility(Abilities.IRON_BARBS);
|
game.override.enemyAbility(Abilities.IRON_BARBS);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -402,7 +402,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
game.override.moveset([Moves.ABSORB]);
|
game.override.moveset([Moves.ABSORB]);
|
||||||
game.override.enemyAbility(Abilities.LIQUID_OOZE);
|
game.override.enemyAbility(Abilities.LIQUID_OOZE);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -425,7 +425,7 @@ describe("Abilities - Magic Guard", () => {
|
|||||||
game.override.passiveAbility(Abilities.SOLAR_POWER);
|
game.override.passiveAbility(Abilities.SOLAR_POWER);
|
||||||
game.override.weather(WeatherType.SUNNY);
|
game.override.weather(WeatherType.SUNNY);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to(TurnEndPhase);
|
||||||
|
@ -38,7 +38,7 @@ describe("Abilities - Moxie", () => {
|
|||||||
|
|
||||||
it("should raise ATK stat stage by 1 when winning a battle", async () => {
|
it("should raise ATK stat stage by 1 when winning a battle", async () => {
|
||||||
const moveToUse = Moves.AERIAL_ACE;
|
const moveToUse = Moves.AERIAL_ACE;
|
||||||
await game.startBattle([Species.MIGHTYENA, Species.MIGHTYENA]);
|
await game.classicMode.startBattle([Species.MIGHTYENA, Species.MIGHTYENA]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ describe("Abilities - Moxie", () => {
|
|||||||
async () => {
|
async () => {
|
||||||
game.override.battleStyle("double");
|
game.override.battleStyle("double");
|
||||||
const moveToUse = Moves.AERIAL_ACE;
|
const moveToUse = Moves.AERIAL_ACE;
|
||||||
await game.startBattle([Species.MIGHTYENA, Species.MIGHTYENA]);
|
await game.classicMode.startBattle([Species.MIGHTYENA, Species.MIGHTYENA]);
|
||||||
|
|
||||||
const [firstPokemon, secondPokemon] = game.scene.getPlayerField();
|
const [firstPokemon, secondPokemon] = game.scene.getPlayerField();
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ describe("Abilities - Mycelium Might", () => {
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
it("will move last in its priority bracket and ignore protective abilities", async () => {
|
it("will move last in its priority bracket and ignore protective abilities", async () => {
|
||||||
await game.startBattle([Species.REGIELEKI]);
|
await game.classicMode.startBattle([Species.REGIELEKI]);
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||||
const playerIndex = game.scene.getPlayerPokemon()?.getBattlerIndex();
|
const playerIndex = game.scene.getPlayerPokemon()?.getBattlerIndex();
|
||||||
@ -65,7 +65,7 @@ describe("Abilities - Mycelium Might", () => {
|
|||||||
|
|
||||||
it("will still go first if a status move that is in a higher priority bracket than the opponent's move is used", async () => {
|
it("will still go first if a status move that is in a higher priority bracket than the opponent's move is used", async () => {
|
||||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||||
await game.startBattle([Species.REGIELEKI]);
|
await game.classicMode.startBattle([Species.REGIELEKI]);
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||||
const playerIndex = game.scene.getPlayerPokemon()?.getBattlerIndex();
|
const playerIndex = game.scene.getPlayerPokemon()?.getBattlerIndex();
|
||||||
@ -87,7 +87,7 @@ describe("Abilities - Mycelium Might", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("will not affect non-status moves", async () => {
|
it("will not affect non-status moves", async () => {
|
||||||
await game.startBattle([Species.REGIELEKI]);
|
await game.classicMode.startBattle([Species.REGIELEKI]);
|
||||||
|
|
||||||
const playerIndex = game.scene.getPlayerPokemon()!.getBattlerIndex();
|
const playerIndex = game.scene.getPlayerPokemon()!.getBattlerIndex();
|
||||||
const enemyIndex = game.scene.getEnemyPokemon()!.getBattlerIndex();
|
const enemyIndex = game.scene.getEnemyPokemon()!.getBattlerIndex();
|
||||||
|
@ -34,7 +34,7 @@ describe("Abilities - Pastel Veil", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("prevents the user and its allies from being afflicted by poison", async () => {
|
it("prevents the user and its allies from being afflicted by poison", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP, Species.GALAR_PONYTA]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.GALAR_PONYTA]);
|
||||||
const ponyta = game.scene.getPlayerField()[1];
|
const ponyta = game.scene.getPlayerField()[1];
|
||||||
const magikarp = game.scene.getPlayerField()[0];
|
const magikarp = game.scene.getPlayerField()[0];
|
||||||
ponyta.abilityIndex = 1;
|
ponyta.abilityIndex = 1;
|
||||||
@ -50,7 +50,7 @@ describe("Abilities - Pastel Veil", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("it heals the poisoned status condition of allies if user is sent out into battle", async () => {
|
it("it heals the poisoned status condition of allies if user is sent out into battle", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP, Species.FEEBAS, Species.GALAR_PONYTA]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS, Species.GALAR_PONYTA]);
|
||||||
const ponyta = game.scene.getPlayerParty()[2];
|
const ponyta = game.scene.getPlayerParty()[2];
|
||||||
const magikarp = game.scene.getPlayerField()[0];
|
const magikarp = game.scene.getPlayerField()[0];
|
||||||
ponyta.abilityIndex = 1;
|
ponyta.abilityIndex = 1;
|
||||||
|
@ -39,7 +39,7 @@ describe("Abilities - Power Spot", () => {
|
|||||||
|
|
||||||
vi.spyOn(moveToCheck, "calculateBattlePower");
|
vi.spyOn(moveToCheck, "calculateBattlePower");
|
||||||
|
|
||||||
await game.startBattle([Species.REGIELEKI, Species.STONJOURNER]);
|
await game.classicMode.startBattle([Species.REGIELEKI, Species.STONJOURNER]);
|
||||||
game.move.select(Moves.DAZZLING_GLEAM);
|
game.move.select(Moves.DAZZLING_GLEAM);
|
||||||
game.move.select(Moves.SPLASH, 1);
|
game.move.select(Moves.SPLASH, 1);
|
||||||
await game.phaseInterceptor.to(MoveEffectPhase);
|
await game.phaseInterceptor.to(MoveEffectPhase);
|
||||||
@ -53,7 +53,7 @@ describe("Abilities - Power Spot", () => {
|
|||||||
|
|
||||||
vi.spyOn(moveToCheck, "calculateBattlePower");
|
vi.spyOn(moveToCheck, "calculateBattlePower");
|
||||||
|
|
||||||
await game.startBattle([Species.REGIELEKI, Species.STONJOURNER]);
|
await game.classicMode.startBattle([Species.REGIELEKI, Species.STONJOURNER]);
|
||||||
game.move.select(Moves.BREAKING_SWIPE);
|
game.move.select(Moves.BREAKING_SWIPE);
|
||||||
game.move.select(Moves.SPLASH, 1);
|
game.move.select(Moves.SPLASH, 1);
|
||||||
await game.phaseInterceptor.to(MoveEffectPhase);
|
await game.phaseInterceptor.to(MoveEffectPhase);
|
||||||
@ -67,7 +67,7 @@ describe("Abilities - Power Spot", () => {
|
|||||||
|
|
||||||
vi.spyOn(moveToCheck, "calculateBattlePower");
|
vi.spyOn(moveToCheck, "calculateBattlePower");
|
||||||
|
|
||||||
await game.startBattle([Species.STONJOURNER, Species.REGIELEKI]);
|
await game.classicMode.startBattle([Species.STONJOURNER, Species.REGIELEKI]);
|
||||||
game.move.select(Moves.BREAKING_SWIPE);
|
game.move.select(Moves.BREAKING_SWIPE);
|
||||||
game.move.select(Moves.SPLASH, 1);
|
game.move.select(Moves.SPLASH, 1);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to(TurnEndPhase);
|
||||||
|
@ -39,7 +39,7 @@ describe("Abilities - Protean", () => {
|
|||||||
test("ability applies and changes a pokemon's type", async () => {
|
test("ability applies and changes a pokemon's type", async () => {
|
||||||
game.override.moveset([Moves.SPLASH]);
|
game.override.moveset([Moves.SPLASH]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -54,7 +54,7 @@ describe("Abilities - Protean", () => {
|
|||||||
test.skip("ability applies only once per switch in", async () => {
|
test.skip("ability applies only once per switch in", async () => {
|
||||||
game.override.moveset([Moves.SPLASH, Moves.AGILITY]);
|
game.override.moveset([Moves.SPLASH, Moves.AGILITY]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP, Species.BULBASAUR]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.BULBASAUR]);
|
||||||
|
|
||||||
let leadPokemon = game.scene.getPlayerPokemon()!;
|
let leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -90,7 +90,7 @@ describe("Abilities - Protean", () => {
|
|||||||
test("ability applies correctly even if the pokemon's move has a variable type", async () => {
|
test("ability applies correctly even if the pokemon's move has a variable type", async () => {
|
||||||
game.override.moveset([Moves.WEATHER_BALL]);
|
game.override.moveset([Moves.WEATHER_BALL]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -110,7 +110,7 @@ describe("Abilities - Protean", () => {
|
|||||||
game.override.moveset([Moves.TACKLE]);
|
game.override.moveset([Moves.TACKLE]);
|
||||||
game.override.passiveAbility(Abilities.REFRIGERATE);
|
game.override.passiveAbility(Abilities.REFRIGERATE);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -128,7 +128,7 @@ describe("Abilities - Protean", () => {
|
|||||||
test("ability applies correctly even if the pokemon's move calls another move", async () => {
|
test("ability applies correctly even if the pokemon's move calls another move", async () => {
|
||||||
game.override.moveset([Moves.NATURE_POWER]);
|
game.override.moveset([Moves.NATURE_POWER]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -143,7 +143,7 @@ describe("Abilities - Protean", () => {
|
|||||||
test("ability applies correctly even if the pokemon's move is delayed / charging", async () => {
|
test("ability applies correctly even if the pokemon's move is delayed / charging", async () => {
|
||||||
game.override.moveset([Moves.DIG]);
|
game.override.moveset([Moves.DIG]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -158,7 +158,7 @@ describe("Abilities - Protean", () => {
|
|||||||
game.override.moveset([Moves.TACKLE]);
|
game.override.moveset([Moves.TACKLE]);
|
||||||
game.override.enemyMoveset(Moves.SPLASH);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -176,7 +176,7 @@ describe("Abilities - Protean", () => {
|
|||||||
game.override.moveset([Moves.TACKLE]);
|
game.override.moveset([Moves.TACKLE]);
|
||||||
game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]);
|
game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -191,7 +191,7 @@ describe("Abilities - Protean", () => {
|
|||||||
game.override.moveset([Moves.TACKLE]);
|
game.override.moveset([Moves.TACKLE]);
|
||||||
game.override.enemySpecies(Species.GASTLY);
|
game.override.enemySpecies(Species.GASTLY);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -205,7 +205,7 @@ describe("Abilities - Protean", () => {
|
|||||||
test("ability is not applied if pokemon's type is the same as the move's type", async () => {
|
test("ability is not applied if pokemon's type is the same as the move's type", async () => {
|
||||||
game.override.moveset([Moves.SPLASH]);
|
game.override.moveset([Moves.SPLASH]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -220,7 +220,7 @@ describe("Abilities - Protean", () => {
|
|||||||
test("ability is not applied if pokemon is terastallized", async () => {
|
test("ability is not applied if pokemon is terastallized", async () => {
|
||||||
game.override.moveset([Moves.SPLASH]);
|
game.override.moveset([Moves.SPLASH]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -236,7 +236,7 @@ describe("Abilities - Protean", () => {
|
|||||||
test("ability is not applied if pokemon uses struggle", async () => {
|
test("ability is not applied if pokemon uses struggle", async () => {
|
||||||
game.override.moveset([Moves.STRUGGLE]);
|
game.override.moveset([Moves.STRUGGLE]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -250,7 +250,7 @@ describe("Abilities - Protean", () => {
|
|||||||
test("ability is not applied if the pokemon's move fails", async () => {
|
test("ability is not applied if the pokemon's move fails", async () => {
|
||||||
game.override.moveset([Moves.BURN_UP]);
|
game.override.moveset([Moves.BURN_UP]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -265,7 +265,7 @@ describe("Abilities - Protean", () => {
|
|||||||
game.override.moveset([Moves.TRICK_OR_TREAT]);
|
game.override.moveset([Moves.TRICK_OR_TREAT]);
|
||||||
game.override.enemySpecies(Species.GASTLY);
|
game.override.enemySpecies(Species.GASTLY);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
@ -279,7 +279,7 @@ describe("Abilities - Protean", () => {
|
|||||||
test("ability applies correctly and the pokemon curses itself", async () => {
|
test("ability applies correctly and the pokemon curses itself", async () => {
|
||||||
game.override.moveset([Moves.CURSE]);
|
game.override.moveset([Moves.CURSE]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
expect(leadPokemon).not.toBe(undefined);
|
expect(leadPokemon).not.toBe(undefined);
|
||||||
|
@ -41,7 +41,7 @@ describe("Abilities - Quick Draw", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("makes pokemon going first in its priority bracket", async () => {
|
test("makes pokemon going first in its priority bracket", async () => {
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
@ -63,7 +63,7 @@ describe("Abilities - Quick Draw", () => {
|
|||||||
retry: 5,
|
retry: 5,
|
||||||
},
|
},
|
||||||
async () => {
|
async () => {
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
@ -83,7 +83,7 @@ describe("Abilities - Quick Draw", () => {
|
|||||||
test("does not increase priority", async () => {
|
test("does not increase priority", async () => {
|
||||||
game.override.enemyMoveset([Moves.EXTREME_SPEED]);
|
game.override.enemyMoveset([Moves.EXTREME_SPEED]);
|
||||||
|
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
@ -38,7 +38,7 @@ describe("Abilities - Sand Veil", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("ability should increase the evasiveness of the source", async () => {
|
test("ability should increase the evasiveness of the source", async () => {
|
||||||
await game.startBattle([Species.SNORLAX, Species.BLISSEY]);
|
await game.classicMode.startBattle([Species.SNORLAX, Species.BLISSEY]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerField();
|
const leadPokemon = game.scene.getPlayerField();
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ describe("Abilities - SCHOOLING", () => {
|
|||||||
[Species.WISHIWASHI]: schoolForm,
|
[Species.WISHIWASHI]: schoolForm,
|
||||||
});
|
});
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP, Species.WISHIWASHI]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.WISHIWASHI]);
|
||||||
|
|
||||||
const wishiwashi = game.scene.getPlayerParty().find(p => p.species.speciesId === Species.WISHIWASHI)!;
|
const wishiwashi = game.scene.getPlayerParty().find(p => p.species.speciesId === Species.WISHIWASHI)!;
|
||||||
expect(wishiwashi).not.toBe(undefined);
|
expect(wishiwashi).not.toBe(undefined);
|
||||||
|
@ -33,7 +33,7 @@ describe("Abilities - Screen Cleaner", () => {
|
|||||||
game.override.moveset([Moves.HAIL]);
|
game.override.moveset([Moves.HAIL]);
|
||||||
game.override.enemyMoveset([Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL]);
|
game.override.enemyMoveset([Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
|
||||||
|
|
||||||
game.move.select(Moves.HAIL);
|
game.move.select(Moves.HAIL);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to(TurnEndPhase);
|
||||||
@ -50,7 +50,7 @@ describe("Abilities - Screen Cleaner", () => {
|
|||||||
it("removes Light Screen", async () => {
|
it("removes Light Screen", async () => {
|
||||||
game.override.enemyMoveset([Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN]);
|
game.override.enemyMoveset([Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to(TurnEndPhase);
|
||||||
@ -67,7 +67,7 @@ describe("Abilities - Screen Cleaner", () => {
|
|||||||
it("removes Reflect", async () => {
|
it("removes Reflect", async () => {
|
||||||
game.override.enemyMoveset([Moves.REFLECT, Moves.REFLECT, Moves.REFLECT, Moves.REFLECT]);
|
game.override.enemyMoveset([Moves.REFLECT, Moves.REFLECT, Moves.REFLECT, Moves.REFLECT]);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to(TurnEndPhase);
|
||||||
|
@ -31,7 +31,7 @@ describe("Abilities - Simple", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should double stat changes when applied", async () => {
|
it("should double stat changes when applied", async () => {
|
||||||
await game.startBattle([Species.SLOWBRO]);
|
await game.classicMode.startBattle([Species.SLOWBRO]);
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ describe("Abilities - Stall", () => {
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
it("Pokemon with Stall should move last in its priority bracket regardless of speed", async () => {
|
it("Pokemon with Stall should move last in its priority bracket regardless of speed", async () => {
|
||||||
await game.startBattle([Species.SHUCKLE]);
|
await game.classicMode.startBattle([Species.SHUCKLE]);
|
||||||
|
|
||||||
const playerIndex = game.scene.getPlayerPokemon()!.getBattlerIndex();
|
const playerIndex = game.scene.getPlayerPokemon()!.getBattlerIndex();
|
||||||
const enemyIndex = game.scene.getEnemyPokemon()!.getBattlerIndex();
|
const enemyIndex = game.scene.getEnemyPokemon()!.getBattlerIndex();
|
||||||
@ -55,7 +55,7 @@ describe("Abilities - Stall", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("Pokemon with Stall will go first if a move that is in a higher priority bracket than the opponent's move is used", async () => {
|
it("Pokemon with Stall will go first if a move that is in a higher priority bracket than the opponent's move is used", async () => {
|
||||||
await game.startBattle([Species.SHUCKLE]);
|
await game.classicMode.startBattle([Species.SHUCKLE]);
|
||||||
|
|
||||||
const playerIndex = game.scene.getPlayerPokemon()!.getBattlerIndex();
|
const playerIndex = game.scene.getPlayerPokemon()!.getBattlerIndex();
|
||||||
const enemyIndex = game.scene.getEnemyPokemon()!.getBattlerIndex();
|
const enemyIndex = game.scene.getEnemyPokemon()!.getBattlerIndex();
|
||||||
@ -74,7 +74,7 @@ describe("Abilities - Stall", () => {
|
|||||||
|
|
||||||
it("If both Pokemon have stall and use the same move, speed is used to determine who goes first.", async () => {
|
it("If both Pokemon have stall and use the same move, speed is used to determine who goes first.", async () => {
|
||||||
game.override.ability(Abilities.STALL);
|
game.override.ability(Abilities.STALL);
|
||||||
await game.startBattle([Species.SHUCKLE]);
|
await game.classicMode.startBattle([Species.SHUCKLE]);
|
||||||
|
|
||||||
const playerIndex = game.scene.getPlayerPokemon()!.getBattlerIndex();
|
const playerIndex = game.scene.getPlayerPokemon()!.getBattlerIndex();
|
||||||
const enemyIndex = game.scene.getEnemyPokemon()!.getBattlerIndex();
|
const enemyIndex = game.scene.getEnemyPokemon()!.getBattlerIndex();
|
||||||
|
@ -36,14 +36,14 @@ describe("Abilities - Sturdy", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("Sturdy activates when user is at full HP", async () => {
|
test("Sturdy activates when user is at full HP", async () => {
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
game.move.select(Moves.CLOSE_COMBAT);
|
game.move.select(Moves.CLOSE_COMBAT);
|
||||||
await game.phaseInterceptor.to(MoveEndPhase);
|
await game.phaseInterceptor.to(MoveEndPhase);
|
||||||
expect(game.scene.getEnemyParty()[0].hp).toBe(1);
|
expect(game.scene.getEnemyParty()[0].hp).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Sturdy doesn't activate when user is not at full HP", async () => {
|
test("Sturdy doesn't activate when user is not at full HP", async () => {
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemyPokemon: EnemyPokemon = game.scene.getEnemyParty()[0];
|
const enemyPokemon: EnemyPokemon = game.scene.getEnemyParty()[0];
|
||||||
enemyPokemon.hp = enemyPokemon.getMaxHp() - 1;
|
enemyPokemon.hp = enemyPokemon.getMaxHp() - 1;
|
||||||
@ -56,7 +56,7 @@ describe("Abilities - Sturdy", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("Sturdy pokemon should be immune to OHKO moves", async () => {
|
test("Sturdy pokemon should be immune to OHKO moves", async () => {
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
game.move.select(Moves.FISSURE);
|
game.move.select(Moves.FISSURE);
|
||||||
await game.phaseInterceptor.to(MoveEndPhase);
|
await game.phaseInterceptor.to(MoveEndPhase);
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ describe("Abilities - Sturdy", () => {
|
|||||||
test("Sturdy is ignored by pokemon with `Abilities.MOLD_BREAKER`", async () => {
|
test("Sturdy is ignored by pokemon with `Abilities.MOLD_BREAKER`", async () => {
|
||||||
game.override.ability(Abilities.MOLD_BREAKER);
|
game.override.ability(Abilities.MOLD_BREAKER);
|
||||||
|
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
game.move.select(Moves.CLOSE_COMBAT);
|
game.move.select(Moves.CLOSE_COMBAT);
|
||||||
await game.phaseInterceptor.to(DamageAnimPhase);
|
await game.phaseInterceptor.to(DamageAnimPhase);
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ describe("Abilities - Supreme Overlord", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should increase Power by 20% if 2 Pokemon are fainted in the party", async () => {
|
it("should increase Power by 20% if 2 Pokemon are fainted in the party", async () => {
|
||||||
await game.startBattle([Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE]);
|
await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE]);
|
||||||
|
|
||||||
game.move.select(Moves.EXPLOSION);
|
game.move.select(Moves.EXPLOSION);
|
||||||
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
|
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
|
||||||
|
@ -33,7 +33,7 @@ describe("Abilities - Sweet Veil", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("prevents the user and its allies from falling asleep", async () => {
|
it("prevents the user and its allies from falling asleep", async () => {
|
||||||
await game.startBattle([Species.SWIRLIX, Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.SWIRLIX, Species.MAGIKARP]);
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
game.move.select(Moves.SPLASH, 1);
|
game.move.select(Moves.SPLASH, 1);
|
||||||
@ -45,7 +45,7 @@ describe("Abilities - Sweet Veil", () => {
|
|||||||
|
|
||||||
it("causes Rest to fail when used by the user or its allies", async () => {
|
it("causes Rest to fail when used by the user or its allies", async () => {
|
||||||
game.override.enemyMoveset(Moves.SPLASH);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
await game.startBattle([Species.SWIRLIX, Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.SWIRLIX, Species.MAGIKARP]);
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
game.move.select(Moves.REST, 1);
|
game.move.select(Moves.REST, 1);
|
||||||
@ -57,7 +57,7 @@ describe("Abilities - Sweet Veil", () => {
|
|||||||
|
|
||||||
it("causes Yawn to fail if used on the user or its allies", async () => {
|
it("causes Yawn to fail if used on the user or its allies", async () => {
|
||||||
game.override.enemyMoveset([Moves.YAWN, Moves.YAWN, Moves.YAWN, Moves.YAWN]);
|
game.override.enemyMoveset([Moves.YAWN, Moves.YAWN, Moves.YAWN, Moves.YAWN]);
|
||||||
await game.startBattle([Species.SWIRLIX, Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.SWIRLIX, Species.MAGIKARP]);
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
game.move.select(Moves.SPLASH, 1);
|
game.move.select(Moves.SPLASH, 1);
|
||||||
@ -73,7 +73,7 @@ describe("Abilities - Sweet Veil", () => {
|
|||||||
game.override.startingLevel(5);
|
game.override.startingLevel(5);
|
||||||
game.override.enemyMoveset(Moves.SPLASH);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
|
|
||||||
await game.startBattle([Species.SHUCKLE, Species.SHUCKLE, Species.SWIRLIX]);
|
await game.classicMode.startBattle([Species.SHUCKLE, Species.SHUCKLE, Species.SWIRLIX]);
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
game.move.select(Moves.YAWN, 1, BattlerIndex.PLAYER);
|
game.move.select(Moves.YAWN, 1, BattlerIndex.PLAYER);
|
||||||
|
@ -31,7 +31,7 @@ describe("Abilities - Wind Power", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("it becomes charged when hit by wind moves", async () => {
|
it("it becomes charged when hit by wind moves", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
const shiftry = game.scene.getEnemyPokemon()!;
|
const shiftry = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
expect(shiftry.getTag(BattlerTagType.CHARGED)).toBeUndefined();
|
expect(shiftry.getTag(BattlerTagType.CHARGED)).toBeUndefined();
|
||||||
@ -46,7 +46,7 @@ describe("Abilities - Wind Power", () => {
|
|||||||
game.override.ability(Abilities.WIND_POWER);
|
game.override.ability(Abilities.WIND_POWER);
|
||||||
game.override.enemySpecies(Species.MAGIKARP);
|
game.override.enemySpecies(Species.MAGIKARP);
|
||||||
|
|
||||||
await game.startBattle([Species.SHIFTRY]);
|
await game.classicMode.startBattle([Species.SHIFTRY]);
|
||||||
const shiftry = game.scene.getPlayerPokemon()!;
|
const shiftry = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
expect(shiftry.getTag(BattlerTagType.CHARGED)).toBeUndefined();
|
expect(shiftry.getTag(BattlerTagType.CHARGED)).toBeUndefined();
|
||||||
@ -61,7 +61,7 @@ describe("Abilities - Wind Power", () => {
|
|||||||
game.override.enemySpecies(Species.MAGIKARP);
|
game.override.enemySpecies(Species.MAGIKARP);
|
||||||
game.override.ability(Abilities.WIND_POWER);
|
game.override.ability(Abilities.WIND_POWER);
|
||||||
|
|
||||||
await game.startBattle([Species.SHIFTRY]);
|
await game.classicMode.startBattle([Species.SHIFTRY]);
|
||||||
const magikarp = game.scene.getEnemyPokemon()!;
|
const magikarp = game.scene.getEnemyPokemon()!;
|
||||||
const shiftry = game.scene.getPlayerPokemon()!;
|
const shiftry = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ describe("Abilities - Wind Power", () => {
|
|||||||
it("does not interact with Sandstorm", async () => {
|
it("does not interact with Sandstorm", async () => {
|
||||||
game.override.enemySpecies(Species.MAGIKARP);
|
game.override.enemySpecies(Species.MAGIKARP);
|
||||||
|
|
||||||
await game.startBattle([Species.SHIFTRY]);
|
await game.classicMode.startBattle([Species.SHIFTRY]);
|
||||||
const shiftry = game.scene.getPlayerPokemon()!;
|
const shiftry = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
expect(shiftry.getTag(BattlerTagType.CHARGED)).toBeUndefined();
|
expect(shiftry.getTag(BattlerTagType.CHARGED)).toBeUndefined();
|
||||||
|
@ -36,7 +36,7 @@ describe("Abilities - Wonder Skin", () => {
|
|||||||
|
|
||||||
vi.spyOn(moveToCheck, "calculateBattleAccuracy");
|
vi.spyOn(moveToCheck, "calculateBattleAccuracy");
|
||||||
|
|
||||||
await game.startBattle([Species.PIKACHU]);
|
await game.classicMode.startBattle([Species.PIKACHU]);
|
||||||
game.move.select(Moves.CHARM);
|
game.move.select(Moves.CHARM);
|
||||||
await game.phaseInterceptor.to(MoveEffectPhase);
|
await game.phaseInterceptor.to(MoveEffectPhase);
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ describe("Abilities - Wonder Skin", () => {
|
|||||||
|
|
||||||
vi.spyOn(moveToCheck, "calculateBattleAccuracy");
|
vi.spyOn(moveToCheck, "calculateBattleAccuracy");
|
||||||
|
|
||||||
await game.startBattle([Species.PIKACHU]);
|
await game.classicMode.startBattle([Species.PIKACHU]);
|
||||||
game.move.select(Moves.TACKLE);
|
game.move.select(Moves.TACKLE);
|
||||||
await game.phaseInterceptor.to(MoveEffectPhase);
|
await game.phaseInterceptor.to(MoveEffectPhase);
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ describe("Abilities - ZERO TO HERO", () => {
|
|||||||
[Species.PALAFIN]: heroForm,
|
[Species.PALAFIN]: heroForm,
|
||||||
});
|
});
|
||||||
|
|
||||||
await game.startBattle([Species.FEEBAS, Species.PALAFIN, Species.PALAFIN]);
|
await game.classicMode.startBattle([Species.FEEBAS, Species.PALAFIN, Species.PALAFIN]);
|
||||||
|
|
||||||
const palafin1 = game.scene.getPlayerParty()[1];
|
const palafin1 = game.scene.getPlayerParty()[1];
|
||||||
const palafin2 = game.scene.getPlayerParty()[2];
|
const palafin2 = game.scene.getPlayerParty()[2];
|
||||||
@ -61,7 +61,7 @@ describe("Abilities - ZERO TO HERO", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should swap to Hero form when switching out during a battle", async () => {
|
it("should swap to Hero form when switching out during a battle", async () => {
|
||||||
await game.startBattle([Species.PALAFIN, Species.FEEBAS]);
|
await game.classicMode.startBattle([Species.PALAFIN, Species.FEEBAS]);
|
||||||
|
|
||||||
const palafin = game.scene.getPlayerPokemon()!;
|
const palafin = game.scene.getPlayerPokemon()!;
|
||||||
expect(palafin.formIndex).toBe(baseForm);
|
expect(palafin.formIndex).toBe(baseForm);
|
||||||
@ -72,7 +72,7 @@ describe("Abilities - ZERO TO HERO", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not swap to Hero form if switching due to faint", async () => {
|
it("should not swap to Hero form if switching due to faint", async () => {
|
||||||
await game.startBattle([Species.PALAFIN, Species.FEEBAS]);
|
await game.classicMode.startBattle([Species.PALAFIN, Species.FEEBAS]);
|
||||||
|
|
||||||
const palafin = game.scene.getPlayerPokemon()!;
|
const palafin = game.scene.getPlayerPokemon()!;
|
||||||
expect(palafin.formIndex).toBe(baseForm);
|
expect(palafin.formIndex).toBe(baseForm);
|
||||||
@ -89,7 +89,7 @@ describe("Abilities - ZERO TO HERO", () => {
|
|||||||
[Species.PALAFIN]: heroForm,
|
[Species.PALAFIN]: heroForm,
|
||||||
});
|
});
|
||||||
|
|
||||||
await game.startBattle([Species.PALAFIN, Species.FEEBAS]);
|
await game.classicMode.startBattle([Species.PALAFIN, Species.FEEBAS]);
|
||||||
|
|
||||||
const palafin = game.scene.getPlayerPokemon()!;
|
const palafin = game.scene.getPlayerPokemon()!;
|
||||||
expect(palafin.formIndex).toBe(heroForm);
|
expect(palafin.formIndex).toBe(heroForm);
|
||||||
|
@ -37,7 +37,7 @@ describe("Weather - Fog", () => {
|
|||||||
|
|
||||||
vi.spyOn(moveToCheck, "calculateBattleAccuracy");
|
vi.spyOn(moveToCheck, "calculateBattleAccuracy");
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
game.move.select(Moves.TACKLE);
|
game.move.select(Moves.TACKLE);
|
||||||
await game.phaseInterceptor.to(MoveEffectPhase);
|
await game.phaseInterceptor.to(MoveEffectPhase);
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ describe("Battle order", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("opponent faster than player 50 vs 150", async () => {
|
it("opponent faster than player 50 vs 150", async () => {
|
||||||
await game.startBattle([Species.BULBASAUR]);
|
await game.classicMode.startBattle([Species.BULBASAUR]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
@ -51,7 +51,7 @@ describe("Battle order", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("Player faster than opponent 150 vs 50", async () => {
|
it("Player faster than opponent 150 vs 50", async () => {
|
||||||
await game.startBattle([Species.BULBASAUR]);
|
await game.classicMode.startBattle([Species.BULBASAUR]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
@ -71,7 +71,7 @@ describe("Battle order", () => {
|
|||||||
|
|
||||||
it("double - both opponents faster than player 50/50 vs 150/150", async () => {
|
it("double - both opponents faster than player 50/50 vs 150/150", async () => {
|
||||||
game.override.battleStyle("double");
|
game.override.battleStyle("double");
|
||||||
await game.startBattle([Species.BULBASAUR, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.BULBASAUR, Species.BLASTOISE]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerField();
|
const playerPokemon = game.scene.getPlayerField();
|
||||||
const enemyPokemon = game.scene.getEnemyField();
|
const enemyPokemon = game.scene.getEnemyField();
|
||||||
@ -95,7 +95,7 @@ describe("Battle order", () => {
|
|||||||
|
|
||||||
it("double - speed tie except 1 - 100/100 vs 100/150", async () => {
|
it("double - speed tie except 1 - 100/100 vs 100/150", async () => {
|
||||||
game.override.battleStyle("double");
|
game.override.battleStyle("double");
|
||||||
await game.startBattle([Species.BULBASAUR, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.BULBASAUR, Species.BLASTOISE]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerField();
|
const playerPokemon = game.scene.getPlayerField();
|
||||||
const enemyPokemon = game.scene.getEnemyField();
|
const enemyPokemon = game.scene.getEnemyField();
|
||||||
@ -119,7 +119,7 @@ describe("Battle order", () => {
|
|||||||
|
|
||||||
it("double - speed tie 100/150 vs 100/150", async () => {
|
it("double - speed tie 100/150 vs 100/150", async () => {
|
||||||
game.override.battleStyle("double");
|
game.override.battleStyle("double");
|
||||||
await game.startBattle([Species.BULBASAUR, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.BULBASAUR, Species.BLASTOISE]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerField();
|
const playerPokemon = game.scene.getPlayerField();
|
||||||
const enemyPokemon = game.scene.getEnemyField();
|
const enemyPokemon = game.scene.getEnemyField();
|
||||||
|
@ -85,7 +85,7 @@ describe("Test Battle Phase", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("newGame one-liner", async () => {
|
it("newGame one-liner", async () => {
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||||
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
@ -98,7 +98,7 @@ describe("Test Battle Phase", () => {
|
|||||||
game.override.moveset([Moves.TACKLE]);
|
game.override.moveset([Moves.TACKLE]);
|
||||||
game.override.enemyAbility(Abilities.HYDRATION);
|
game.override.enemyAbility(Abilities.HYDRATION);
|
||||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
game.move.select(Moves.TACKLE);
|
game.move.select(Moves.TACKLE);
|
||||||
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(SelectModifierPhase, false);
|
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(SelectModifierPhase, false);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
@ -112,7 +112,7 @@ describe("Test Battle Phase", () => {
|
|||||||
game.override.enemyAbility(Abilities.HYDRATION);
|
game.override.enemyAbility(Abilities.HYDRATION);
|
||||||
game.override.enemyMoveset([Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP]);
|
game.override.enemyMoveset([Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP]);
|
||||||
game.override.battleStyle("single");
|
game.override.battleStyle("single");
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
game.move.select(Moves.TACKLE);
|
game.move.select(Moves.TACKLE);
|
||||||
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnInitPhase, false);
|
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnInitPhase, false);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
@ -127,7 +127,7 @@ describe("Test Battle Phase", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("start battle with selected team", async () => {
|
it("start battle with selected team", async () => {
|
||||||
await game.startBattle([Species.CHARIZARD, Species.CHANSEY, Species.MEW]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.CHANSEY, Species.MEW]);
|
||||||
expect(game.scene.getPlayerParty()[0].species.speciesId).toBe(Species.CHARIZARD);
|
expect(game.scene.getPlayerParty()[0].species.speciesId).toBe(Species.CHARIZARD);
|
||||||
expect(game.scene.getPlayerParty()[1].species.speciesId).toBe(Species.CHANSEY);
|
expect(game.scene.getPlayerParty()[1].species.speciesId).toBe(Species.CHANSEY);
|
||||||
expect(game.scene.getPlayerParty()[2].species.speciesId).toBe(Species.MEW);
|
expect(game.scene.getPlayerParty()[2].species.speciesId).toBe(Species.MEW);
|
||||||
@ -207,7 +207,7 @@ describe("Test Battle Phase", () => {
|
|||||||
game.override.enemySpecies(Species.MIGHTYENA);
|
game.override.enemySpecies(Species.MIGHTYENA);
|
||||||
game.override.enemyAbility(Abilities.HYDRATION);
|
game.override.enemyAbility(Abilities.HYDRATION);
|
||||||
game.override.ability(Abilities.HYDRATION);
|
game.override.ability(Abilities.HYDRATION);
|
||||||
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
||||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||||
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
@ -217,7 +217,7 @@ describe("Test Battle Phase", () => {
|
|||||||
game.override.enemySpecies(Species.MIGHTYENA);
|
game.override.enemySpecies(Species.MIGHTYENA);
|
||||||
game.override.enemyAbility(Abilities.HYDRATION);
|
game.override.enemyAbility(Abilities.HYDRATION);
|
||||||
game.override.ability(Abilities.HYDRATION);
|
game.override.ability(Abilities.HYDRATION);
|
||||||
await game.startBattle([Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.BLASTOISE]);
|
||||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||||
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
@ -228,7 +228,7 @@ describe("Test Battle Phase", () => {
|
|||||||
game.override.enemyAbility(Abilities.HYDRATION);
|
game.override.enemyAbility(Abilities.HYDRATION);
|
||||||
game.override.ability(Abilities.HYDRATION);
|
game.override.ability(Abilities.HYDRATION);
|
||||||
game.override.startingWave(3);
|
game.override.startingWave(3);
|
||||||
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
||||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||||
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
@ -239,7 +239,7 @@ describe("Test Battle Phase", () => {
|
|||||||
game.override.enemyAbility(Abilities.HYDRATION);
|
game.override.enemyAbility(Abilities.HYDRATION);
|
||||||
game.override.ability(Abilities.HYDRATION);
|
game.override.ability(Abilities.HYDRATION);
|
||||||
game.override.startingWave(3);
|
game.override.startingWave(3);
|
||||||
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD, Species.DARKRAI, Species.GABITE]);
|
await game.classicMode.startBattle([Species.BLASTOISE, Species.CHARIZARD, Species.DARKRAI, Species.GABITE]);
|
||||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||||
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
@ -255,7 +255,7 @@ describe("Test Battle Phase", () => {
|
|||||||
game.override.startingWave(3);
|
game.override.startingWave(3);
|
||||||
game.override.moveset([moveToUse]);
|
game.override.moveset([moveToUse]);
|
||||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||||
await game.startBattle([Species.DARMANITAN, Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.DARMANITAN, Species.CHARIZARD]);
|
||||||
|
|
||||||
game.move.select(moveToUse);
|
game.move.select(moveToUse);
|
||||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||||
@ -275,7 +275,7 @@ describe("Test Battle Phase", () => {
|
|||||||
game.override.startingWave(3);
|
game.override.startingWave(3);
|
||||||
game.override.moveset([moveToUse]);
|
game.override.moveset([moveToUse]);
|
||||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
const turn = game.scene.currentBattle.turn;
|
const turn = game.scene.currentBattle.turn;
|
||||||
game.move.select(moveToUse);
|
game.move.select(moveToUse);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
@ -318,7 +318,7 @@ describe("Test Battle Phase", () => {
|
|||||||
.enemyMoveset(Moves.SPLASH)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.startingHeldItems([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ACC }]);
|
.startingHeldItems([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ACC }]);
|
||||||
|
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
game.scene.getPlayerPokemon()!.hp = 1;
|
game.scene.getPlayerPokemon()!.hp = 1;
|
||||||
game.move.select(moveToUse);
|
game.move.select(moveToUse);
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ describe("Double Battles", () => {
|
|||||||
// (There were bugs that either only summon one when can summon two, player stuck in switchPhase etc)
|
// (There were bugs that either only summon one when can summon two, player stuck in switchPhase etc)
|
||||||
it("3v2 edge case: player summons 2 pokemon on the next battle after being fainted and revived", async () => {
|
it("3v2 edge case: player summons 2 pokemon on the next battle after being fainted and revived", async () => {
|
||||||
game.override.battleStyle("double").enemyMoveset(Moves.SPLASH).moveset(Moves.SPLASH);
|
game.override.battleStyle("double").enemyMoveset(Moves.SPLASH).moveset(Moves.SPLASH);
|
||||||
await game.startBattle([Species.BULBASAUR, Species.CHARIZARD, Species.SQUIRTLE]);
|
await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARIZARD, Species.SQUIRTLE]);
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
game.move.select(Moves.SPLASH, 1);
|
game.move.select(Moves.SPLASH, 1);
|
||||||
|
@ -33,63 +33,63 @@ describe("Test Battle Phase", () => {
|
|||||||
|
|
||||||
it("startBattle 2vs1 boss", async () => {
|
it("startBattle 2vs1 boss", async () => {
|
||||||
game.override.battleStyle("single").startingWave(10);
|
game.override.battleStyle("single").startingWave(10);
|
||||||
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
||||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||||
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("startBattle 2vs2 boss", async () => {
|
it("startBattle 2vs2 boss", async () => {
|
||||||
game.override.battleStyle("double").startingWave(10);
|
game.override.battleStyle("double").startingWave(10);
|
||||||
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
||||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||||
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("startBattle 2vs2 trainer", async () => {
|
it("startBattle 2vs2 trainer", async () => {
|
||||||
game.override.battleStyle("double").startingWave(5);
|
game.override.battleStyle("double").startingWave(5);
|
||||||
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
||||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||||
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("startBattle 2vs1 trainer", async () => {
|
it("startBattle 2vs1 trainer", async () => {
|
||||||
game.override.battleStyle("single").startingWave(5);
|
game.override.battleStyle("single").startingWave(5);
|
||||||
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
||||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||||
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("startBattle 2vs1 rival", async () => {
|
it("startBattle 2vs1 rival", async () => {
|
||||||
game.override.battleStyle("single").startingWave(8);
|
game.override.battleStyle("single").startingWave(8);
|
||||||
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
||||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||||
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("startBattle 2vs2 rival", async () => {
|
it("startBattle 2vs2 rival", async () => {
|
||||||
game.override.battleStyle("double").startingWave(8);
|
game.override.battleStyle("double").startingWave(8);
|
||||||
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
||||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||||
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("startBattle 1vs1 trainer", async () => {
|
it("startBattle 1vs1 trainer", async () => {
|
||||||
game.override.battleStyle("single").startingWave(5);
|
game.override.battleStyle("single").startingWave(5);
|
||||||
await game.startBattle([Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.BLASTOISE]);
|
||||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||||
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("startBattle 2vs2 trainer", async () => {
|
it("startBattle 2vs2 trainer", async () => {
|
||||||
game.override.battleStyle("double").startingWave(5);
|
game.override.battleStyle("double").startingWave(5);
|
||||||
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
||||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||||
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("startBattle 4vs2 trainer", async () => {
|
it("startBattle 4vs2 trainer", async () => {
|
||||||
game.override.battleStyle("double").startingWave(5);
|
game.override.battleStyle("double").startingWave(5);
|
||||||
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD, Species.DARKRAI, Species.GABITE]);
|
await game.classicMode.startBattle([Species.BLASTOISE, Species.CHARIZARD, Species.DARKRAI, Species.GABITE]);
|
||||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||||
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
@ -30,7 +30,7 @@ describe("Daily Mode", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should initialize properly", async () => {
|
it("should initialize properly", async () => {
|
||||||
await game.dailyMode.runToSummon();
|
await game.dailyMode.startBattle();
|
||||||
|
|
||||||
const party = game.scene.getPlayerParty();
|
const party = game.scene.getPlayerParty();
|
||||||
expect(party).toHaveLength(3);
|
expect(party).toHaveLength(3);
|
||||||
|
@ -110,7 +110,7 @@ describe("Evolution", () => {
|
|||||||
.startingLevel(16)
|
.startingLevel(16)
|
||||||
.enemyLevel(50);
|
.enemyLevel(50);
|
||||||
|
|
||||||
await game.startBattle([Species.TOTODILE]);
|
await game.classicMode.startBattle([Species.TOTODILE]);
|
||||||
|
|
||||||
const totodile = game.scene.getPlayerPokemon()!;
|
const totodile = game.scene.getPlayerPokemon()!;
|
||||||
const hpBefore = totodile.hp;
|
const hpBefore = totodile.hp;
|
||||||
@ -138,7 +138,7 @@ describe("Evolution", () => {
|
|||||||
.startingLevel(13)
|
.startingLevel(13)
|
||||||
.enemyLevel(30);
|
.enemyLevel(30);
|
||||||
|
|
||||||
await game.startBattle([Species.CYNDAQUIL]);
|
await game.classicMode.startBattle([Species.CYNDAQUIL]);
|
||||||
|
|
||||||
const cyndaquil = game.scene.getPlayerPokemon()!;
|
const cyndaquil = game.scene.getPlayerPokemon()!;
|
||||||
cyndaquil.hp = Math.floor(cyndaquil.getMaxHp() / 2);
|
cyndaquil.hp = Math.floor(cyndaquil.getMaxHp() / 2);
|
||||||
@ -171,7 +171,7 @@ describe("Evolution", () => {
|
|||||||
* If the value is 0, it's a 3 family maushold, whereas if the value is
|
* If the value is 0, it's a 3 family maushold, whereas if the value is
|
||||||
* 1, 2 or 3, it's a 4 family maushold
|
* 1, 2 or 3, it's a 4 family maushold
|
||||||
*/
|
*/
|
||||||
await game.startBattle([Species.TANDEMAUS]); // starts us off with a tandemaus
|
await game.classicMode.startBattle([Species.TANDEMAUS]); // starts us off with a tandemaus
|
||||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
playerPokemon.level = 25; // tandemaus evolves at level 25
|
playerPokemon.level = 25; // tandemaus evolves at level 25
|
||||||
vi.spyOn(Utils, "randSeedInt").mockReturnValue(0); // setting the random generator to be 0 to force a three family maushold
|
vi.spyOn(Utils, "randSeedInt").mockReturnValue(0); // setting the random generator to be 0 to force a three family maushold
|
||||||
|
@ -40,7 +40,7 @@ describe("Items - Dire Hit", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("should raise CRIT stage by 1", async () => {
|
it("should raise CRIT stage by 1", async () => {
|
||||||
await game.startBattle([Species.GASTLY]);
|
await game.classicMode.startBattle([Species.GASTLY]);
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ describe("Items - Dire Hit", () => {
|
|||||||
it("should renew how many battles are left of existing DIRE_HIT when picking up new DIRE_HIT", async () => {
|
it("should renew how many battles are left of existing DIRE_HIT when picking up new DIRE_HIT", async () => {
|
||||||
game.override.itemRewards([{ name: "DIRE_HIT" }]);
|
game.override.itemRewards([{ name: "DIRE_HIT" }]);
|
||||||
|
|
||||||
await game.startBattle([Species.PIKACHU]);
|
await game.classicMode.startBattle([Species.PIKACHU]);
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ describe("EXP Modifier Items", () => {
|
|||||||
|
|
||||||
it("EXP booster items stack multiplicatively", async () => {
|
it("EXP booster items stack multiplicatively", async () => {
|
||||||
game.override.startingHeldItems([{ name: "LUCKY_EGG", count: 3 }, { name: "GOLDEN_EGG" }]);
|
game.override.startingHeldItems([{ name: "LUCKY_EGG", count: 3 }, { name: "GOLDEN_EGG" }]);
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const partyMember = game.scene.getPlayerPokemon()!;
|
const partyMember = game.scene.getPlayerPokemon()!;
|
||||||
partyMember.exp = 100;
|
partyMember.exp = 100;
|
||||||
|
@ -32,7 +32,7 @@ describe("Items - Leek", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should raise CRIT stage by 2 when held by FARFETCHD", async () => {
|
it("should raise CRIT stage by 2 when held by FARFETCHD", async () => {
|
||||||
await game.startBattle([Species.FARFETCHD]);
|
await game.classicMode.startBattle([Species.FARFETCHD]);
|
||||||
|
|
||||||
const enemyMember = game.scene.getEnemyPokemon()!;
|
const enemyMember = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ describe("Items - Leek", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("should raise CRIT stage by 2 when held by GALAR_FARFETCHD", async () => {
|
it("should raise CRIT stage by 2 when held by GALAR_FARFETCHD", async () => {
|
||||||
await game.startBattle([Species.GALAR_FARFETCHD]);
|
await game.classicMode.startBattle([Species.GALAR_FARFETCHD]);
|
||||||
|
|
||||||
const enemyMember = game.scene.getEnemyPokemon()!;
|
const enemyMember = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ describe("Items - Leek", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("should raise CRIT stage by 2 when held by SIRFETCHD", async () => {
|
it("should raise CRIT stage by 2 when held by SIRFETCHD", async () => {
|
||||||
await game.startBattle([Species.SIRFETCHD]);
|
await game.classicMode.startBattle([Species.SIRFETCHD]);
|
||||||
|
|
||||||
const enemyMember = game.scene.getEnemyPokemon()!;
|
const enemyMember = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ describe("Items - Leek", () => {
|
|||||||
// Randomly choose from the Farfetch'd line
|
// Randomly choose from the Farfetch'd line
|
||||||
const species = [Species.FARFETCHD, Species.GALAR_FARFETCHD, Species.SIRFETCHD];
|
const species = [Species.FARFETCHD, Species.GALAR_FARFETCHD, Species.SIRFETCHD];
|
||||||
|
|
||||||
await game.startBattle([species[randInt(species.length)], Species.PIKACHU]);
|
await game.classicMode.startBattle([species[randInt(species.length)], Species.PIKACHU]);
|
||||||
|
|
||||||
const [partyMember, ally] = game.scene.getPlayerParty();
|
const [partyMember, ally] = game.scene.getPlayerParty();
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ describe("Items - Leek", () => {
|
|||||||
// Randomly choose from the Farfetch'd line
|
// Randomly choose from the Farfetch'd line
|
||||||
const species = [Species.FARFETCHD, Species.GALAR_FARFETCHD, Species.SIRFETCHD];
|
const species = [Species.FARFETCHD, Species.GALAR_FARFETCHD, Species.SIRFETCHD];
|
||||||
|
|
||||||
await game.startBattle([Species.PIKACHU, species[randInt(species.length)]]);
|
await game.classicMode.startBattle([Species.PIKACHU, species[randInt(species.length)]]);
|
||||||
|
|
||||||
const [partyMember, ally] = game.scene.getPlayerParty();
|
const [partyMember, ally] = game.scene.getPlayerParty();
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ describe("Items - Leek", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("should not raise CRIT stage when held by a Pokemon outside of FARFETCHD line", async () => {
|
it("should not raise CRIT stage when held by a Pokemon outside of FARFETCHD line", async () => {
|
||||||
await game.startBattle([Species.PIKACHU]);
|
await game.classicMode.startBattle([Species.PIKACHU]);
|
||||||
|
|
||||||
const enemyMember = game.scene.getEnemyPokemon()!;
|
const enemyMember = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ describe("Items - Leftovers", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("leftovers works", async () => {
|
it("leftovers works", async () => {
|
||||||
await game.startBattle([Species.ARCANINE]);
|
await game.classicMode.startBattle([Species.ARCANINE]);
|
||||||
|
|
||||||
// Make sure leftovers are there
|
// Make sure leftovers are there
|
||||||
expect(game.scene.modifiers[0].type.id).toBe("LEFTOVERS");
|
expect(game.scene.modifiers[0].type.id).toBe("LEFTOVERS");
|
||||||
|
@ -150,7 +150,7 @@ describe("Items - Light Ball", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("LIGHT_BALL held by fused PIKACHU (part)", async () => {
|
it("LIGHT_BALL held by fused PIKACHU (part)", async () => {
|
||||||
await game.startBattle([Species.MAROWAK, Species.PIKACHU]);
|
await game.classicMode.startBattle([Species.MAROWAK, Species.PIKACHU]);
|
||||||
|
|
||||||
const partyMember = game.scene.getPlayerParty()[0];
|
const partyMember = game.scene.getPlayerParty()[0];
|
||||||
const ally = game.scene.getPlayerParty()[1];
|
const ally = game.scene.getPlayerParty()[1];
|
||||||
@ -189,7 +189,7 @@ describe("Items - Light Ball", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("LIGHT_BALL not held by PIKACHU", async () => {
|
it("LIGHT_BALL not held by PIKACHU", async () => {
|
||||||
await game.startBattle([Species.MAROWAK]);
|
await game.classicMode.startBattle([Species.MAROWAK]);
|
||||||
|
|
||||||
const partyMember = game.scene.getPlayerParty()[0];
|
const partyMember = game.scene.getPlayerParty()[0];
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ describe("Items - Metal Powder", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("METAL_POWDER held by DITTO", async () => {
|
it("METAL_POWDER held by DITTO", async () => {
|
||||||
await game.startBattle([Species.DITTO]);
|
await game.classicMode.startBattle([Species.DITTO]);
|
||||||
|
|
||||||
const partyMember = game.scene.getPlayerParty()[0];
|
const partyMember = game.scene.getPlayerParty()[0];
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ describe("Items - Metal Powder", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("METAL_POWDER held by fused DITTO (base)", async () => {
|
it("METAL_POWDER held by fused DITTO (base)", async () => {
|
||||||
await game.startBattle([Species.DITTO, Species.MAROWAK]);
|
await game.classicMode.startBattle([Species.DITTO, Species.MAROWAK]);
|
||||||
|
|
||||||
const partyMember = game.scene.getPlayerParty()[0];
|
const partyMember = game.scene.getPlayerParty()[0];
|
||||||
const ally = game.scene.getPlayerParty()[1];
|
const ally = game.scene.getPlayerParty()[1];
|
||||||
@ -138,7 +138,7 @@ describe("Items - Metal Powder", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("METAL_POWDER held by fused DITTO (part)", async () => {
|
it("METAL_POWDER held by fused DITTO (part)", async () => {
|
||||||
await game.startBattle([Species.MAROWAK, Species.DITTO]);
|
await game.classicMode.startBattle([Species.MAROWAK, Species.DITTO]);
|
||||||
|
|
||||||
const partyMember = game.scene.getPlayerParty()[0];
|
const partyMember = game.scene.getPlayerParty()[0];
|
||||||
const ally = game.scene.getPlayerParty()[1];
|
const ally = game.scene.getPlayerParty()[1];
|
||||||
@ -171,7 +171,7 @@ describe("Items - Metal Powder", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("METAL_POWDER not held by DITTO", async () => {
|
it("METAL_POWDER not held by DITTO", async () => {
|
||||||
await game.startBattle([Species.MAROWAK]);
|
await game.classicMode.startBattle([Species.MAROWAK]);
|
||||||
|
|
||||||
const partyMember = game.scene.getPlayerParty()[0];
|
const partyMember = game.scene.getPlayerParty()[0];
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ describe("Items - Scope Lens", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("should raise CRIT stage by 1", async () => {
|
it("should raise CRIT stage by 1", async () => {
|
||||||
await game.startBattle([Species.GASTLY]);
|
await game.classicMode.startBattle([Species.GASTLY]);
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ describe("Moves - Astonish", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("move effect should cancel the target's move on the turn it applies", async () => {
|
test("move effect should cancel the target's move on the turn it applies", async () => {
|
||||||
await game.startBattle([Species.MEOWSCARADA]);
|
await game.classicMode.startBattle([Species.MEOWSCARADA]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ describe("Moves - Beat Up", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should hit once for each healthy player Pokemon", async () => {
|
it("should hit once for each healthy player Pokemon", async () => {
|
||||||
await game.startBattle([
|
await game.classicMode.startBattle([
|
||||||
Species.MAGIKARP,
|
Species.MAGIKARP,
|
||||||
Species.BULBASAUR,
|
Species.BULBASAUR,
|
||||||
Species.CHARMANDER,
|
Species.CHARMANDER,
|
||||||
@ -63,7 +63,7 @@ describe("Moves - Beat Up", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not count player Pokemon with status effects towards hit count", async () => {
|
it("should not count player Pokemon with status effects towards hit count", async () => {
|
||||||
await game.startBattle([
|
await game.classicMode.startBattle([
|
||||||
Species.MAGIKARP,
|
Species.MAGIKARP,
|
||||||
Species.BULBASAUR,
|
Species.BULBASAUR,
|
||||||
Species.CHARMANDER,
|
Species.CHARMANDER,
|
||||||
|
@ -42,7 +42,7 @@ describe("Moves - BELLY DRUM", () => {
|
|||||||
// Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Belly_Drum_(move)
|
// Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Belly_Drum_(move)
|
||||||
|
|
||||||
test("raises the user's ATK stat stage to its max, at the cost of 1/2 of its maximum HP", async () => {
|
test("raises the user's ATK stat stage to its max, at the cost of 1/2 of its maximum HP", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO);
|
const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO);
|
||||||
@ -55,7 +55,7 @@ describe("Moves - BELLY DRUM", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("will still take effect if an uninvolved stat stage is at max", async () => {
|
test("will still take effect if an uninvolved stat stage is at max", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO);
|
const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO);
|
||||||
@ -73,7 +73,7 @@ describe("Moves - BELLY DRUM", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("fails if the pokemon's ATK stat stage is at its maximum", async () => {
|
test("fails if the pokemon's ATK stat stage is at its maximum", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ describe("Moves - BELLY DRUM", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("fails if the user's health is less than 1/2", async () => {
|
test("fails if the user's health is less than 1/2", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO);
|
const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO);
|
||||||
|
@ -38,7 +38,7 @@ describe("Moves - Clangorous Soul", () => {
|
|||||||
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Clangorous_Soul_(move)
|
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Clangorous_Soul_(move)
|
||||||
|
|
||||||
it("raises the user's ATK, DEF, SPATK, SPDEF, and SPD stat stages by 1 each at the cost of 1/3 of its maximum HP", async () => {
|
it("raises the user's ATK, DEF, SPATK, SPDEF, and SPD stat stages by 1 each at the cost of 1/3 of its maximum HP", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO);
|
const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO);
|
||||||
@ -55,7 +55,7 @@ describe("Moves - Clangorous Soul", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("will still take effect if one or more of the involved stat stages are not at max", async () => {
|
it("will still take effect if one or more of the involved stat stages are not at max", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO);
|
const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO);
|
||||||
@ -78,7 +78,7 @@ describe("Moves - Clangorous Soul", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("fails if all stat stages involved are at max", async () => {
|
it("fails if all stat stages involved are at max", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ describe("Moves - Clangorous Soul", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("fails if the user's health is less than 1/3", async () => {
|
it("fails if the user's health is less than 1/3", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO);
|
const hpLost = Math.floor(leadPokemon.getMaxHp() / RATIO);
|
||||||
|
@ -39,7 +39,7 @@ describe("Moves - Crafty Shield", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("should protect the user and allies from status moves", async () => {
|
test("should protect the user and allies from status moves", async () => {
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerField();
|
const leadPokemon = game.scene.getPlayerField();
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ describe("Moves - Crafty Shield", () => {
|
|||||||
test("should not protect the user and allies from attack moves", async () => {
|
test("should not protect the user and allies from attack moves", async () => {
|
||||||
game.override.enemyMoveset([Moves.TACKLE]);
|
game.override.enemyMoveset([Moves.TACKLE]);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerField();
|
const leadPokemon = game.scene.getPlayerField();
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ describe("Moves - Crafty Shield", () => {
|
|||||||
game.override.enemySpecies(Species.DUSCLOPS);
|
game.override.enemySpecies(Species.DUSCLOPS);
|
||||||
game.override.enemyMoveset([Moves.CURSE]);
|
game.override.enemyMoveset([Moves.CURSE]);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerField();
|
const leadPokemon = game.scene.getPlayerField();
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ describe("Moves - Crafty Shield", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("should not block allies' self-targeted moves", async () => {
|
test("should not block allies' self-targeted moves", async () => {
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerField();
|
const leadPokemon = game.scene.getPlayerField();
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ describe("Moves - Double Team", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("raises the user's EVA stat stage by 1", async () => {
|
it("raises the user's EVA stat stage by 1", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const ally = game.scene.getPlayerPokemon()!;
|
const ally = game.scene.getPlayerPokemon()!;
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
@ -45,7 +45,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||||||
|
|
||||||
it("should return 100 power against an enemy below level cap", async () => {
|
it("should return 100 power against an enemy below level cap", async () => {
|
||||||
game.override.enemyLevel(1);
|
game.override.enemyLevel(1);
|
||||||
await game.startBattle([Species.ETERNATUS]);
|
await game.classicMode.startBattle([Species.ETERNATUS]);
|
||||||
|
|
||||||
game.move.select(dynamaxCannon.id);
|
game.move.select(dynamaxCannon.id);
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||||||
|
|
||||||
it("should return 100 power against an enemy at level cap", async () => {
|
it("should return 100 power against an enemy at level cap", async () => {
|
||||||
game.override.enemyLevel(10);
|
game.override.enemyLevel(10);
|
||||||
await game.startBattle([Species.ETERNATUS]);
|
await game.classicMode.startBattle([Species.ETERNATUS]);
|
||||||
|
|
||||||
game.move.select(dynamaxCannon.id);
|
game.move.select(dynamaxCannon.id);
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||||||
|
|
||||||
it("should return 120 power against an enemy 1% above level cap", async () => {
|
it("should return 120 power against an enemy 1% above level cap", async () => {
|
||||||
game.override.enemyLevel(101);
|
game.override.enemyLevel(101);
|
||||||
await game.startBattle([Species.ETERNATUS]);
|
await game.classicMode.startBattle([Species.ETERNATUS]);
|
||||||
|
|
||||||
game.move.select(dynamaxCannon.id);
|
game.move.select(dynamaxCannon.id);
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||||||
|
|
||||||
it("should return 140 power against an enemy 2% above level capp", async () => {
|
it("should return 140 power against an enemy 2% above level capp", async () => {
|
||||||
game.override.enemyLevel(102);
|
game.override.enemyLevel(102);
|
||||||
await game.startBattle([Species.ETERNATUS]);
|
await game.classicMode.startBattle([Species.ETERNATUS]);
|
||||||
|
|
||||||
game.move.select(dynamaxCannon.id);
|
game.move.select(dynamaxCannon.id);
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||||||
|
|
||||||
it("should return 160 power against an enemy 3% above level cap", async () => {
|
it("should return 160 power against an enemy 3% above level cap", async () => {
|
||||||
game.override.enemyLevel(103);
|
game.override.enemyLevel(103);
|
||||||
await game.startBattle([Species.ETERNATUS]);
|
await game.classicMode.startBattle([Species.ETERNATUS]);
|
||||||
|
|
||||||
game.move.select(dynamaxCannon.id);
|
game.move.select(dynamaxCannon.id);
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||||||
|
|
||||||
it("should return 180 power against an enemy 4% above level cap", async () => {
|
it("should return 180 power against an enemy 4% above level cap", async () => {
|
||||||
game.override.enemyLevel(104);
|
game.override.enemyLevel(104);
|
||||||
await game.startBattle([Species.ETERNATUS]);
|
await game.classicMode.startBattle([Species.ETERNATUS]);
|
||||||
|
|
||||||
game.move.select(dynamaxCannon.id);
|
game.move.select(dynamaxCannon.id);
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||||||
|
|
||||||
it("should return 200 power against an enemy 5% above level cap", async () => {
|
it("should return 200 power against an enemy 5% above level cap", async () => {
|
||||||
game.override.enemyLevel(105);
|
game.override.enemyLevel(105);
|
||||||
await game.startBattle([Species.ETERNATUS]);
|
await game.classicMode.startBattle([Species.ETERNATUS]);
|
||||||
|
|
||||||
game.move.select(dynamaxCannon.id);
|
game.move.select(dynamaxCannon.id);
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ describe("Moves - Dynamax Cannon", () => {
|
|||||||
|
|
||||||
it("should return 200 power against an enemy way above level cap", async () => {
|
it("should return 200 power against an enemy way above level cap", async () => {
|
||||||
game.override.enemyLevel(999);
|
game.override.enemyLevel(999);
|
||||||
await game.startBattle([Species.ETERNATUS]);
|
await game.classicMode.startBattle([Species.ETERNATUS]);
|
||||||
|
|
||||||
game.move.select(dynamaxCannon.id);
|
game.move.select(dynamaxCannon.id);
|
||||||
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
|
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
|
||||||
|
@ -39,7 +39,7 @@ describe("Moves - FILLET AWAY", () => {
|
|||||||
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/fillet_away_(move)
|
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/fillet_away_(move)
|
||||||
|
|
||||||
test("raises the user's ATK, SPATK, and SPD stat stages by 2 each, at the cost of 1/2 of its maximum HP", async () => {
|
test("raises the user's ATK, SPATK, and SPD stat stages by 2 each, at the cost of 1/2 of its maximum HP", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO);
|
const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO);
|
||||||
@ -54,7 +54,7 @@ describe("Moves - FILLET AWAY", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("still takes effect if one or more of the involved stat stages are not at max", async () => {
|
test("still takes effect if one or more of the involved stat stages are not at max", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO);
|
const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO);
|
||||||
@ -73,7 +73,7 @@ describe("Moves - FILLET AWAY", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("fails if all stat stages involved are at max", async () => {
|
test("fails if all stat stages involved are at max", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ describe("Moves - FILLET AWAY", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("fails if the user's health is less than 1/2", async () => {
|
test("fails if the user's health is less than 1/2", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO);
|
const hpLost = toDmgValue(leadPokemon.getMaxHp() / RATIO);
|
||||||
|
@ -46,7 +46,7 @@ describe("Moves - Flame Burst", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("inflicts damage to the target's ally equal to 1/16 of its max HP", async () => {
|
it("inflicts damage to the target's ally equal to 1/16 of its max HP", async () => {
|
||||||
await game.startBattle([Species.PIKACHU, Species.PIKACHU]);
|
await game.classicMode.startBattle([Species.PIKACHU, Species.PIKACHU]);
|
||||||
const [leftEnemy, rightEnemy] = game.scene.getEnemyField();
|
const [leftEnemy, rightEnemy] = game.scene.getEnemyField();
|
||||||
|
|
||||||
game.move.select(Moves.FLAME_BURST, 0, leftEnemy.getBattlerIndex());
|
game.move.select(Moves.FLAME_BURST, 0, leftEnemy.getBattlerIndex());
|
||||||
@ -60,7 +60,7 @@ describe("Moves - Flame Burst", () => {
|
|||||||
it("does not inflict damage to the target's ally if the target was not affected by Flame Burst", async () => {
|
it("does not inflict damage to the target's ally if the target was not affected by Flame Burst", async () => {
|
||||||
game.override.enemyAbility(Abilities.FLASH_FIRE);
|
game.override.enemyAbility(Abilities.FLASH_FIRE);
|
||||||
|
|
||||||
await game.startBattle([Species.PIKACHU, Species.PIKACHU]);
|
await game.classicMode.startBattle([Species.PIKACHU, Species.PIKACHU]);
|
||||||
const [leftEnemy, rightEnemy] = game.scene.getEnemyField();
|
const [leftEnemy, rightEnemy] = game.scene.getEnemyField();
|
||||||
|
|
||||||
game.move.select(Moves.FLAME_BURST, 0, leftEnemy.getBattlerIndex());
|
game.move.select(Moves.FLAME_BURST, 0, leftEnemy.getBattlerIndex());
|
||||||
@ -72,7 +72,7 @@ describe("Moves - Flame Burst", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("does not interact with the target ally's abilities", async () => {
|
it("does not interact with the target ally's abilities", async () => {
|
||||||
await game.startBattle([Species.PIKACHU, Species.PIKACHU]);
|
await game.classicMode.startBattle([Species.PIKACHU, Species.PIKACHU]);
|
||||||
const [leftEnemy, rightEnemy] = game.scene.getEnemyField();
|
const [leftEnemy, rightEnemy] = game.scene.getEnemyField();
|
||||||
|
|
||||||
vi.spyOn(rightEnemy, "getAbility").mockReturnValue(allAbilities[Abilities.FLASH_FIRE]);
|
vi.spyOn(rightEnemy, "getAbility").mockReturnValue(allAbilities[Abilities.FLASH_FIRE]);
|
||||||
@ -86,7 +86,7 @@ describe("Moves - Flame Burst", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("effect damage is prevented by Magic Guard", async () => {
|
it("effect damage is prevented by Magic Guard", async () => {
|
||||||
await game.startBattle([Species.PIKACHU, Species.PIKACHU]);
|
await game.classicMode.startBattle([Species.PIKACHU, Species.PIKACHU]);
|
||||||
const [leftEnemy, rightEnemy] = game.scene.getEnemyField();
|
const [leftEnemy, rightEnemy] = game.scene.getEnemyField();
|
||||||
|
|
||||||
vi.spyOn(rightEnemy, "getAbility").mockReturnValue(allAbilities[Abilities.MAGIC_GUARD]);
|
vi.spyOn(rightEnemy, "getAbility").mockReturnValue(allAbilities[Abilities.MAGIC_GUARD]);
|
||||||
|
@ -36,7 +36,7 @@ describe("Moves - Flower Shield", () => {
|
|||||||
it("raises DEF stat stage by 1 for all Grass-type Pokemon on the field by one stage - single battle", async () => {
|
it("raises DEF stat stage by 1 for all Grass-type Pokemon on the field by one stage - single battle", async () => {
|
||||||
game.override.enemySpecies(Species.CHERRIM);
|
game.override.enemySpecies(Species.CHERRIM);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
const cherrim = game.scene.getEnemyPokemon()!;
|
const cherrim = game.scene.getEnemyPokemon()!;
|
||||||
const magikarp = game.scene.getPlayerPokemon()!;
|
const magikarp = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ describe("Moves - Flower Shield", () => {
|
|||||||
it("raises DEF stat stage by 1 for all Grass-type Pokemon on the field by one stage - double battle", async () => {
|
it("raises DEF stat stage by 1 for all Grass-type Pokemon on the field by one stage - double battle", async () => {
|
||||||
game.override.enemySpecies(Species.MAGIKARP).startingBiome(Biome.GRASS).battleStyle("double");
|
game.override.enemySpecies(Species.MAGIKARP).startingBiome(Biome.GRASS).battleStyle("double");
|
||||||
|
|
||||||
await game.startBattle([Species.CHERRIM, Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.CHERRIM, Species.MAGIKARP]);
|
||||||
const field = game.scene.getField(true);
|
const field = game.scene.getField(true);
|
||||||
|
|
||||||
const grassPokemons = field.filter(p => p.getTypes().includes(PokemonType.GRASS));
|
const grassPokemons = field.filter(p => p.getTypes().includes(PokemonType.GRASS));
|
||||||
@ -78,7 +78,7 @@ describe("Moves - Flower Shield", () => {
|
|||||||
game.override.enemyMoveset([Moves.DIG, Moves.DIG, Moves.DIG, Moves.DIG]);
|
game.override.enemyMoveset([Moves.DIG, Moves.DIG, Moves.DIG, Moves.DIG]);
|
||||||
game.override.enemyLevel(50);
|
game.override.enemyLevel(50);
|
||||||
|
|
||||||
await game.startBattle([Species.CHERRIM]);
|
await game.classicMode.startBattle([Species.CHERRIM]);
|
||||||
const paras = game.scene.getEnemyPokemon()!;
|
const paras = game.scene.getEnemyPokemon()!;
|
||||||
const cherrim = game.scene.getPlayerPokemon()!;
|
const cherrim = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ describe("Moves - Flower Shield", () => {
|
|||||||
it("does nothing if there are no Grass-type Pokemon on the field", async () => {
|
it("does nothing if there are no Grass-type Pokemon on the field", async () => {
|
||||||
game.override.enemySpecies(Species.MAGIKARP);
|
game.override.enemySpecies(Species.MAGIKARP);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
const ally = game.scene.getPlayerPokemon()!;
|
const ally = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ describe("Moves - Foresight", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should allow Normal and Fighting moves to hit Ghost types", async () => {
|
it("should allow Normal and Fighting moves to hit Ghost types", async () => {
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ describe("Moves - Foresight", () => {
|
|||||||
|
|
||||||
it("should ignore target's evasiveness boosts", async () => {
|
it("should ignore target's evasiveness boosts", async () => {
|
||||||
game.override.enemyMoveset([Moves.MINIMIZE]);
|
game.override.enemyMoveset([Moves.MINIMIZE]);
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
vi.spyOn(pokemon, "getAccuracyMultiplier");
|
vi.spyOn(pokemon, "getAccuracyMultiplier");
|
||||||
|
@ -36,7 +36,7 @@ describe("Moves - Fusion Bolt", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not make contact", async () => {
|
it("should not make contact", async () => {
|
||||||
await game.startBattle([Species.ZEKROM]);
|
await game.classicMode.startBattle([Species.ZEKROM]);
|
||||||
|
|
||||||
const partyMember = game.scene.getPlayerPokemon()!;
|
const partyMember = game.scene.getPlayerPokemon()!;
|
||||||
const initialHp = partyMember.hp;
|
const initialHp = partyMember.hp;
|
||||||
|
@ -36,7 +36,7 @@ describe("Moves - Fusion Flare", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should thaw freeze status condition", async () => {
|
it("should thaw freeze status condition", async () => {
|
||||||
await game.startBattle([Species.RESHIRAM]);
|
await game.classicMode.startBattle([Species.RESHIRAM]);
|
||||||
|
|
||||||
const partyMember = game.scene.getPlayerPokemon()!;
|
const partyMember = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("FUSION_FLARE should double power of subsequent FUSION_BOLT if moves are aimed at allies", async () => {
|
it("FUSION_FLARE should double power of subsequent FUSION_BOLT if moves are aimed at allies", async () => {
|
||||||
await game.startBattle([Species.ZEKROM, Species.RESHIRAM]);
|
await game.classicMode.startBattle([Species.ZEKROM, Species.RESHIRAM]);
|
||||||
|
|
||||||
game.move.select(fusionBolt.id, 0, BattlerIndex.PLAYER_2);
|
game.move.select(fusionBolt.id, 0, BattlerIndex.PLAYER_2);
|
||||||
game.move.select(fusionFlare.id, 1, BattlerIndex.PLAYER);
|
game.move.select(fusionFlare.id, 1, BattlerIndex.PLAYER);
|
||||||
|
@ -32,7 +32,7 @@ describe("Moves - Growth", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should raise SPATK stat stage by 1", async () => {
|
it("should raise SPATK stat stage by 1", async () => {
|
||||||
await game.startBattle([Species.MIGHTYENA]);
|
await game.classicMode.startBattle([Species.MIGHTYENA]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ describe("Moves - Guard Split", () => {
|
|||||||
|
|
||||||
it("should average the user's DEF and SPDEF stats with those of the target", async () => {
|
it("should average the user's DEF and SPDEF stats with those of the target", async () => {
|
||||||
game.override.enemyMoveset(Moves.SPLASH);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
await game.startBattle([Species.INDEEDEE]);
|
await game.classicMode.startBattle([Species.INDEEDEE]);
|
||||||
|
|
||||||
const player = game.scene.getPlayerPokemon()!;
|
const player = game.scene.getPlayerPokemon()!;
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
@ -54,7 +54,7 @@ describe("Moves - Guard Split", () => {
|
|||||||
|
|
||||||
it("should be idempotent", async () => {
|
it("should be idempotent", async () => {
|
||||||
game.override.enemyMoveset([Moves.GUARD_SPLIT]);
|
game.override.enemyMoveset([Moves.GUARD_SPLIT]);
|
||||||
await game.startBattle([Species.INDEEDEE]);
|
await game.classicMode.startBattle([Species.INDEEDEE]);
|
||||||
|
|
||||||
const player = game.scene.getPlayerPokemon()!;
|
const player = game.scene.getPlayerPokemon()!;
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
@ -37,7 +37,7 @@ describe("Moves - Hard Press", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should return 100 power if target HP ratio is at 100%", async () => {
|
it("should return 100 power if target HP ratio is at 100%", async () => {
|
||||||
await game.startBattle([Species.PIKACHU]);
|
await game.classicMode.startBattle([Species.PIKACHU]);
|
||||||
|
|
||||||
game.move.select(Moves.HARD_PRESS);
|
game.move.select(Moves.HARD_PRESS);
|
||||||
await game.phaseInterceptor.to(MoveEffectPhase);
|
await game.phaseInterceptor.to(MoveEffectPhase);
|
||||||
@ -46,7 +46,7 @@ describe("Moves - Hard Press", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should return 50 power if target HP ratio is at 50%", async () => {
|
it("should return 50 power if target HP ratio is at 50%", async () => {
|
||||||
await game.startBattle([Species.PIKACHU]);
|
await game.classicMode.startBattle([Species.PIKACHU]);
|
||||||
const targetHpRatio = 0.5;
|
const targetHpRatio = 0.5;
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ describe("Moves - Hard Press", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should return 1 power if target HP ratio is at 1%", async () => {
|
it("should return 1 power if target HP ratio is at 1%", async () => {
|
||||||
await game.startBattle([Species.PIKACHU]);
|
await game.classicMode.startBattle([Species.PIKACHU]);
|
||||||
const targetHpRatio = 0.01;
|
const targetHpRatio = 0.01;
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ describe("Moves - Hard Press", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should return 1 power if target HP ratio is less than 1%", async () => {
|
it("should return 1 power if target HP ratio is less than 1%", async () => {
|
||||||
await game.startBattle([Species.PIKACHU]);
|
await game.classicMode.startBattle([Species.PIKACHU]);
|
||||||
const targetHpRatio = 0.005;
|
const targetHpRatio = 0.005;
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ describe("Moves - Haze", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should reset all stat changes of all Pokemon on field", async () => {
|
it("should reset all stat changes of all Pokemon on field", async () => {
|
||||||
await game.startBattle([Species.RATTATA]);
|
await game.classicMode.startBattle([Species.RATTATA]);
|
||||||
const user = game.scene.getPlayerPokemon()!;
|
const user = game.scene.getPlayerPokemon()!;
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ describe("Moves - Hyper Beam", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should force the user to recharge on the next turn (and only that turn)", async () => {
|
it("should force the user to recharge on the next turn (and only that turn)", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
@ -40,7 +40,7 @@ describe("Moves - Jaw Lock", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should trap the move's user and target", async () => {
|
it("should trap the move's user and target", async () => {
|
||||||
await game.startBattle([Species.BULBASAUR]);
|
await game.classicMode.startBattle([Species.BULBASAUR]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
@ -61,7 +61,7 @@ describe("Moves - Jaw Lock", () => {
|
|||||||
|
|
||||||
it("should not trap either pokemon if the target faints", async () => {
|
it("should not trap either pokemon if the target faints", async () => {
|
||||||
game.override.enemyLevel(1);
|
game.override.enemyLevel(1);
|
||||||
await game.startBattle([Species.BULBASAUR]);
|
await game.classicMode.startBattle([Species.BULBASAUR]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
@ -86,7 +86,7 @@ describe("Moves - Jaw Lock", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should only trap the user until the target faints", async () => {
|
it("should only trap the user until the target faints", async () => {
|
||||||
await game.startBattle([Species.BULBASAUR]);
|
await game.classicMode.startBattle([Species.BULBASAUR]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
@ -109,7 +109,7 @@ describe("Moves - Jaw Lock", () => {
|
|||||||
it("should not trap other targets after the first target is trapped", async () => {
|
it("should not trap other targets after the first target is trapped", async () => {
|
||||||
game.override.battleStyle("double");
|
game.override.battleStyle("double");
|
||||||
|
|
||||||
await game.startBattle([Species.CHARMANDER, Species.BULBASAUR]);
|
await game.classicMode.startBattle([Species.CHARMANDER, Species.BULBASAUR]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerField();
|
const playerPokemon = game.scene.getPlayerField();
|
||||||
const enemyPokemon = game.scene.getEnemyField();
|
const enemyPokemon = game.scene.getEnemyField();
|
||||||
@ -138,7 +138,7 @@ describe("Moves - Jaw Lock", () => {
|
|||||||
it("should not trap either pokemon if the target is protected", async () => {
|
it("should not trap either pokemon if the target is protected", async () => {
|
||||||
game.override.enemyMoveset([Moves.PROTECT]);
|
game.override.enemyMoveset([Moves.PROTECT]);
|
||||||
|
|
||||||
await game.startBattle([Species.BULBASAUR]);
|
await game.classicMode.startBattle([Species.BULBASAUR]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
@ -35,7 +35,7 @@ describe("Moves - Lucky Chant", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should prevent critical hits from moves", async () => {
|
it("should prevent critical hits from moves", async () => {
|
||||||
await game.startBattle([Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.CHARIZARD]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ describe("Moves - Lucky Chant", () => {
|
|||||||
it("should prevent critical hits against the user's ally", async () => {
|
it("should prevent critical hits against the user's ally", async () => {
|
||||||
game.override.battleStyle("double");
|
game.override.battleStyle("double");
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerField();
|
const playerPokemon = game.scene.getPlayerField();
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ describe("Moves - Lucky Chant", () => {
|
|||||||
it("should prevent critical hits from field effects", async () => {
|
it("should prevent critical hits from field effects", async () => {
|
||||||
game.override.enemyMoveset([Moves.TACKLE]);
|
game.override.enemyMoveset([Moves.TACKLE]);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.CHARIZARD]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
@ -33,7 +33,7 @@ describe("Moves - Lunar Blessing", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should restore 25% HP of the user and its ally", async () => {
|
it("should restore 25% HP of the user and its ally", async () => {
|
||||||
await game.startBattle([Species.RATTATA, Species.RATTATA]);
|
await game.classicMode.startBattle([Species.RATTATA, Species.RATTATA]);
|
||||||
const [leftPlayer, rightPlayer] = game.scene.getPlayerField();
|
const [leftPlayer, rightPlayer] = game.scene.getPlayerField();
|
||||||
|
|
||||||
vi.spyOn(leftPlayer, "getMaxHp").mockReturnValue(100);
|
vi.spyOn(leftPlayer, "getMaxHp").mockReturnValue(100);
|
||||||
@ -61,7 +61,7 @@ describe("Moves - Lunar Blessing", () => {
|
|||||||
|
|
||||||
it("should cure status effect of the user and its ally", async () => {
|
it("should cure status effect of the user and its ally", async () => {
|
||||||
game.override.statusEffect(StatusEffect.BURN);
|
game.override.statusEffect(StatusEffect.BURN);
|
||||||
await game.startBattle([Species.RATTATA, Species.RATTATA]);
|
await game.classicMode.startBattle([Species.RATTATA, Species.RATTATA]);
|
||||||
const [leftPlayer, rightPlayer] = game.scene.getPlayerField();
|
const [leftPlayer, rightPlayer] = game.scene.getPlayerField();
|
||||||
|
|
||||||
vi.spyOn(leftPlayer, "resetStatus");
|
vi.spyOn(leftPlayer, "resetStatus");
|
||||||
|
@ -33,7 +33,7 @@ describe("Moves - Magnet Rise", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("MAGNET RISE", async () => {
|
it("MAGNET RISE", async () => {
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const startingHp = game.scene.getPlayerParty()[0].hp;
|
const startingHp = game.scene.getPlayerParty()[0].hp;
|
||||||
game.move.select(moveToUse);
|
game.move.select(moveToUse);
|
||||||
@ -44,7 +44,7 @@ describe("Moves - Magnet Rise", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("MAGNET RISE - Gravity", async () => {
|
it("MAGNET RISE - Gravity", async () => {
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const startingHp = game.scene.getPlayerParty()[0].hp;
|
const startingHp = game.scene.getPlayerParty()[0].hp;
|
||||||
game.move.select(moveToUse);
|
game.move.select(moveToUse);
|
||||||
|
@ -34,7 +34,7 @@ describe("Moves - Make It Rain", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should only lower SPATK stat stage by 1 once in a double battle", async () => {
|
it("should only lower SPATK stat stage by 1 once in a double battle", async () => {
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ describe("Moves - Make It Rain", () => {
|
|||||||
game.override.enemyLevel(1); // ensures the enemy will faint
|
game.override.enemyLevel(1); // ensures the enemy will faint
|
||||||
game.override.battleStyle("single");
|
game.override.battleStyle("single");
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.CHARIZARD]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
@ -66,7 +66,7 @@ describe("Moves - Make It Rain", () => {
|
|||||||
it("should reduce Sp. Atk. once after KOing two enemies", async () => {
|
it("should reduce Sp. Atk. once after KOing two enemies", async () => {
|
||||||
game.override.enemyLevel(1); // ensures the enemy will faint
|
game.override.enemyLevel(1); // ensures the enemy will faint
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const enemyPokemon = game.scene.getEnemyField();
|
const enemyPokemon = game.scene.getEnemyField();
|
||||||
@ -81,7 +81,7 @@ describe("Moves - Make It Rain", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should lower SPATK stat stage by 1 if it only hits the second target", async () => {
|
it("should lower SPATK stat stage by 1 if it only hits the second target", async () => {
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ describe("Moves - Mat Block", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("should protect the user and allies from attack moves", async () => {
|
test("should protect the user and allies from attack moves", async () => {
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerField();
|
const leadPokemon = game.scene.getPlayerField();
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ describe("Moves - Mat Block", () => {
|
|||||||
test("should not protect the user and allies from status moves", async () => {
|
test("should not protect the user and allies from status moves", async () => {
|
||||||
game.override.enemyMoveset([Moves.GROWL]);
|
game.override.enemyMoveset([Moves.GROWL]);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerField();
|
const leadPokemon = game.scene.getPlayerField();
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ describe("Moves - Mat Block", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("should fail when used after the first turn", async () => {
|
test("should fail when used after the first turn", async () => {
|
||||||
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerField();
|
const leadPokemon = game.scene.getPlayerField();
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ describe("Multi-target damage reduction", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should reduce d.gleam damage when multiple enemies but not tackle", async () => {
|
it("should reduce d.gleam damage when multiple enemies but not tackle", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP, Species.FEEBAS]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]);
|
||||||
|
|
||||||
const [enemy1, enemy2] = game.scene.getEnemyField();
|
const [enemy1, enemy2] = game.scene.getEnemyField();
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ describe("Multi-target damage reduction", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should reduce earthquake when more than one pokemon other than user is not fainted", async () => {
|
it("should reduce earthquake when more than one pokemon other than user is not fainted", async () => {
|
||||||
await game.startBattle([Species.MAGIKARP, Species.FEEBAS]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]);
|
||||||
|
|
||||||
const player2 = game.scene.getPlayerParty()[1];
|
const player2 = game.scene.getPlayerParty()[1];
|
||||||
const [enemy1, enemy2] = game.scene.getEnemyField();
|
const [enemy1, enemy2] = game.scene.getEnemyField();
|
||||||
|
@ -35,7 +35,7 @@ describe("Moves - Parting Shot", () => {
|
|||||||
|
|
||||||
test("Parting Shot when buffed by prankster should fail against dark types", async () => {
|
test("Parting Shot when buffed by prankster should fail against dark types", async () => {
|
||||||
game.override.enemySpecies(Species.POOCHYENA).ability(Abilities.PRANKSTER);
|
game.override.enemySpecies(Species.POOCHYENA).ability(Abilities.PRANKSTER);
|
||||||
await game.startBattle([Species.MURKROW, Species.MEOWTH]);
|
await game.classicMode.startBattle([Species.MURKROW, Species.MEOWTH]);
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
expect(enemyPokemon).toBeDefined();
|
expect(enemyPokemon).toBeDefined();
|
||||||
@ -50,7 +50,7 @@ describe("Moves - Parting Shot", () => {
|
|||||||
|
|
||||||
test("Parting shot should fail against good as gold ability", async () => {
|
test("Parting shot should fail against good as gold ability", async () => {
|
||||||
game.override.enemySpecies(Species.GHOLDENGO).enemyAbility(Abilities.GOOD_AS_GOLD);
|
game.override.enemySpecies(Species.GHOLDENGO).enemyAbility(Abilities.GOOD_AS_GOLD);
|
||||||
await game.startBattle([Species.MURKROW, Species.MEOWTH]);
|
await game.classicMode.startBattle([Species.MURKROW, Species.MEOWTH]);
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
expect(enemyPokemon).toBeDefined();
|
expect(enemyPokemon).toBeDefined();
|
||||||
@ -68,7 +68,13 @@ describe("Moves - Parting Shot", () => {
|
|||||||
"Parting shot should fail if target is -6/-6 de-buffed",
|
"Parting shot should fail if target is -6/-6 de-buffed",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.moveset([Moves.PARTING_SHOT, Moves.MEMENTO, Moves.SPLASH]);
|
game.override.moveset([Moves.PARTING_SHOT, Moves.MEMENTO, Moves.SPLASH]);
|
||||||
await game.startBattle([Species.MEOWTH, Species.MEOWTH, Species.MEOWTH, Species.MURKROW, Species.ABRA]);
|
await game.classicMode.startBattle([
|
||||||
|
Species.MEOWTH,
|
||||||
|
Species.MEOWTH,
|
||||||
|
Species.MEOWTH,
|
||||||
|
Species.MURKROW,
|
||||||
|
Species.ABRA,
|
||||||
|
]);
|
||||||
|
|
||||||
// use Memento 3 times to debuff enemy
|
// use Memento 3 times to debuff enemy
|
||||||
game.move.select(Moves.MEMENTO);
|
game.move.select(Moves.MEMENTO);
|
||||||
@ -111,7 +117,7 @@ describe("Moves - Parting Shot", () => {
|
|||||||
"Parting shot shouldn't allow switch out when mist is active",
|
"Parting shot shouldn't allow switch out when mist is active",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemySpecies(Species.ALTARIA).enemyAbility(Abilities.NONE).enemyMoveset([Moves.MIST]);
|
game.override.enemySpecies(Species.ALTARIA).enemyAbility(Abilities.NONE).enemyMoveset([Moves.MIST]);
|
||||||
await game.startBattle([Species.SNORLAX, Species.MEOWTH]);
|
await game.classicMode.startBattle([Species.SNORLAX, Species.MEOWTH]);
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
expect(enemyPokemon).toBeDefined();
|
expect(enemyPokemon).toBeDefined();
|
||||||
@ -130,7 +136,7 @@ describe("Moves - Parting Shot", () => {
|
|||||||
"Parting shot shouldn't allow switch out against clear body ability",
|
"Parting shot shouldn't allow switch out against clear body ability",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemySpecies(Species.TENTACOOL).enemyAbility(Abilities.CLEAR_BODY);
|
game.override.enemySpecies(Species.TENTACOOL).enemyAbility(Abilities.CLEAR_BODY);
|
||||||
await game.startBattle([Species.SNORLAX, Species.MEOWTH]);
|
await game.classicMode.startBattle([Species.SNORLAX, Species.MEOWTH]);
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
expect(enemyPokemon).toBeDefined();
|
expect(enemyPokemon).toBeDefined();
|
||||||
@ -148,7 +154,7 @@ describe("Moves - Parting Shot", () => {
|
|||||||
// TODO: fix this bug to pass the test!
|
// TODO: fix this bug to pass the test!
|
||||||
"Parting shot should de-buff and not fail if no party available to switch - party size 1",
|
"Parting shot should de-buff and not fail if no party available to switch - party size 1",
|
||||||
async () => {
|
async () => {
|
||||||
await game.startBattle([Species.MURKROW]);
|
await game.classicMode.startBattle([Species.MURKROW]);
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
expect(enemyPokemon).toBeDefined();
|
expect(enemyPokemon).toBeDefined();
|
||||||
@ -166,7 +172,7 @@ describe("Moves - Parting Shot", () => {
|
|||||||
// TODO: fix this bug to pass the test!
|
// TODO: fix this bug to pass the test!
|
||||||
"Parting shot regularly not fail if no party available to switch - party fainted",
|
"Parting shot regularly not fail if no party available to switch - party fainted",
|
||||||
async () => {
|
async () => {
|
||||||
await game.startBattle([Species.MURKROW, Species.MEOWTH]);
|
await game.classicMode.startBattle([Species.MURKROW, Species.MEOWTH]);
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
|
|
||||||
// intentionally kill party pokemon, switch to second slot (now 1 party mon is fainted)
|
// intentionally kill party pokemon, switch to second slot (now 1 party mon is fainted)
|
||||||
|
@ -34,7 +34,7 @@ describe("Moves - Power Split", () => {
|
|||||||
|
|
||||||
it("should average the user's ATK and SPATK stats with those of the target", async () => {
|
it("should average the user's ATK and SPATK stats with those of the target", async () => {
|
||||||
game.override.enemyMoveset(Moves.SPLASH);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
await game.startBattle([Species.INDEEDEE]);
|
await game.classicMode.startBattle([Species.INDEEDEE]);
|
||||||
|
|
||||||
const player = game.scene.getPlayerPokemon()!;
|
const player = game.scene.getPlayerPokemon()!;
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
@ -54,7 +54,7 @@ describe("Moves - Power Split", () => {
|
|||||||
|
|
||||||
it("should be idempotent", async () => {
|
it("should be idempotent", async () => {
|
||||||
game.override.enemyMoveset([Moves.POWER_SPLIT]);
|
game.override.enemyMoveset([Moves.POWER_SPLIT]);
|
||||||
await game.startBattle([Species.INDEEDEE]);
|
await game.classicMode.startBattle([Species.INDEEDEE]);
|
||||||
|
|
||||||
const player = game.scene.getPlayerPokemon()!;
|
const player = game.scene.getPlayerPokemon()!;
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
@ -37,7 +37,7 @@ describe("Moves - Purify", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("Purify heals opponent status effect and restores user hp", async () => {
|
test("Purify heals opponent status effect and restores user hp", async () => {
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemyPokemon: EnemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon: EnemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
const playerPokemon: PlayerPokemon = game.scene.getPlayerPokemon()!;
|
const playerPokemon: PlayerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
@ -54,7 +54,7 @@ describe("Moves - Purify", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("Purify does not heal if opponent doesnt have any status effect", async () => {
|
test("Purify does not heal if opponent doesnt have any status effect", async () => {
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const playerPokemon: PlayerPokemon = game.scene.getPlayerPokemon()!;
|
const playerPokemon: PlayerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ describe("Moves - Retaliate", () => {
|
|||||||
|
|
||||||
it("increases power if ally died previous turn", async () => {
|
it("increases power if ally died previous turn", async () => {
|
||||||
vi.spyOn(retaliate, "calculateBattlePower");
|
vi.spyOn(retaliate, "calculateBattlePower");
|
||||||
await game.startBattle([Species.ABRA, Species.COBALION]);
|
await game.classicMode.startBattle([Species.ABRA, Species.COBALION]);
|
||||||
game.move.select(Moves.RETALIATE);
|
game.move.select(Moves.RETALIATE);
|
||||||
await game.phaseInterceptor.to("TurnEndPhase");
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
expect(retaliate.calculateBattlePower).toHaveLastReturnedWith(70);
|
expect(retaliate.calculateBattlePower).toHaveLastReturnedWith(70);
|
||||||
|
@ -42,7 +42,7 @@ describe("Moves - Rollout", () => {
|
|||||||
const turns = 6;
|
const turns = 6;
|
||||||
const dmgHistory: number[] = [];
|
const dmgHistory: number[] = [];
|
||||||
|
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const playerPkm = game.scene.getPlayerParty()[0];
|
const playerPkm = game.scene.getPlayerParty()[0];
|
||||||
vi.spyOn(playerPkm, "stats", "get").mockReturnValue([500000, 1, 1, 1, 1, 1]); // HP, ATK, DEF, SPATK, SPDEF, SPD
|
vi.spyOn(playerPkm, "stats", "get").mockReturnValue([500000, 1, 1, 1, 1, 1]); // HP, ATK, DEF, SPATK, SPDEF, SPD
|
||||||
|
@ -38,7 +38,7 @@ describe("Moves - Shell Trap", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should activate after the user is hit by a physical attack", async () => {
|
it("should activate after the user is hit by a physical attack", async () => {
|
||||||
await game.startBattle([Species.CHARIZARD, Species.TURTONATOR]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.TURTONATOR]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerField();
|
const playerPokemon = game.scene.getPlayerField();
|
||||||
const enemyPokemon = game.scene.getEnemyField();
|
const enemyPokemon = game.scene.getEnemyField();
|
||||||
@ -61,7 +61,7 @@ describe("Moves - Shell Trap", () => {
|
|||||||
it("should fail if the user is only hit by special attacks", async () => {
|
it("should fail if the user is only hit by special attacks", async () => {
|
||||||
game.override.enemyMoveset([Moves.SWIFT]);
|
game.override.enemyMoveset([Moves.SWIFT]);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD, Species.TURTONATOR]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.TURTONATOR]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerField();
|
const playerPokemon = game.scene.getPlayerField();
|
||||||
const enemyPokemon = game.scene.getEnemyField();
|
const enemyPokemon = game.scene.getEnemyField();
|
||||||
@ -84,7 +84,7 @@ describe("Moves - Shell Trap", () => {
|
|||||||
it("should fail if the user isn't hit with any attack", async () => {
|
it("should fail if the user isn't hit with any attack", async () => {
|
||||||
game.override.enemyMoveset(Moves.SPLASH);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD, Species.TURTONATOR]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.TURTONATOR]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerField();
|
const playerPokemon = game.scene.getPlayerField();
|
||||||
const enemyPokemon = game.scene.getEnemyField();
|
const enemyPokemon = game.scene.getEnemyField();
|
||||||
@ -107,7 +107,7 @@ describe("Moves - Shell Trap", () => {
|
|||||||
it("should not activate from an ally's attack", async () => {
|
it("should not activate from an ally's attack", async () => {
|
||||||
game.override.enemyMoveset(Moves.SPLASH);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
|
|
||||||
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerField();
|
const playerPokemon = game.scene.getPlayerField();
|
||||||
const enemyPokemon = game.scene.getEnemyField();
|
const enemyPokemon = game.scene.getEnemyField();
|
||||||
@ -131,7 +131,7 @@ describe("Moves - Shell Trap", () => {
|
|||||||
game.override.battleStyle("single");
|
game.override.battleStyle("single");
|
||||||
vi.spyOn(allMoves[Moves.RAZOR_LEAF], "priority", "get").mockReturnValue(-4);
|
vi.spyOn(allMoves[Moves.RAZOR_LEAF], "priority", "get").mockReturnValue(-4);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.CHARIZARD]);
|
||||||
|
|
||||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
@ -34,7 +34,7 @@ describe("Moves - Speed Swap", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should swap the user's SPD and the target's SPD stats", async () => {
|
it("should swap the user's SPD and the target's SPD stats", async () => {
|
||||||
await game.startBattle([Species.INDEEDEE]);
|
await game.classicMode.startBattle([Species.INDEEDEE]);
|
||||||
|
|
||||||
const player = game.scene.getPlayerPokemon()!;
|
const player = game.scene.getPlayerPokemon()!;
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
@ -32,7 +32,7 @@ describe("Moves - Spikes", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not damage the team that set them", async () => {
|
it("should not damage the team that set them", async () => {
|
||||||
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
|
await game.classicMode.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||||
|
|
||||||
game.move.select(Moves.SPIKES);
|
game.move.select(Moves.SPIKES);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
@ -52,7 +52,7 @@ describe("Moves - Spikes", () => {
|
|||||||
|
|
||||||
it("should damage opposing pokemon that are forced to switch in", async () => {
|
it("should damage opposing pokemon that are forced to switch in", async () => {
|
||||||
game.override.startingWave(5);
|
game.override.startingWave(5);
|
||||||
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
|
await game.classicMode.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||||
|
|
||||||
game.move.select(Moves.SPIKES);
|
game.move.select(Moves.SPIKES);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
@ -66,7 +66,7 @@ describe("Moves - Spikes", () => {
|
|||||||
|
|
||||||
it("should damage opposing pokemon that choose to switch in", async () => {
|
it("should damage opposing pokemon that choose to switch in", async () => {
|
||||||
game.override.startingWave(5);
|
game.override.startingWave(5);
|
||||||
await game.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
|
await game.classicMode.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||||
|
|
||||||
game.move.select(Moves.SPIKES);
|
game.move.select(Moves.SPIKES);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
|
@ -50,7 +50,7 @@ describe("Moves - Spit Up", () => {
|
|||||||
const stacksToSetup = 1;
|
const stacksToSetup = 1;
|
||||||
const expectedPower = 100;
|
const expectedPower = 100;
|
||||||
|
|
||||||
await game.startBattle([Species.ABOMASNOW]);
|
await game.classicMode.startBattle([Species.ABOMASNOW]);
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
pokemon.addTag(BattlerTagType.STOCKPILING);
|
pokemon.addTag(BattlerTagType.STOCKPILING);
|
||||||
@ -72,7 +72,7 @@ describe("Moves - Spit Up", () => {
|
|||||||
const stacksToSetup = 2;
|
const stacksToSetup = 2;
|
||||||
const expectedPower = 200;
|
const expectedPower = 200;
|
||||||
|
|
||||||
await game.startBattle([Species.ABOMASNOW]);
|
await game.classicMode.startBattle([Species.ABOMASNOW]);
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
pokemon.addTag(BattlerTagType.STOCKPILING);
|
pokemon.addTag(BattlerTagType.STOCKPILING);
|
||||||
@ -95,7 +95,7 @@ describe("Moves - Spit Up", () => {
|
|||||||
const stacksToSetup = 3;
|
const stacksToSetup = 3;
|
||||||
const expectedPower = 300;
|
const expectedPower = 300;
|
||||||
|
|
||||||
await game.startBattle([Species.ABOMASNOW]);
|
await game.classicMode.startBattle([Species.ABOMASNOW]);
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
pokemon.addTag(BattlerTagType.STOCKPILING);
|
pokemon.addTag(BattlerTagType.STOCKPILING);
|
||||||
@ -117,7 +117,7 @@ describe("Moves - Spit Up", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("fails without stacks", async () => {
|
it("fails without stacks", async () => {
|
||||||
await game.startBattle([Species.ABOMASNOW]);
|
await game.classicMode.startBattle([Species.ABOMASNOW]);
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ describe("Moves - Spit Up", () => {
|
|||||||
|
|
||||||
describe("restores stat boosts granted by stacks", () => {
|
describe("restores stat boosts granted by stacks", () => {
|
||||||
it("decreases stats based on stored values (both boosts equal)", async () => {
|
it("decreases stats based on stored values (both boosts equal)", async () => {
|
||||||
await game.startBattle([Species.ABOMASNOW]);
|
await game.classicMode.startBattle([Species.ABOMASNOW]);
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
pokemon.addTag(BattlerTagType.STOCKPILING);
|
pokemon.addTag(BattlerTagType.STOCKPILING);
|
||||||
@ -169,7 +169,7 @@ describe("Moves - Spit Up", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("decreases stats based on stored values (different boosts)", async () => {
|
it("decreases stats based on stored values (different boosts)", async () => {
|
||||||
await game.startBattle([Species.ABOMASNOW]);
|
await game.classicMode.startBattle([Species.ABOMASNOW]);
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
pokemon.addTag(BattlerTagType.STOCKPILING);
|
pokemon.addTag(BattlerTagType.STOCKPILING);
|
||||||
|
@ -39,7 +39,7 @@ describe("Moves - Stockpile", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("gains a stockpile stack and raises user's DEF and SPDEF stat stages by 1 on each use, fails at max stacks (3)", async () => {
|
it("gains a stockpile stack and raises user's DEF and SPDEF stat stages by 1 on each use, fails at max stacks (3)", async () => {
|
||||||
await game.startBattle([Species.ABOMASNOW]);
|
await game.classicMode.startBattle([Species.ABOMASNOW]);
|
||||||
|
|
||||||
const user = game.scene.getPlayerPokemon()!;
|
const user = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ describe("Moves - Stockpile", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("gains a stockpile stack even if user's DEF and SPDEF stat stages are at +6", async () => {
|
it("gains a stockpile stack even if user's DEF and SPDEF stat stages are at +6", async () => {
|
||||||
await game.startBattle([Species.ABOMASNOW]);
|
await game.classicMode.startBattle([Species.ABOMASNOW]);
|
||||||
|
|
||||||
const user = game.scene.getPlayerPokemon()!;
|
const user = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ describe("Moves - Swallow", () => {
|
|||||||
const stacksToSetup = 1;
|
const stacksToSetup = 1;
|
||||||
const expectedHeal = 25;
|
const expectedHeal = 25;
|
||||||
|
|
||||||
await game.startBattle([Species.ABOMASNOW]);
|
await game.classicMode.startBattle([Species.ABOMASNOW]);
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
vi.spyOn(pokemon, "getMaxHp").mockReturnValue(100);
|
vi.spyOn(pokemon, "getMaxHp").mockReturnValue(100);
|
||||||
@ -70,7 +70,7 @@ describe("Moves - Swallow", () => {
|
|||||||
const stacksToSetup = 2;
|
const stacksToSetup = 2;
|
||||||
const expectedHeal = 50;
|
const expectedHeal = 50;
|
||||||
|
|
||||||
await game.startBattle([Species.ABOMASNOW]);
|
await game.classicMode.startBattle([Species.ABOMASNOW]);
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
vi.spyOn(pokemon, "getMaxHp").mockReturnValue(100);
|
vi.spyOn(pokemon, "getMaxHp").mockReturnValue(100);
|
||||||
@ -98,7 +98,7 @@ describe("Moves - Swallow", () => {
|
|||||||
const stacksToSetup = 3;
|
const stacksToSetup = 3;
|
||||||
const expectedHeal = 100;
|
const expectedHeal = 100;
|
||||||
|
|
||||||
await game.startBattle([Species.ABOMASNOW]);
|
await game.classicMode.startBattle([Species.ABOMASNOW]);
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
vi.spyOn(pokemon, "getMaxHp").mockReturnValue(100);
|
vi.spyOn(pokemon, "getMaxHp").mockReturnValue(100);
|
||||||
@ -125,7 +125,7 @@ describe("Moves - Swallow", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("fails without stacks", async () => {
|
it("fails without stacks", async () => {
|
||||||
await game.startBattle([Species.ABOMASNOW]);
|
await game.classicMode.startBattle([Species.ABOMASNOW]);
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ describe("Moves - Swallow", () => {
|
|||||||
|
|
||||||
describe("restores stat stage boosts granted by stacks", () => {
|
describe("restores stat stage boosts granted by stacks", () => {
|
||||||
it("decreases stats based on stored values (both boosts equal)", async () => {
|
it("decreases stats based on stored values (both boosts equal)", async () => {
|
||||||
await game.startBattle([Species.ABOMASNOW]);
|
await game.classicMode.startBattle([Species.ABOMASNOW]);
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
pokemon.addTag(BattlerTagType.STOCKPILING);
|
pokemon.addTag(BattlerTagType.STOCKPILING);
|
||||||
@ -173,7 +173,7 @@ describe("Moves - Swallow", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("lower stat stages based on stored values (different boosts)", async () => {
|
it("lower stat stages based on stored values (different boosts)", async () => {
|
||||||
await game.startBattle([Species.ABOMASNOW]);
|
await game.classicMode.startBattle([Species.ABOMASNOW]);
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
pokemon.addTag(BattlerTagType.STOCKPILING);
|
pokemon.addTag(BattlerTagType.STOCKPILING);
|
||||||
|
@ -36,7 +36,7 @@ describe("Moves - Tackle", () => {
|
|||||||
it("TACKLE against ghost", async () => {
|
it("TACKLE against ghost", async () => {
|
||||||
const moveToUse = Moves.TACKLE;
|
const moveToUse = Moves.TACKLE;
|
||||||
game.override.enemySpecies(Species.GENGAR);
|
game.override.enemySpecies(Species.GENGAR);
|
||||||
await game.startBattle([Species.MIGHTYENA]);
|
await game.classicMode.startBattle([Species.MIGHTYENA]);
|
||||||
const hpOpponent = game.scene.currentBattle.enemyParty[0].hp;
|
const hpOpponent = game.scene.currentBattle.enemyParty[0].hp;
|
||||||
game.move.select(moveToUse);
|
game.move.select(moveToUse);
|
||||||
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnEndPhase);
|
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnEndPhase);
|
||||||
@ -46,7 +46,7 @@ describe("Moves - Tackle", () => {
|
|||||||
|
|
||||||
it("TACKLE against not resistant", async () => {
|
it("TACKLE against not resistant", async () => {
|
||||||
const moveToUse = Moves.TACKLE;
|
const moveToUse = Moves.TACKLE;
|
||||||
await game.startBattle([Species.MIGHTYENA]);
|
await game.classicMode.startBattle([Species.MIGHTYENA]);
|
||||||
game.scene.currentBattle.enemyParty[0].stats[Stat.DEF] = 50;
|
game.scene.currentBattle.enemyParty[0].stats[Stat.DEF] = 50;
|
||||||
game.scene.getPlayerParty()[0].stats[Stat.ATK] = 50;
|
game.scene.getPlayerParty()[0].stats[Stat.ATK] = 50;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ describe("Moves - Tail whip", () => {
|
|||||||
|
|
||||||
it("should lower DEF stat stage by 1", async () => {
|
it("should lower DEF stat stage by 1", async () => {
|
||||||
const moveToUse = Moves.TAIL_WHIP;
|
const moveToUse = Moves.TAIL_WHIP;
|
||||||
await game.startBattle([Species.MIGHTYENA, Species.MIGHTYENA]);
|
await game.classicMode.startBattle([Species.MIGHTYENA, Species.MIGHTYENA]);
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
expect(enemyPokemon.getStatStage(Stat.DEF)).toBe(0);
|
expect(enemyPokemon.getStatStage(Stat.DEF)).toBe(0);
|
||||||
|
@ -33,7 +33,7 @@ describe("Moves - Thousand Arrows", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("move should hit and ground Flying-type targets", async () => {
|
it("move should hit and ground Flying-type targets", async () => {
|
||||||
await game.startBattle([Species.ILLUMISE]);
|
await game.classicMode.startBattle([Species.ILLUMISE]);
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ describe("Moves - Thousand Arrows", () => {
|
|||||||
game.override.enemySpecies(Species.SNORLAX);
|
game.override.enemySpecies(Species.SNORLAX);
|
||||||
game.override.enemyAbility(Abilities.LEVITATE);
|
game.override.enemyAbility(Abilities.LEVITATE);
|
||||||
|
|
||||||
await game.startBattle([Species.ILLUMISE]);
|
await game.classicMode.startBattle([Species.ILLUMISE]);
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ describe("Moves - Thousand Arrows", () => {
|
|||||||
it("move should hit and ground targets under the effects of Magnet Rise", async () => {
|
it("move should hit and ground targets under the effects of Magnet Rise", async () => {
|
||||||
game.override.enemySpecies(Species.SNORLAX);
|
game.override.enemySpecies(Species.SNORLAX);
|
||||||
|
|
||||||
await game.startBattle([Species.ILLUMISE]);
|
await game.classicMode.startBattle([Species.ILLUMISE]);
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ describe("Moves - Thunder Wave", () => {
|
|||||||
|
|
||||||
it("paralyzes non-statused Pokemon that are not Ground types", async () => {
|
it("paralyzes non-statused Pokemon that are not Ground types", async () => {
|
||||||
game.override.enemySpecies(Species.MAGIKARP);
|
game.override.enemySpecies(Species.MAGIKARP);
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemyPokemon: EnemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon: EnemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ describe("Moves - Thunder Wave", () => {
|
|||||||
|
|
||||||
it("does not paralyze if the Pokemon is a Ground-type", async () => {
|
it("does not paralyze if the Pokemon is a Ground-type", async () => {
|
||||||
game.override.enemySpecies(Species.DIGLETT);
|
game.override.enemySpecies(Species.DIGLETT);
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemyPokemon: EnemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon: EnemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ describe("Moves - Thunder Wave", () => {
|
|||||||
|
|
||||||
it("does not paralyze if the Pokemon already has a status effect", async () => {
|
it("does not paralyze if the Pokemon already has a status effect", async () => {
|
||||||
game.override.enemySpecies(Species.MAGIKARP).enemyStatusEffect(StatusEffect.BURN);
|
game.override.enemySpecies(Species.MAGIKARP).enemyStatusEffect(StatusEffect.BURN);
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemyPokemon: EnemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon: EnemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ describe("Moves - Thunder Wave", () => {
|
|||||||
|
|
||||||
it("affects Ground types if the user has Normalize", async () => {
|
it("affects Ground types if the user has Normalize", async () => {
|
||||||
game.override.ability(Abilities.NORMALIZE).enemySpecies(Species.DIGLETT);
|
game.override.ability(Abilities.NORMALIZE).enemySpecies(Species.DIGLETT);
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemyPokemon: EnemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon: EnemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ describe("Moves - Thunder Wave", () => {
|
|||||||
|
|
||||||
it("does not affect Ghost types if the user has Normalize", async () => {
|
it("does not affect Ghost types if the user has Normalize", async () => {
|
||||||
game.override.ability(Abilities.NORMALIZE).enemySpecies(Species.HAUNTER);
|
game.override.ability(Abilities.NORMALIZE).enemySpecies(Species.HAUNTER);
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemyPokemon: EnemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon: EnemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ describe("Moves - Wide Guard", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("should protect the user and allies from multi-target attack moves", async () => {
|
test("should protect the user and allies from multi-target attack moves", async () => {
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerField();
|
const leadPokemon = game.scene.getPlayerField();
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ describe("Moves - Wide Guard", () => {
|
|||||||
test("should protect the user and allies from multi-target status moves", async () => {
|
test("should protect the user and allies from multi-target status moves", async () => {
|
||||||
game.override.enemyMoveset([Moves.GROWL]);
|
game.override.enemyMoveset([Moves.GROWL]);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerField();
|
const leadPokemon = game.scene.getPlayerField();
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ describe("Moves - Wide Guard", () => {
|
|||||||
test("should not protect the user and allies from single-target moves", async () => {
|
test("should not protect the user and allies from single-target moves", async () => {
|
||||||
game.override.enemyMoveset([Moves.TACKLE]);
|
game.override.enemyMoveset([Moves.TACKLE]);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerField();
|
const leadPokemon = game.scene.getPlayerField();
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ describe("Moves - Wide Guard", () => {
|
|||||||
test("should protect the user from its ally's multi-target move", async () => {
|
test("should protect the user from its ally's multi-target move", async () => {
|
||||||
game.override.enemyMoveset([Moves.SPLASH]);
|
game.override.enemyMoveset([Moves.SPLASH]);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerField();
|
const leadPokemon = game.scene.getPlayerField();
|
||||||
const enemyPokemon = game.scene.getEnemyField();
|
const enemyPokemon = game.scene.getEnemyField();
|
||||||
|
@ -32,7 +32,6 @@ import type PartyUiHandler from "#app/ui/party-ui-handler";
|
|||||||
import type TargetSelectUiHandler from "#app/ui/target-select-ui-handler";
|
import type TargetSelectUiHandler from "#app/ui/target-select-ui-handler";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import { isNullOrUndefined } from "#app/utils/common";
|
import { isNullOrUndefined } from "#app/utils/common";
|
||||||
import { BattleStyle } from "#enums/battle-style";
|
|
||||||
import { Button } from "#enums/buttons";
|
import { Button } from "#enums/buttons";
|
||||||
import { ExpGainsSpeed } from "#enums/exp-gains-speed";
|
import { ExpGainsSpeed } from "#enums/exp-gains-speed";
|
||||||
import { ExpNotification } from "#enums/exp-notification";
|
import { ExpNotification } from "#enums/exp-notification";
|
||||||
@ -271,42 +270,6 @@ export default class GameManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use `game.classicMode.startBattle()` or `game.dailyMode.startBattle()` instead
|
|
||||||
*
|
|
||||||
* Transitions to the start of a battle.
|
|
||||||
* @param species - Optional array of species to start the battle with.
|
|
||||||
* @returns A promise that resolves when the battle is started.
|
|
||||||
*/
|
|
||||||
async startBattle(species?: Species[]) {
|
|
||||||
await this.classicMode.runToSummon(species);
|
|
||||||
|
|
||||||
if (this.scene.battleStyle === BattleStyle.SWITCH) {
|
|
||||||
this.onNextPrompt(
|
|
||||||
"CheckSwitchPhase",
|
|
||||||
UiMode.CONFIRM,
|
|
||||||
() => {
|
|
||||||
this.setMode(UiMode.MESSAGE);
|
|
||||||
this.endPhase();
|
|
||||||
},
|
|
||||||
() => this.isCurrentPhase(CommandPhase) || this.isCurrentPhase(TurnInitPhase),
|
|
||||||
);
|
|
||||||
|
|
||||||
this.onNextPrompt(
|
|
||||||
"CheckSwitchPhase",
|
|
||||||
UiMode.CONFIRM,
|
|
||||||
() => {
|
|
||||||
this.setMode(UiMode.MESSAGE);
|
|
||||||
this.endPhase();
|
|
||||||
},
|
|
||||||
() => this.isCurrentPhase(CommandPhase) || this.isCurrentPhase(TurnInitPhase),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.phaseInterceptor.to(CommandPhase);
|
|
||||||
console.log("==================[New Turn]==================");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emulate a player's target selection after a move is chosen, usually called automatically by {@linkcode MoveHelper.select}.
|
* Emulate a player's target selection after a move is chosen, usually called automatically by {@linkcode MoveHelper.select}.
|
||||||
* Will trigger during the next {@linkcode SelectTargetPhase}
|
* Will trigger during the next {@linkcode SelectTargetPhase}
|
||||||
|
Loading…
Reference in New Issue
Block a user