Removed unneeded duplicate entries from movesets

This commit is contained in:
Bertie690 2025-05-04 11:10:23 -04:00
parent e1be360e74
commit 566bdf6c89
34 changed files with 308 additions and 323 deletions

View File

@ -54,10 +54,7 @@ describe("Abilities - Contrary", () => {
}); });
it("should block negative effects", async () => { it("should block negative effects", async () => {
game.override game.override.enemyPassiveAbility(Abilities.CLEAR_BODY).enemyMoveset(Moves.HOWL).moveset([Moves.SPLASH]);
.enemyPassiveAbility(Abilities.CLEAR_BODY)
.enemyMoveset([Moves.HOWL, Moves.HOWL, Moves.HOWL, Moves.HOWL])
.moveset([Moves.SPLASH]);
await game.classicMode.startBattle([Species.SLOWBRO]); await game.classicMode.startBattle([Species.SLOWBRO]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;

View File

@ -106,8 +106,7 @@ describe("Abilities - Ice Face", () => {
}); });
it("transforms to Ice Face when Hail or Snow starts", async () => { it("transforms to Ice Face when Hail or Snow starts", async () => {
game.override.moveset([Moves.QUICK_ATTACK]); game.override.moveset([Moves.QUICK_ATTACK]).enemyMoveset(Moves.HAIL);
game.override.enemyMoveset([Moves.HAIL, Moves.HAIL, Moves.HAIL, Moves.HAIL]);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
@ -128,8 +127,7 @@ describe("Abilities - Ice Face", () => {
}); });
it("transforms to Ice Face when summoned on arena with active Snow or Hail", async () => { it("transforms to Ice Face when summoned on arena with active Snow or Hail", async () => {
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); game.override.enemyMoveset(Moves.TACKLE).moveset([Moves.SNOWSCAPE]);
game.override.moveset([Moves.SNOWSCAPE]);
await game.classicMode.startBattle([Species.EISCUE, Species.NINJASK]); await game.classicMode.startBattle([Species.EISCUE, Species.NINJASK]);
@ -155,8 +153,7 @@ describe("Abilities - Ice Face", () => {
}); });
it("will not revert to its Ice Face if there is already Hail when it changes into Noice", async () => { it("will not revert to its Ice Face if there is already Hail when it changes into Noice", async () => {
game.override.enemySpecies(Species.SHUCKLE); game.override.enemySpecies(Species.SHUCKLE).enemyMoveset(Moves.TACKLE);
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
await game.classicMode.startBattle([Species.EISCUE]); await game.classicMode.startBattle([Species.EISCUE]);
@ -175,7 +172,7 @@ describe("Abilities - Ice Face", () => {
}); });
it("persists form change when switched out", async () => { it("persists form change when switched out", async () => {
game.override.enemyMoveset([Moves.QUICK_ATTACK, Moves.QUICK_ATTACK, Moves.QUICK_ATTACK, Moves.QUICK_ATTACK]); game.override.enemyMoveset(Moves.QUICK_ATTACK);
await game.classicMode.startBattle([Species.EISCUE, Species.MAGIKARP]); await game.classicMode.startBattle([Species.EISCUE, Species.MAGIKARP]);

View File

@ -29,11 +29,12 @@ describe("Abilities - Libero", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.ability(Abilities.LIBERO); .battleStyle("single")
game.override.startingLevel(100); .ability(Abilities.LIBERO)
game.override.enemySpecies(Species.RATTATA); .startingLevel(100)
game.override.enemyMoveset([Moves.ENDURE, Moves.ENDURE, Moves.ENDURE, Moves.ENDURE]); .enemySpecies(Species.RATTATA)
.enemyMoveset(Moves.ENDURE);
}); });
test("ability applies and changes a pokemon's type", async () => { test("ability applies and changes a pokemon's type", async () => {
@ -173,8 +174,7 @@ describe("Abilities - Libero", () => {
}); });
test("ability applies correctly even if the pokemon's move is protected against", async () => { test("ability applies correctly even if the pokemon's move is protected against", async () => {
game.override.moveset([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]).enemyMoveset(Moves.PROTECT);
game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);

View File

@ -1,11 +1,12 @@
import { BattlerIndex } from "#app/battle";
import { ArenaTagSide, getArenaTag } from "#app/data/arena-tag"; import { ArenaTagSide, getArenaTag } from "#app/data/arena-tag";
import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect"; import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect";
import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { ArenaTagType } from "#enums/arena-tag-type"; import { ArenaTagType } from "#enums/arena-tag-type";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { Stat } from "#enums/stat";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
import { WeatherType } from "#enums/weather-type"; import { WeatherType } from "#enums/weather-type";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
@ -55,7 +56,7 @@ describe("Abilities - Magic Guard", () => {
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -66,30 +67,36 @@ describe("Abilities - Magic Guard", () => {
expect(enemyPokemon.hp).toBeLessThan(enemyPokemon.getMaxHp()); expect(enemyPokemon.hp).toBeLessThan(enemyPokemon.getMaxHp());
}); });
it("ability should prevent damage caused by status effects but other non-damage effects still apply", async () => { it("should retain catch boost, toxic turn count and burn attack drops", async () => {
//Toxic keeps track of the turn counters -> important that Magic Guard keeps track of post-Toxic turns game.override.statusEffect(StatusEffect.TOXIC);
game.override.statusEffect(StatusEffect.POISON); await game.classicMode.startBattle([Species.MAGIKARP]);
await game.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);
/**
* Expect:
* - The player Pokemon (with Magic Guard) has not taken damage from poison
* - The Pokemon's CatchRateMultiplier should be 1.5
*/
expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp()); expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp());
expect(leadPokemon.status).toBeTruthy();
expect(leadPokemon.status!.toxicTurnCount).toBeGreaterThan(0);
expect(getStatusEffectCatchRateMultiplier(leadPokemon.status!.effect)).toBe(1.5); expect(getStatusEffectCatchRateMultiplier(leadPokemon.status!.effect)).toBe(1.5);
await game.toNextTurn();
// give ourselves burn and ensure our attack indeed dropped
const prevAtk = leadPokemon.getEffectiveStat(Stat.ATK);
leadPokemon.resetStatus();
expect(leadPokemon.status).toBeFalsy();
leadPokemon.trySetStatus(StatusEffect.BURN);
expect(leadPokemon.status).toBeTruthy();
const burntAtk = leadPokemon.getEffectiveStat(Stat.ATK);
expect(burntAtk).toBeCloseTo(prevAtk / 2, 1);
}); });
it("ability effect should not persist when the ability is replaced", async () => { it("ability effect should not persist when the ability is replaced", async () => {
game.override.enemyMoveset([Moves.WORRY_SEED, Moves.WORRY_SEED, Moves.WORRY_SEED, Moves.WORRY_SEED]); game.override.enemyMoveset(Moves.WORRY_SEED).statusEffect(StatusEffect.POISON);
game.override.statusEffect(StatusEffect.POISON);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -97,7 +104,7 @@ describe("Abilities - Magic Guard", () => {
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -116,7 +123,7 @@ describe("Abilities - Magic Guard", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -141,7 +148,7 @@ describe("Abilities - Magic Guard", () => {
const toxicStartCounter = enemyPokemon.status!.toxicTurnCount; const toxicStartCounter = enemyPokemon.status!.toxicTurnCount;
//should be 0 //should be 0
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -166,7 +173,7 @@ describe("Abilities - Magic Guard", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -191,7 +198,7 @@ describe("Abilities - Magic Guard", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -216,7 +223,7 @@ describe("Abilities - Magic Guard", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -238,7 +245,7 @@ describe("Abilities - Magic Guard", () => {
game.move.select(Moves.HIGH_JUMP_KICK); game.move.select(Moves.HIGH_JUMP_KICK);
await game.move.forceMiss(); await game.move.forceMiss();
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -255,7 +262,7 @@ describe("Abilities - Magic Guard", () => {
game.move.select(Moves.TAKE_DOWN); game.move.select(Moves.TAKE_DOWN);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -272,7 +279,7 @@ describe("Abilities - Magic Guard", () => {
game.move.select(Moves.STRUGGLE); game.move.select(Moves.STRUGGLE);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -281,8 +288,7 @@ describe("Abilities - Magic Guard", () => {
expect(leadPokemon.hp).toBeLessThan(leadPokemon.getMaxHp()); expect(leadPokemon.hp).toBeLessThan(leadPokemon.getMaxHp());
}); });
//This tests different move attributes than the recoil tests above it("should prevent 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.startBattle([Species.MAGIKARP]);
@ -290,7 +296,7 @@ describe("Abilities - Magic Guard", () => {
game.move.select(Moves.STEEL_BEAM); game.move.select(Moves.STEEL_BEAM);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -299,17 +305,19 @@ describe("Abilities - Magic Guard", () => {
expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp()); expect(leadPokemon.hp).toBe(leadPokemon.getMaxHp());
}); });
/* it("should not prevent self-damage from confusion", async () => {
it("Magic Guard does not prevent self-damage from confusion", async () => { game.override.enemyMoveset(Moves.CONFUSE_RAY).confusionActivation(true);
await game.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.select(Moves.CHARM); game.move.select(Moves.CHARM);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
expect(game.scene.getPlayerPokemon()!.isFullHp()).toBe(false);
}); });
*/
it("Magic Guard does not prevent self-damage from non-attacking moves", async () => { it("should 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.startBattle([Species.MAGIKARP]);
@ -317,7 +325,7 @@ describe("Abilities - Magic Guard", () => {
game.move.select(Moves.BELLY_DRUM); game.move.select(Moves.BELLY_DRUM);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -327,11 +335,7 @@ describe("Abilities - Magic Guard", () => {
}); });
it("Magic Guard prevents damage from abilities with PostTurnHurtIfSleepingAbAttr", async () => { it("Magic Guard prevents damage from abilities with PostTurnHurtIfSleepingAbAttr", async () => {
//Tests the ability Bad Dreams game.override.statusEffect(StatusEffect.SLEEP).enemyMoveset(Moves.SPORE).enemyAbility(Abilities.BAD_DREAMS);
game.override.statusEffect(StatusEffect.SLEEP);
//enemy pokemon is given Spore just in case player pokemon somehow awakens during test
game.override.enemyMoveset([Moves.SPORE, Moves.SPORE, Moves.SPORE, Moves.SPORE]);
game.override.enemyAbility(Abilities.BAD_DREAMS);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -339,7 +343,7 @@ describe("Abilities - Magic Guard", () => {
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -350,10 +354,8 @@ describe("Abilities - Magic Guard", () => {
expect(leadPokemon.status!.effect).toBe(StatusEffect.SLEEP); expect(leadPokemon.status!.effect).toBe(StatusEffect.SLEEP);
}); });
it("Magic Guard prevents damage from abilities with PostFaintContactDamageAbAttr", async () => { it("should prevent damage from abilities with PostFaintContactDamageAbAttr", async () => {
//Tests the abilities Innards Out/Aftermath game.override.moveset([Moves.TACKLE]).enemyAbility(Abilities.AFTERMATH);
game.override.moveset([Moves.TACKLE]);
game.override.enemyAbility(Abilities.AFTERMATH);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);
@ -363,7 +365,7 @@ describe("Abilities - Magic Guard", () => {
enemyPokemon.hp = 1; enemyPokemon.hp = 1;
game.move.select(Moves.TACKLE); game.move.select(Moves.TACKLE);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -386,7 +388,7 @@ describe("Abilities - Magic Guard", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(Moves.TACKLE); game.move.select(Moves.TACKLE);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -409,7 +411,7 @@ describe("Abilities - Magic Guard", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(Moves.ABSORB); game.move.select(Moves.ABSORB);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to("TurnEndPhase");
/** /**
* Expect: * Expect:
@ -428,7 +430,7 @@ describe("Abilities - Magic Guard", () => {
await game.startBattle([Species.MAGIKARP]); await game.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");
/** /**
* Expect: * Expect:

View File

@ -24,13 +24,15 @@ describe("Abilities - Mycelium Might", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.disableCrits(); .battleStyle("single")
game.override.enemySpecies(Species.SHUCKLE); .disableCrits()
game.override.enemyAbility(Abilities.CLEAR_BODY); .enemySpecies(Species.SHUCKLE)
game.override.enemyMoveset([Moves.QUICK_ATTACK, Moves.QUICK_ATTACK, Moves.QUICK_ATTACK, Moves.QUICK_ATTACK]); .enemyAbility(Abilities.CLEAR_BODY)
game.override.ability(Abilities.MYCELIUM_MIGHT);
game.override.moveset([Moves.QUICK_ATTACK, Moves.BABY_DOLL_EYES]); .enemyMoveset(Moves.QUICK_ATTACK)
.ability(Abilities.MYCELIUM_MIGHT)
.moveset([Moves.QUICK_ATTACK, Moves.BABY_DOLL_EYES]);
}); });
/** /**
@ -64,8 +66,8 @@ describe("Abilities - Mycelium Might", () => {
}, 20000); }, 20000);
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);
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();

View File

@ -25,10 +25,11 @@ describe("Abilities - POWER CONSTRUCT", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
const moveToUse = Moves.SPLASH; const moveToUse = Moves.SPLASH;
game.override.battleStyle("single"); game.override
game.override.ability(Abilities.POWER_CONSTRUCT); .battleStyle("single")
game.override.moveset([moveToUse]); .ability(Abilities.POWER_CONSTRUCT)
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); .moveset([moveToUse])
.enemyMoveset(Moves.TACKLE);
}); });
test("check if fainted 50% Power Construct Pokemon switches to base form on arena reset", async () => { test("check if fainted 50% Power Construct Pokemon switches to base form on arena reset", async () => {

View File

@ -29,11 +29,12 @@ describe("Abilities - Protean", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.ability(Abilities.PROTEAN); .battleStyle("single")
game.override.startingLevel(100); .ability(Abilities.PROTEAN)
game.override.enemySpecies(Species.RATTATA); .startingLevel(100)
game.override.enemyMoveset([Moves.ENDURE, Moves.ENDURE, Moves.ENDURE, Moves.ENDURE]); .enemySpecies(Species.RATTATA)
.enemyMoveset(Moves.ENDURE);
}); });
test("ability applies and changes a pokemon's type", async () => { test("ability applies and changes a pokemon's type", async () => {
@ -173,8 +174,7 @@ describe("Abilities - Protean", () => {
}); });
test("ability applies correctly even if the pokemon's move is protected against", async () => { test("ability applies correctly even if the pokemon's move is protected against", async () => {
game.override.moveset([Moves.TACKLE]); game.override.moveset([Moves.TACKLE]).enemyMoveset(Moves.PROTECT);
game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]);
await game.startBattle([Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP]);

View File

@ -28,13 +28,15 @@ describe("Abilities - Sand Veil", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.moveset([Moves.SPLASH]); game.override
game.override.enemySpecies(Species.MEOWSCARADA); .moveset([Moves.SPLASH])
game.override.enemyAbility(Abilities.INSOMNIA); .enemySpecies(Species.MEOWSCARADA)
game.override.enemyMoveset([Moves.TWISTER, Moves.TWISTER, Moves.TWISTER, Moves.TWISTER]); .enemyAbility(Abilities.INSOMNIA)
game.override.startingLevel(100); .enemyMoveset(Moves.TWISTER)
game.override.enemyLevel(100); .startingLevel(100)
game.override.weather(WeatherType.SANDSTORM).battleStyle("double"); .enemyLevel(100)
.weather(WeatherType.SANDSTORM)
.battleStyle("double");
}); });
test("ability should increase the evasiveness of the source", async () => { test("ability should increase the evasiveness of the source", async () => {

View File

@ -25,10 +25,7 @@ describe("Abilities - SCHOOLING", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
const moveToUse = Moves.SPLASH; const moveToUse = Moves.SPLASH;
game.override.battleStyle("single"); game.override.battleStyle("single").ability(Abilities.SCHOOLING).moveset([moveToUse]).enemyMoveset(Moves.TACKLE);
game.override.ability(Abilities.SCHOOLING);
game.override.moveset([moveToUse]);
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
}); });
test("check if fainted pokemon switches to base form on arena reset", async () => { test("check if fainted pokemon switches to base form on arena reset", async () => {

View File

@ -30,8 +30,7 @@ describe("Abilities - Screen Cleaner", () => {
}); });
it("removes Aurora Veil", async () => { it("removes Aurora Veil", async () => {
game.override.moveset([Moves.HAIL]); game.override.moveset([Moves.HAIL]).enemyMoveset(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.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
@ -48,7 +47,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);
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
@ -65,7 +64,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);
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP]); await game.startBattle([Species.MAGIKARP, Species.MAGIKARP]);

View File

@ -22,12 +22,13 @@ describe("Abilities - Stall", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.disableCrits(); .battleStyle("single")
game.override.enemySpecies(Species.REGIELEKI); .disableCrits()
game.override.enemyAbility(Abilities.STALL); .enemySpecies(Species.REGIELEKI)
game.override.enemyMoveset([Moves.QUICK_ATTACK, Moves.QUICK_ATTACK, Moves.QUICK_ATTACK, Moves.QUICK_ATTACK]); .enemyAbility(Abilities.STALL)
game.override.moveset([Moves.QUICK_ATTACK, Moves.TACKLE]); .enemyMoveset(Moves.QUICK_ATTACK)
.moveset([Moves.QUICK_ATTACK, Moves.TACKLE]);
}); });
/** /**

View File

@ -25,11 +25,12 @@ describe("Abilities - Sweet Veil", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
game.override.moveset([Moves.SPLASH, Moves.REST, Moves.YAWN]); .battleStyle("double")
game.override.enemySpecies(Species.MAGIKARP); .moveset([Moves.SPLASH, Moves.REST, Moves.YAWN])
game.override.enemyAbility(Abilities.BALL_FETCH); .enemySpecies(Species.MAGIKARP)
game.override.enemyMoveset([Moves.POWDER, Moves.POWDER, Moves.POWDER, Moves.POWDER]); .enemyAbility(Abilities.BALL_FETCH)
.enemyMoveset(Moves.POWDER);
}); });
it("prevents the user and its allies from falling asleep", async () => { it("prevents the user and its allies from falling asleep", async () => {
@ -56,8 +57,8 @@ 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);
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);

View File

@ -24,12 +24,13 @@ describe("Abilities - Unseen Fist", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.starterSpecies(Species.URSHIFU); .battleStyle("single")
game.override.enemySpecies(Species.SNORLAX); .starterSpecies(Species.URSHIFU)
game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]); .enemySpecies(Species.SNORLAX)
game.override.startingLevel(100); .enemyMoveset(Moves.PROTECT)
game.override.enemyLevel(100); .startingLevel(100)
.enemyLevel(100);
}); });
it("should cause a contact move to ignore Protect", async () => it("should cause a contact move to ignore Protect", async () =>
@ -73,8 +74,7 @@ async function testUnseenFistHitResult(
protectMove: Moves, protectMove: Moves,
shouldSucceed = true, shouldSucceed = true,
): Promise<void> { ): Promise<void> {
game.override.moveset([attackMove]); game.override.moveset([attackMove]).enemyMoveset(protectMove);
game.override.enemyMoveset([protectMove, protectMove, protectMove, protectMove]);
await game.classicMode.startBattle(); await game.classicMode.startBattle();

View File

@ -27,7 +27,7 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { Biome } from "#app/enums/biome"; import { Biome } from "#app/enums/biome";
describe("Test Battle Phase", () => { describe("Test - Battle Phase", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
let game: GameManager; let game: GameManager;
@ -91,28 +91,27 @@ describe("Test Battle Phase", () => {
}, 20000); }, 20000);
it("do attack wave 3 - single battle - regular - OHKO", async () => { it("do attack wave 3 - single battle - regular - OHKO", async () => {
game.override.starterSpecies(Species.MEWTWO); game.override
game.override.enemySpecies(Species.RATTATA); .enemySpecies(Species.RATTATA)
game.override.startingLevel(2000); .startingLevel(2000)
game.override.startingWave(3).battleStyle("single"); .startingWave(3)
game.override.moveset([Moves.TACKLE]); .battleStyle("single")
game.override.enemyAbility(Abilities.HYDRATION); .enemyMoveset(Moves.TACKLE);
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); await game.classicMode.startBattle([Species.MEWTWO]);
await game.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);
it("do attack wave 3 - single battle - regular - NO OHKO with opponent using non damage attack", async () => { it("do attack wave 3 - single battle - regular - NO OHKO with opponent using non damage attack", async () => {
game.override.starterSpecies(Species.MEWTWO); game.override
game.override.enemySpecies(Species.RATTATA); .enemySpecies(Species.RATTATA)
game.override.startingLevel(5); .startingLevel(5)
game.override.startingWave(3); .startingWave(3)
game.override.moveset([Moves.TACKLE]); .moveset([Moves.TACKLE])
game.override.enemyAbility(Abilities.HYDRATION); .enemyAbility(Abilities.HYDRATION)
game.override.enemyMoveset([Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP]); .enemyMoveset(Moves.TAIL_WHIP)
game.override.battleStyle("single"); .battleStyle("single");
await game.startBattle(); await game.classicMode.startBattle([Species.MEWTWO]);
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);
@ -200,7 +199,23 @@ describe("Test Battle Phase", () => {
selectStarterPhase.initBattle(starters); selectStarterPhase.initBattle(starters);
}); });
await game.phaseInterceptor.runFrom(SelectGenderPhase).to(SummonPhase); await game.phaseInterceptor.runFrom(SelectGenderPhase).to(SummonPhase);
}, 20000); });
it.each([
{ name: "1v1", double: false, qty: 1 },
{ name: "2v1", double: false, qty: 2 },
{ name: "2v2", double: true, qty: 2 },
{ name: "4v2", double: true, qty: 4 },
])("should not crash when starting $name battle", async ({ double, qty }) => {
game.override
.battleStyle(double ? "double" : "single")
.enemySpecies(Species.MIGHTYENA)
.enemyAbility(Abilities.HYDRATION)
.ability(Abilities.HYDRATION);
await game.classicMode.startBattle(
[Species.BLASTOISE, Species.CHARIZARD, Species.DARKRAI, Species.GABITE].slice(0, qty),
);
it("2vs1", async () => { it("2vs1", async () => {
game.override.battleStyle("single"); game.override.battleStyle("single");
@ -210,52 +225,21 @@ describe("Test Battle Phase", () => {
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD]); await game.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); });
it("1vs1", async () => {
game.override.battleStyle("single");
game.override.enemySpecies(Species.MIGHTYENA);
game.override.enemyAbility(Abilities.HYDRATION);
game.override.ability(Abilities.HYDRATION);
await game.startBattle([Species.BLASTOISE]);
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
}, 20000);
it("2vs2", async () => {
game.override.battleStyle("double");
game.override.enemySpecies(Species.MIGHTYENA);
game.override.enemyAbility(Abilities.HYDRATION);
game.override.ability(Abilities.HYDRATION);
game.override.startingWave(3);
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD]);
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
}, 20000);
it("4vs2", async () => {
game.override.battleStyle("double");
game.override.enemySpecies(Species.MIGHTYENA);
game.override.enemyAbility(Abilities.HYDRATION);
game.override.ability(Abilities.HYDRATION);
game.override.startingWave(3);
await game.startBattle([Species.BLASTOISE, Species.CHARIZARD, Species.DARKRAI, Species.GABITE]);
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
expect(game.scene.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
}, 20000);
it("kill opponent pokemon", async () => { it("kill opponent pokemon", async () => {
const moveToUse = Moves.SPLASH; const moveToUse = Moves.SPLASH;
game.override.battleStyle("single"); game.override
game.override.starterSpecies(Species.MEWTWO); .battleStyle("single")
game.override.enemySpecies(Species.RATTATA); .starterSpecies(Species.MEWTWO)
game.override.enemyAbility(Abilities.HYDRATION); .enemySpecies(Species.RATTATA)
game.override.ability(Abilities.ZEN_MODE); .enemyAbility(Abilities.HYDRATION)
game.override.startingLevel(2000); .ability(Abilities.ZEN_MODE)
game.override.startingWave(3); .startingLevel(2000)
game.override.moveset([moveToUse]); .startingWave(3)
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); .moveset([moveToUse])
await game.startBattle([Species.DARMANITAN, Species.CHARIZARD]); .enemyMoveset(Moves.TACKLE);
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);
@ -266,16 +250,16 @@ describe("Test Battle Phase", () => {
it("to next turn", async () => { it("to next turn", async () => {
const moveToUse = Moves.SPLASH; const moveToUse = Moves.SPLASH;
game.override.battleStyle("single"); game.override
game.override.starterSpecies(Species.MEWTWO); .battleStyle("single")
game.override.enemySpecies(Species.RATTATA); .enemySpecies(Species.RATTATA)
game.override.enemyAbility(Abilities.HYDRATION); .enemyAbility(Abilities.HYDRATION)
game.override.ability(Abilities.ZEN_MODE); .ability(Abilities.ZEN_MODE)
game.override.startingLevel(2000); .startingLevel(2000)
game.override.startingWave(3); .startingWave(3)
game.override.moveset([moveToUse]); .moveset([moveToUse])
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); .enemyMoveset(Moves.TACKLE);
await game.startBattle(); await game.classicMode.startBattle([Species.MEWTWO]);
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();
@ -293,8 +277,8 @@ describe("Test Battle Phase", () => {
.startingLevel(2000) .startingLevel(2000)
.startingWave(3) .startingWave(3)
.startingBiome(Biome.LAKE) .startingBiome(Biome.LAKE)
.moveset([moveToUse]); .moveset([moveToUse])
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); .enemyMoveset(Moves.TACKLE);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
const waveIndex = game.scene.currentBattle.waveIndex; const waveIndex = game.scene.currentBattle.waveIndex;
game.move.select(moveToUse); game.move.select(moveToUse);

View File

@ -188,9 +188,7 @@ describe("Inverse Battle", () => {
}); });
it("Conversion 2 should change the type to the resistive type - Conversion 2 against Dragonite", async () => { it("Conversion 2 should change the type to the resistive type - Conversion 2 against Dragonite", async () => {
game.override game.override.moveset([Moves.CONVERSION_2]).enemyMoveset(Moves.DRAGON_CLAW);
.moveset([Moves.CONVERSION_2])
.enemyMoveset([Moves.DRAGON_CLAW, Moves.DRAGON_CLAW, Moves.DRAGON_CLAW, Moves.DRAGON_CLAW]);
await game.challengeMode.startBattle(); await game.challengeMode.startBattle();

View File

@ -23,12 +23,13 @@ describe("Test Battle Phase", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.enemySpecies(Species.RATTATA); game.override
game.override.startingLevel(2000); .enemySpecies(Species.RATTATA)
game.override.moveset([Moves.TACKLE]); .startingLevel(2000)
game.override.enemyAbility(Abilities.HYDRATION); .moveset([Moves.TACKLE])
game.override.ability(Abilities.HYDRATION); .enemyAbility(Abilities.HYDRATION)
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); .ability(Abilities.HYDRATION)
.enemyMoveset(Moves.TACKLE);
}); });
it("startBattle 2vs1 boss", async () => { it("startBattle 2vs1 boss", async () => {

View File

@ -25,7 +25,7 @@ describe("Items - Leek", () => {
game.override game.override
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]) .enemyMoveset(Moves.SPLASH)
.startingHeldItems([{ name: "LEEK" }]) .startingHeldItems([{ name: "LEEK" }])
.moveset([Moves.TACKLE]) .moveset([Moves.TACKLE])
.battleStyle("single"); .battleStyle("single");

View File

@ -23,14 +23,15 @@ describe("Items - Leftovers", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.startingLevel(2000); .battleStyle("single")
game.override.ability(Abilities.UNNERVE); .startingLevel(2000)
game.override.moveset([Moves.SPLASH]); .ability(Abilities.UNNERVE)
game.override.enemySpecies(Species.SHUCKLE); .moveset([Moves.SPLASH])
game.override.enemyAbility(Abilities.UNNERVE); .enemySpecies(Species.SHUCKLE)
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); .enemyAbility(Abilities.UNNERVE)
game.override.startingHeldItems([{ name: "LEFTOVERS", count: 1 }]); .enemyMoveset(Moves.TACKLE)
.startingHeldItems([{ name: "LEFTOVERS", count: 1 }]);
}); });
it("leftovers works", async () => { it("leftovers works", async () => {

View File

@ -27,13 +27,14 @@ describe("Moves - Astonish", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.moveset([Moves.ASTONISH, Moves.SPLASH]); .battleStyle("single")
game.override.enemySpecies(Species.BLASTOISE); .moveset([Moves.ASTONISH, Moves.SPLASH])
game.override.enemyAbility(Abilities.INSOMNIA); .enemySpecies(Species.BLASTOISE)
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); .enemyAbility(Abilities.INSOMNIA)
game.override.startingLevel(100); .enemyMoveset(Moves.TACKLE)
game.override.enemyLevel(100); .startingLevel(100)
.enemyLevel(100);
vi.spyOn(allMoves[Moves.ASTONISH], "chance", "get").mockReturnValue(100); vi.spyOn(allMoves[Moves.ASTONISH], "chance", "get").mockReturnValue(100);
}); });

View File

@ -36,14 +36,15 @@ describe("Moves - Aurora Veil", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
globalScene = game.scene; globalScene = game.scene;
game.override.battleStyle("single"); game.override
game.override.ability(Abilities.NONE); .battleStyle("single")
game.override.moveset([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]); .ability(Abilities.BALL_FETCH)
game.override.enemyLevel(100); .moveset([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE])
game.override.enemySpecies(Species.MAGIKARP); .enemyLevel(100)
game.override.enemyMoveset([Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL, Moves.AURORA_VEIL]); .enemySpecies(Species.MAGIKARP)
game.override.disableCrits(); .enemyMoveset(Moves.AURORA_VEIL)
game.override.weather(WeatherType.HAIL); .disableCrits()
.weather(WeatherType.HAIL);
}); });
it("reduces damage of physical attacks by half in a single battle", async () => { it("reduces damage of physical attacks by half in a single battle", async () => {

View File

@ -23,13 +23,14 @@ describe("Moves - Double Team", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.moveset([Moves.DOUBLE_TEAM]); .battleStyle("single")
game.override.disableCrits(); .moveset([Moves.DOUBLE_TEAM])
game.override.ability(Abilities.BALL_FETCH); .disableCrits()
game.override.enemySpecies(Species.SHUCKLE); .ability(Abilities.BALL_FETCH)
game.override.enemyAbility(Abilities.BALL_FETCH); .enemySpecies(Species.SHUCKLE)
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); .enemyAbility(Abilities.BALL_FETCH)
.enemyMoveset(Moves.TACKLE);
}); });
it("raises the user's EVA stat stage by 1", async () => { it("raises the user's EVA stat stage by 1", async () => {

View File

@ -29,8 +29,14 @@ describe("Moves - Dynamax Cannon", () => {
dynamaxCannon = allMoves[Moves.DYNAMAX_CANNON]; dynamaxCannon = allMoves[Moves.DYNAMAX_CANNON];
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.moveset([dynamaxCannon.id]); game.override
game.override.startingLevel(200); .moveset(Moves.DYNAMAX_CANNON)
.startingLevel(200)
.levelCap(10)
.battleStyle("single")
.disableCrits()
.enemySpecies(Species.MAGIKARP)
.enemyMoveset(Moves.SPLASH);
// Note that, for Waves 1-10, the level cap is 10 // Note that, for Waves 1-10, the level cap is 10
game.override.startingWave(1); game.override.startingWave(1);

View File

@ -74,9 +74,7 @@ describe("Moves - Flower Shield", () => {
* See semi-vulnerable state tags. {@linkcode SemiInvulnerableTag} * See semi-vulnerable state tags. {@linkcode SemiInvulnerableTag}
*/ */
it("does not raise DEF stat stage for a Pokemon in semi-vulnerable state", async () => { it("does not raise DEF stat stage for a Pokemon in semi-vulnerable state", async () => {
game.override.enemySpecies(Species.PARAS); game.override.enemySpecies(Species.PARAS).enemyMoveset(Moves.DIG).enemyLevel(50);
game.override.enemyMoveset([Moves.DIG, Moves.DIG, Moves.DIG, Moves.DIG]);
game.override.enemyLevel(50);
await game.startBattle([Species.CHERRIM]); await game.startBattle([Species.CHERRIM]);
const paras = game.scene.getEnemyPokemon()!; const paras = game.scene.getEnemyPokemon()!;

View File

@ -27,7 +27,7 @@ describe("Moves - Freezy Frost", () => {
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.RATTATA) .enemySpecies(Species.RATTATA)
.enemyLevel(100) .enemyLevel(100)
.enemyMoveset([Moves.HOWL, Moves.HOWL, Moves.HOWL, Moves.HOWL]) .enemyMoveset(Moves.HOWL)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(Abilities.BALL_FETCH)
.startingLevel(100) .startingLevel(100)
.moveset([Moves.FREEZY_FROST, Moves.HOWL, Moves.SPLASH]) .moveset([Moves.FREEZY_FROST, Moves.HOWL, Moves.SPLASH])
@ -55,7 +55,7 @@ describe("Moves - Freezy Frost", () => {
}); });
it("should clear all stat changes even when enemy uses the move", async () => { it("should clear all stat changes even when enemy uses the move", async () => {
game.override.enemyMoveset([Moves.FREEZY_FROST, Moves.FREEZY_FROST, Moves.FREEZY_FROST, Moves.FREEZY_FROST]); game.override.enemyMoveset(Moves.FREEZY_FROST);
await game.classicMode.startBattle([Species.SHUCKLE]); // Shuckle for slower Howl on first turn so Freezy Frost doesn't affect it. await game.classicMode.startBattle([Species.SHUCKLE]); // Shuckle for slower Howl on first turn so Freezy Frost doesn't affect it.
const user = game.scene.getPlayerPokemon()!; const user = game.scene.getPlayerPokemon()!;

View File

@ -23,16 +23,15 @@ describe("Moves - Fusion Bolt", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.moveset([fusionBolt]); game.override
game.override.startingLevel(1); .moveset([fusionBolt])
.startingLevel(1)
game.override.enemySpecies(Species.RESHIRAM); .enemySpecies(Species.RESHIRAM)
game.override.enemyAbility(Abilities.ROUGH_SKIN); .enemyAbility(Abilities.ROUGH_SKIN)
game.override.enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); .enemyMoveset(Moves.SPLASH)
.battleStyle("single")
game.override.battleStyle("single"); .startingWave(97)
game.override.startingWave(97); .disableCrits();
game.override.disableCrits();
}); });
it("should not make contact", async () => { it("should not make contact", async () => {

View File

@ -24,15 +24,14 @@ describe("Moves - Fusion Flare", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.moveset([fusionFlare]); game.override
game.override.startingLevel(1); .moveset([fusionFlare])
.startingLevel(1)
game.override.enemySpecies(Species.RATTATA); .enemySpecies(Species.RATTATA)
game.override.enemyMoveset([Moves.REST, Moves.REST, Moves.REST, Moves.REST]); .enemyMoveset(Moves.REST)
.battleStyle("single")
game.override.battleStyle("single"); .startingWave(97)
game.override.startingWave(97); .disableCrits();
game.override.disableCrits();
}); });
it("should thaw freeze status condition", async () => { it("should thaw freeze status condition", async () => {

View File

@ -33,15 +33,14 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
fusionFlare = allMoves[Moves.FUSION_FLARE]; fusionFlare = allMoves[Moves.FUSION_FLARE];
fusionBolt = allMoves[Moves.FUSION_BOLT]; fusionBolt = allMoves[Moves.FUSION_BOLT];
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.moveset([fusionFlare.id, fusionBolt.id]); game.override
game.override.startingLevel(1); .moveset([fusionFlare.id, fusionBolt.id])
.startingLevel(1)
game.override.enemySpecies(Species.RESHIRAM); .enemySpecies(Species.RESHIRAM)
game.override.enemyMoveset([Moves.REST, Moves.REST, Moves.REST, Moves.REST]); .enemyMoveset(Moves.REST)
.battleStyle("double")
game.override.battleStyle("double"); .startingWave(97)
game.override.startingWave(97); .disableCrits();
game.override.disableCrits();
vi.spyOn(fusionFlare, "calculateBattlePower"); vi.spyOn(fusionFlare, "calculateBattlePower");
vi.spyOn(fusionBolt, "calculateBattlePower"); vi.spyOn(fusionBolt, "calculateBattlePower");
@ -113,7 +112,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
}, 20000); }, 20000);
it("FUSION_FLARE should not double power of subsequent FUSION_BOLT if a move succeeded in between", async () => { it("FUSION_FLARE should not double power of subsequent FUSION_BOLT if a move succeeded in between", async () => {
game.override.enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]); game.override.enemyMoveset(Moves.SPLASH);
await game.classicMode.startBattle([Species.ZEKROM, Species.ZEKROM]); await game.classicMode.startBattle([Species.ZEKROM, Species.ZEKROM]);
game.move.select(fusionFlare.id, 0, BattlerIndex.ENEMY); game.move.select(fusionFlare.id, 0, BattlerIndex.ENEMY);
@ -158,7 +157,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
}, 20000); }, 20000);
it("FUSION_FLARE and FUSION_BOLT alternating throughout turn should double power of subsequent moves", async () => { it("FUSION_FLARE and FUSION_BOLT alternating throughout turn should double power of subsequent moves", async () => {
game.override.enemyMoveset([fusionFlare.id, fusionFlare.id, fusionFlare.id, fusionFlare.id]); game.override.enemyMoveset(fusionFlare.id);
await game.classicMode.startBattle([Species.ZEKROM, Species.ZEKROM]); await game.classicMode.startBattle([Species.ZEKROM, Species.ZEKROM]);
const party = game.scene.getPlayerParty(); const party = game.scene.getPlayerParty();
@ -212,7 +211,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
}, 20000); }, 20000);
it("FUSION_FLARE and FUSION_BOLT alternating throughout turn should double power of subsequent moves if moves are aimed at allies", async () => { it("FUSION_FLARE and FUSION_BOLT alternating throughout turn should double power of subsequent moves if moves are aimed at allies", async () => {
game.override.enemyMoveset([fusionFlare.id, fusionFlare.id, fusionFlare.id, fusionFlare.id]); game.override.enemyMoveset(fusionFlare.id);
await game.classicMode.startBattle([Species.ZEKROM, Species.ZEKROM]); await game.classicMode.startBattle([Species.ZEKROM, Species.ZEKROM]);
const party = game.scene.getPlayerParty(); const party = game.scene.getPlayerParty();

View File

@ -35,13 +35,14 @@ describe("Moves - Light Screen", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
globalScene = game.scene; globalScene = game.scene;
game.override.battleStyle("single"); game.override
game.override.ability(Abilities.NONE); .battleStyle("single")
game.override.moveset([Moves.ABSORB, Moves.DAZZLING_GLEAM, Moves.TACKLE]); .ability(Abilities.BALL_FETCH)
game.override.enemyLevel(100); .moveset([Moves.ABSORB, Moves.DAZZLING_GLEAM, Moves.TACKLE])
game.override.enemySpecies(Species.MAGIKARP); .enemyLevel(100)
game.override.enemyMoveset([Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN, Moves.LIGHT_SCREEN]); .enemySpecies(Species.MAGIKARP)
game.override.disableCrits(); .enemyMoveset(Moves.LIGHT_SCREEN)
.disableCrits();
}); });
it("reduces damage of special attacks by half in a single battle", async () => { it("reduces damage of special attacks by half in a single battle", async () => {

View File

@ -23,13 +23,14 @@ describe("Moves - Magnet Rise", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.starterSpecies(Species.MAGNEZONE); .battleStyle("single")
game.override.enemySpecies(Species.RATTATA); .starterSpecies(Species.MAGNEZONE)
game.override.enemyMoveset([Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN, Moves.DRILL_RUN]); .enemySpecies(Species.RATTATA)
game.override.disableCrits(); .enemyMoveset(Moves.DRILL_RUN)
game.override.enemyLevel(1); .disableCrits()
game.override.moveset([moveToUse, Moves.SPLASH, Moves.GRAVITY, Moves.BATON_PASS]); .enemyLevel(1)
.moveset([moveToUse, Moves.SPLASH, Moves.GRAVITY, Moves.BATON_PASS]);
}); });
it("MAGNET RISE", async () => { it("MAGNET RISE", async () => {

View File

@ -35,13 +35,14 @@ describe("Moves - Reflect", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
globalScene = game.scene; globalScene = game.scene;
game.override.battleStyle("single"); game.override
game.override.ability(Abilities.NONE); .battleStyle("single")
game.override.moveset([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]); .ability(Abilities.NONE)
game.override.enemyLevel(100); .moveset([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE])
game.override.enemySpecies(Species.MAGIKARP); .enemyLevel(100)
game.override.enemyMoveset([Moves.REFLECT, Moves.REFLECT, Moves.REFLECT, Moves.REFLECT]); .enemySpecies(Species.MAGIKARP)
game.override.disableCrits(); .enemyMoveset(Moves.REFLECT)
.disableCrits();
}); });
it("reduces damage of physical attacks by half in a single battle", async () => { it("reduces damage of physical attacks by half in a single battle", async () => {

View File

@ -28,7 +28,7 @@ describe("Moves - Retaliate", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyMoveset([Moves.RETALIATE, Moves.RETALIATE, Moves.RETALIATE, Moves.RETALIATE]) .enemyMoveset(Moves.RETALIATE)
.enemyLevel(100) .enemyLevel(100)
.moveset([Moves.RETALIATE, Moves.SPLASH]) .moveset([Moves.RETALIATE, Moves.SPLASH])
.startingLevel(80) .startingLevel(80)

View File

@ -27,15 +27,14 @@ describe("Moves - Swallow", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
.battleStyle("single")
game.override.enemySpecies(Species.RATTATA); .enemySpecies(Species.RATTATA)
game.override.enemyMoveset(Moves.SPLASH); .enemyMoveset(Moves.SPLASH)
game.override.enemyAbility(Abilities.NONE); .enemyAbility(Abilities.NONE)
game.override.enemyLevel(2000); .enemyLevel(2000)
.moveset(Moves.SWALLOW)
game.override.moveset([Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW, Moves.SWALLOW]); .ability(Abilities.NONE);
game.override.ability(Abilities.NONE);
}); });
describe("consumes all stockpile stacks to heal (scaling with stacks)", () => { describe("consumes all stockpile stacks to heal (scaling with stacks)", () => {

View File

@ -24,13 +24,14 @@ describe("Moves - Tackle", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
const moveToUse = Moves.TACKLE; const moveToUse = Moves.TACKLE;
game.override.battleStyle("single"); game.override
game.override.enemySpecies(Species.MAGIKARP); .battleStyle("single")
game.override.startingLevel(1); .enemySpecies(Species.MAGIKARP)
game.override.startingWave(97); .startingLevel(1)
game.override.moveset([moveToUse]); .startingWave(97)
game.override.enemyMoveset([Moves.GROWTH, Moves.GROWTH, Moves.GROWTH, Moves.GROWTH]); .moveset([moveToUse])
game.override.disableCrits(); .enemyMoveset(Moves.GROWTH)
.disableCrits();
}); });
it("TACKLE against ghost", async () => { it("TACKLE against ghost", async () => {

View File

@ -37,8 +37,7 @@ describe("Moves - Tidy Up", () => {
}); });
it("spikes are cleared", async () => { it("spikes are cleared", async () => {
game.override.moveset([Moves.SPIKES, Moves.TIDY_UP]); game.override.moveset([Moves.SPIKES, Moves.TIDY_UP]).enemyMoveset(Moves.SPIKES);
game.override.enemyMoveset([Moves.SPIKES, Moves.SPIKES, Moves.SPIKES, Moves.SPIKES]);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
game.move.select(Moves.SPIKES); game.move.select(Moves.SPIKES);
@ -49,8 +48,7 @@ describe("Moves - Tidy Up", () => {
}, 20000); }, 20000);
it("stealth rocks are cleared", async () => { it("stealth rocks are cleared", async () => {
game.override.moveset([Moves.STEALTH_ROCK, Moves.TIDY_UP]); game.override.moveset([Moves.STEALTH_ROCK, Moves.TIDY_UP]).enemyMoveset(Moves.STEALTH_ROCK);
game.override.enemyMoveset([Moves.STEALTH_ROCK, Moves.STEALTH_ROCK, Moves.STEALTH_ROCK, Moves.STEALTH_ROCK]);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
game.move.select(Moves.STEALTH_ROCK); game.move.select(Moves.STEALTH_ROCK);
@ -61,8 +59,7 @@ describe("Moves - Tidy Up", () => {
}, 20000); }, 20000);
it("toxic spikes are cleared", async () => { it("toxic spikes are cleared", async () => {
game.override.moveset([Moves.TOXIC_SPIKES, Moves.TIDY_UP]); game.override.moveset([Moves.TOXIC_SPIKES, Moves.TIDY_UP]).enemyMoveset(Moves.TOXIC_SPIKES);
game.override.enemyMoveset([Moves.TOXIC_SPIKES, Moves.TOXIC_SPIKES, Moves.TOXIC_SPIKES, Moves.TOXIC_SPIKES]);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
game.move.select(Moves.TOXIC_SPIKES); game.move.select(Moves.TOXIC_SPIKES);
@ -73,8 +70,7 @@ describe("Moves - Tidy Up", () => {
}, 20000); }, 20000);
it("sticky webs are cleared", async () => { it("sticky webs are cleared", async () => {
game.override.moveset([Moves.STICKY_WEB, Moves.TIDY_UP]); game.override.moveset([Moves.STICKY_WEB, Moves.TIDY_UP]).enemyMoveset(Moves.STICKY_WEB);
game.override.enemyMoveset([Moves.STICKY_WEB, Moves.STICKY_WEB, Moves.STICKY_WEB, Moves.STICKY_WEB]);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
@ -86,8 +82,7 @@ describe("Moves - Tidy Up", () => {
}, 20000); }, 20000);
it("substitutes are cleared", async () => { it("substitutes are cleared", async () => {
game.override.moveset([Moves.SUBSTITUTE, Moves.TIDY_UP]); game.override.moveset([Moves.SUBSTITUTE, Moves.TIDY_UP]).enemyMoveset(Moves.SUBSTITUTE);
game.override.enemyMoveset([Moves.SUBSTITUTE, Moves.SUBSTITUTE, Moves.SUBSTITUTE, Moves.SUBSTITUTE]);
await game.classicMode.startBattle(); await game.classicMode.startBattle();