[Test] Convert game.override calls into chained line where possible

https://github.com/pagefaultgames/pokerogue/pull/5926

* Condensed all overrides into 1 line where possible

I hope I got them all...

* Fixed tests 0.5

* Cleaned up safeguard test to not use outdated code; fixed rest of errors

* Fixed illusion test

* Revert safeguart etst

* Fixed battle tets

* Fixed stuff

* Fixed things2.0

* Fixed import issues

* Revert changes outside of the tests directory

* Revert changes outside of the tests directory

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
Bertie690 2025-06-15 03:40:41 -04:00 committed by GitHub
parent 73e0a2905b
commit 061c987265
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
122 changed files with 877 additions and 993 deletions

View File

@ -26,11 +26,12 @@ describe("Abilities - Battery", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
game.override.enemySpecies(SpeciesId.SHUCKLE); .battleStyle("double")
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemySpecies(SpeciesId.SHUCKLE)
game.override.moveset([MoveId.TACKLE, MoveId.BREAKING_SWIPE, MoveId.SPLASH, MoveId.DAZZLING_GLEAM]); .enemyAbility(AbilityId.BALL_FETCH)
game.override.enemyMoveset(MoveId.SPLASH); .moveset([MoveId.TACKLE, MoveId.BREAKING_SWIPE, MoveId.SPLASH, MoveId.DAZZLING_GLEAM])
.enemyMoveset(MoveId.SPLASH);
}); });
it("raises the power of allies' special moves by 30%", async () => { it("raises the power of allies' special moves by 30%", async () => {

View File

@ -24,10 +24,11 @@ describe("Abilities - COSTAR", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
game.override.ability(AbilityId.COSTAR); .battleStyle("double")
game.override.moveset([MoveId.SPLASH, MoveId.NASTY_PLOT]); .ability(AbilityId.COSTAR)
game.override.enemyMoveset(MoveId.SPLASH); .moveset([MoveId.SPLASH, MoveId.NASTY_PLOT])
.enemyMoveset(MoveId.SPLASH);
}); });
test("ability copies positive stat stages", async () => { test("ability copies positive stat stages", async () => {

View File

@ -66,8 +66,7 @@ describe("Abilities - Disguise", () => {
}); });
it("takes no damage from the first hit of a multihit move and transforms to Busted form, then takes damage from the second hit", async () => { it("takes no damage from the first hit of a multihit move and transforms to Busted form, then takes damage from the second hit", async () => {
game.override.moveset([MoveId.SURGING_STRIKES]); game.override.moveset([MoveId.SURGING_STRIKES]).enemyLevel(5);
game.override.enemyLevel(5);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
const mimikyu = game.scene.getEnemyPokemon()!; const mimikyu = game.scene.getEnemyPokemon()!;
@ -106,8 +105,7 @@ describe("Abilities - Disguise", () => {
}); });
it("persists form change when switched out", async () => { it("persists form change when switched out", async () => {
game.override.enemyMoveset([MoveId.SHADOW_SNEAK]); game.override.enemyMoveset([MoveId.SHADOW_SNEAK]).starterSpecies(0);
game.override.starterSpecies(0);
await game.classicMode.startBattle([SpeciesId.MIMIKYU, SpeciesId.FURRET]); await game.classicMode.startBattle([SpeciesId.MIMIKYU, SpeciesId.FURRET]);
@ -131,8 +129,7 @@ describe("Abilities - Disguise", () => {
}); });
it("persists form change when wave changes with no arena reset", async () => { it("persists form change when wave changes with no arena reset", async () => {
game.override.starterSpecies(0); game.override.starterSpecies(0).starterForms({
game.override.starterForms({
[SpeciesId.MIMIKYU]: bustedForm, [SpeciesId.MIMIKYU]: bustedForm,
}); });
await game.classicMode.startBattle([SpeciesId.FURRET, SpeciesId.MIMIKYU]); await game.classicMode.startBattle([SpeciesId.FURRET, SpeciesId.MIMIKYU]);
@ -148,11 +145,12 @@ describe("Abilities - Disguise", () => {
}); });
it("reverts to Disguised form on arena reset", async () => { it("reverts to Disguised form on arena reset", async () => {
game.override.startingWave(4); game.override
game.override.starterSpecies(SpeciesId.MIMIKYU); .startingWave(4)
game.override.starterForms({ .starterSpecies(SpeciesId.MIMIKYU)
[SpeciesId.MIMIKYU]: bustedForm, .starterForms({
}); [SpeciesId.MIMIKYU]: bustedForm,
});
await game.classicMode.startBattle(); await game.classicMode.startBattle();
@ -168,11 +166,12 @@ describe("Abilities - Disguise", () => {
}); });
it("reverts to Disguised form on biome change when fainted", async () => { it("reverts to Disguised form on biome change when fainted", async () => {
game.override.startingWave(10); game.override
game.override.starterSpecies(0); .startingWave(10)
game.override.starterForms({ .starterSpecies(0)
[SpeciesId.MIMIKYU]: bustedForm, .starterForms({
}); [SpeciesId.MIMIKYU]: bustedForm,
});
await game.classicMode.startBattle([SpeciesId.MIMIKYU, SpeciesId.FURRET]); await game.classicMode.startBattle([SpeciesId.MIMIKYU, SpeciesId.FURRET]);
@ -206,8 +205,7 @@ describe("Abilities - Disguise", () => {
}); });
it("activates when Aerilate circumvents immunity to the move's base type", async () => { it("activates when Aerilate circumvents immunity to the move's base type", async () => {
game.override.ability(AbilityId.AERILATE); game.override.ability(AbilityId.AERILATE).moveset([MoveId.TACKLE]);
game.override.moveset([MoveId.TACKLE]);
await game.classicMode.startBattle(); await game.classicMode.startBattle();

View File

@ -73,8 +73,7 @@ describe("Abilities - Flash Fire", () => {
}, 20000); }, 20000);
it("activated after being frozen", async () => { it("activated after being frozen", async () => {
game.override.enemyMoveset([MoveId.EMBER]).moveset(MoveId.SPLASH); game.override.enemyMoveset([MoveId.EMBER]).moveset(MoveId.SPLASH).statusEffect(StatusEffect.FREEZE);
game.override.statusEffect(StatusEffect.FREEZE);
await game.classicMode.startBattle([SpeciesId.BLISSEY]); await game.classicMode.startBattle([SpeciesId.BLISSEY]);
const blissey = game.scene.getPlayerPokemon()!; const blissey = game.scene.getPlayerPokemon()!;
@ -102,8 +101,11 @@ describe("Abilities - Flash Fire", () => {
}, 20000); }, 20000);
it("boosts Fire-type move when the ability is activated", async () => { it("boosts Fire-type move when the ability is activated", async () => {
game.override.enemyMoveset([MoveId.FIRE_PLEDGE]).moveset([MoveId.EMBER, MoveId.SPLASH]); game.override
game.override.enemyAbility(AbilityId.FLASH_FIRE).ability(AbilityId.NONE); .enemyMoveset([MoveId.FIRE_PLEDGE])
.moveset([MoveId.EMBER, MoveId.SPLASH])
.enemyAbility(AbilityId.FLASH_FIRE)
.ability(AbilityId.NONE);
await game.classicMode.startBattle([SpeciesId.BLISSEY]); await game.classicMode.startBattle([SpeciesId.BLISSEY]);
const blissey = game.scene.getPlayerPokemon()!; const blissey = game.scene.getPlayerPokemon()!;
const initialHP = 1000; const initialHP = 1000;
@ -127,9 +129,12 @@ describe("Abilities - Flash Fire", () => {
}, 20000); }, 20000);
it("still activates regardless of accuracy check", async () => { it("still activates regardless of accuracy check", async () => {
game.override.moveset(MoveId.FIRE_PLEDGE).enemyMoveset(MoveId.EMBER); game.override
game.override.enemyAbility(AbilityId.NONE).ability(AbilityId.FLASH_FIRE); .moveset(MoveId.FIRE_PLEDGE)
game.override.enemySpecies(SpeciesId.BLISSEY); .enemyMoveset(MoveId.EMBER)
.enemyAbility(AbilityId.NONE)
.ability(AbilityId.FLASH_FIRE)
.enemySpecies(SpeciesId.BLISSEY);
await game.classicMode.startBattle([SpeciesId.RATTATA]); await game.classicMode.startBattle([SpeciesId.RATTATA]);
const blissey = game.scene.getEnemyPokemon()!; const blissey = game.scene.getEnemyPokemon()!;

View File

@ -47,9 +47,10 @@ describe("Abilities - Flower Gift", () => {
allyAbility = AbilityId.BALL_FETCH, allyAbility = AbilityId.BALL_FETCH,
enemyAbility = AbilityId.BALL_FETCH, enemyAbility = AbilityId.BALL_FETCH,
): Promise<[number, number]> => { ): Promise<[number, number]> => {
game.override.battleStyle("double"); game.override
game.override.moveset([MoveId.SPLASH, MoveId.SUNNY_DAY, move, MoveId.HEAL_PULSE]); .battleStyle("double")
game.override.enemyMoveset([MoveId.SPLASH, MoveId.HEAL_PULSE]); .moveset([MoveId.SPLASH, MoveId.SUNNY_DAY, move, MoveId.HEAL_PULSE])
.enemyMoveset([MoveId.SPLASH, MoveId.HEAL_PULSE]);
const target_index = allyAttacker ? BattlerIndex.ENEMY : BattlerIndex.PLAYER_2; const target_index = allyAttacker ? BattlerIndex.ENEMY : BattlerIndex.PLAYER_2;
const attacker_index = allyAttacker ? BattlerIndex.PLAYER_2 : BattlerIndex.ENEMY; const attacker_index = allyAttacker ? BattlerIndex.PLAYER_2 : BattlerIndex.ENEMY;
const ally_move = allyAttacker ? move : MoveId.SPLASH; const ally_move = allyAttacker ? move : MoveId.SPLASH;

View File

@ -63,9 +63,10 @@ describe("Abilities - Good As Gold", () => {
}); });
it("should not block any status moves that target the field, one side, or all pokemon", async () => { it("should not block any status moves that target the field, one side, or all pokemon", async () => {
game.override.battleStyle("double"); game.override
game.override.enemyMoveset([MoveId.STEALTH_ROCK, MoveId.HAZE]); .battleStyle("double")
game.override.moveset([MoveId.SWORDS_DANCE, MoveId.SAFEGUARD]); .enemyMoveset([MoveId.STEALTH_ROCK, MoveId.HAZE])
.moveset([MoveId.SWORDS_DANCE, MoveId.SAFEGUARD]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.FEEBAS]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.FEEBAS]);
const [good_as_gold, ball_fetch] = game.scene.getPlayerField(); const [good_as_gold, ball_fetch] = game.scene.getPlayerField();
@ -85,8 +86,7 @@ describe("Abilities - Good As Gold", () => {
}); });
it("should not block field targeted effects in singles", async () => { it("should not block field targeted effects in singles", async () => {
game.override.battleStyle("single"); game.override.battleStyle("single").enemyMoveset([MoveId.SPIKES]);
game.override.enemyMoveset([MoveId.SPIKES]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
game.move.select(MoveId.SPLASH, 0); game.move.select(MoveId.SPLASH, 0);
@ -96,8 +96,7 @@ describe("Abilities - Good As Gold", () => {
}); });
it("should block the ally's helping hand", async () => { it("should block the ally's helping hand", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double").moveset([MoveId.HELPING_HAND, MoveId.TACKLE]);
game.override.moveset([MoveId.HELPING_HAND, MoveId.TACKLE]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.FEEBAS]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.FEEBAS]);
game.move.select(MoveId.HELPING_HAND, 0); game.move.select(MoveId.HELPING_HAND, 0);
@ -129,8 +128,7 @@ describe("Abilities - Good As Gold", () => {
}); });
it("should not block field targeted effects like rain dance", async () => { it("should not block field targeted effects like rain dance", async () => {
game.override.battleStyle("single"); game.override.battleStyle("single").enemyMoveset([MoveId.RAIN_DANCE]);
game.override.enemyMoveset([MoveId.RAIN_DANCE]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
game.move.use(MoveId.SPLASH, 0); game.move.use(MoveId.SPLASH, 0);

View File

@ -75,8 +75,7 @@ describe("Abilities - Hustle", () => {
}); });
it("does not affect OHKO moves", async () => { it("does not affect OHKO moves", async () => {
game.override.startingLevel(100); game.override.startingLevel(100).enemyLevel(30);
game.override.enemyLevel(30);
await game.classicMode.startBattle([SpeciesId.PIKACHU]); await game.classicMode.startBattle([SpeciesId.PIKACHU]);
const pikachu = game.scene.getPlayerPokemon()!; const pikachu = game.scene.getPlayerPokemon()!;

View File

@ -30,10 +30,11 @@ describe("Abilities - Ice Face", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.enemySpecies(SpeciesId.EISCUE); .battleStyle("single")
game.override.enemyAbility(AbilityId.ICE_FACE); .enemySpecies(SpeciesId.EISCUE)
game.override.moveset([MoveId.TACKLE, MoveId.ICE_BEAM, MoveId.TOXIC_THREAD, MoveId.HAIL]); .enemyAbility(AbilityId.ICE_FACE)
.moveset([MoveId.TACKLE, MoveId.ICE_BEAM, MoveId.TOXIC_THREAD, MoveId.HAIL]);
}); });
it("takes no damage from physical move and transforms to Noice", async () => { it("takes no damage from physical move and transforms to Noice", async () => {
@ -51,8 +52,7 @@ describe("Abilities - Ice Face", () => {
}); });
it("takes no damage from the first hit of multihit physical move and transforms to Noice", async () => { it("takes no damage from the first hit of multihit physical move and transforms to Noice", async () => {
game.override.moveset([MoveId.SURGING_STRIKES]); game.override.moveset([MoveId.SURGING_STRIKES]).enemyLevel(1);
game.override.enemyLevel(1);
await game.classicMode.startBattle([SpeciesId.HITMONLEE]); await game.classicMode.startBattle([SpeciesId.HITMONLEE]);
game.move.select(MoveId.SURGING_STRIKES); game.move.select(MoveId.SURGING_STRIKES);
@ -196,12 +196,13 @@ describe("Abilities - Ice Face", () => {
}); });
it("reverts to Ice Face on arena reset", async () => { it("reverts to Ice Face on arena reset", async () => {
game.override.startingWave(4); game.override
game.override.startingLevel(4); .startingWave(4)
game.override.enemySpecies(SpeciesId.MAGIKARP); .startingLevel(4)
game.override.starterForms({ .enemySpecies(SpeciesId.MAGIKARP)
[SpeciesId.EISCUE]: noiceForm, .starterForms({
}); [SpeciesId.EISCUE]: noiceForm,
});
await game.classicMode.startBattle([SpeciesId.EISCUE]); await game.classicMode.startBattle([SpeciesId.EISCUE]);

View File

@ -116,26 +116,23 @@ describe("Abilities - Illusion", () => {
expect(psychicEffectiveness).above(flameThrowerEffectiveness); expect(psychicEffectiveness).above(flameThrowerEffectiveness);
}); });
it("does not break from indirect damage", async () => { it("should not break from indirect damage from status, weather or recoil", async () => {
game.override.enemySpecies(SpeciesId.GIGALITH); game.override.enemySpecies(SpeciesId.GIGALITH).enemyAbility(AbilityId.SAND_STREAM);
game.override.enemyAbility(AbilityId.SAND_STREAM);
game.override.enemyMoveset(MoveId.WILL_O_WISP);
game.override.moveset([MoveId.FLARE_BLITZ]);
await game.classicMode.startBattle([SpeciesId.ZOROARK, SpeciesId.AZUMARILL]); await game.classicMode.startBattle([SpeciesId.ZOROARK, SpeciesId.AZUMARILL]);
game.move.select(MoveId.FLARE_BLITZ); game.move.use(MoveId.FLARE_BLITZ);
await game.move.forceEnemyMove(MoveId.WILL_O_WISP);
await game.phaseInterceptor.to("TurnEndPhase"); await game.toEndOfTurn();
const zoroark = game.scene.getPlayerPokemon()!; const zoroark = game.scene.getPlayerPokemon()!;
expect(!!zoroark.summonData.illusion).equals(true); expect(!!zoroark.summonData.illusion).equals(true);
}); });
it("copies the the name, nickname, gender, shininess, and pokeball from the illusion source", async () => { it("copies the the name, nickname, gender, shininess, and pokeball from the illusion source", async () => {
game.override.enemyMoveset(MoveId.SPLASH); game.override.enemyMoveset(MoveId.SPLASH);
await game.classicMode.startBattle([SpeciesId.ABRA, SpeciesId.ZOROARK, SpeciesId.AXEW]); await game.classicMode.startBattle([SpeciesId.ABRA, SpeciesId.ZOROARK, SpeciesId.AXEW]);
const axew = game.scene.getPlayerParty().at(2)!; const axew = game.scene.getPlayerParty().at(2)!;
axew.shiny = true; axew.shiny = true;
axew.nickname = btoa(unescape(encodeURIComponent("axew nickname"))); axew.nickname = btoa(unescape(encodeURIComponent("axew nickname")));

View File

@ -162,8 +162,7 @@ describe("Abilities - Imposter", () => {
}); });
it("should stay transformed with the correct form after reload", async () => { it("should stay transformed with the correct form after reload", async () => {
game.override.moveset([MoveId.ABSORB]); game.override.moveset([MoveId.ABSORB]).enemySpecies(SpeciesId.UNOWN);
game.override.enemySpecies(SpeciesId.UNOWN);
await game.classicMode.startBattle([SpeciesId.DITTO]); await game.classicMode.startBattle([SpeciesId.DITTO]);
const enemy = game.scene.getEnemyPokemon()!; const enemy = game.scene.getEnemyPokemon()!;

View File

@ -88,8 +88,7 @@ describe("Abilities - Intimidate", () => {
}, 20000); }, 20000);
it("should not activate again if there is no switch or new entry", async () => { it("should not activate again if there is no switch or new entry", async () => {
game.override.startingWave(2); game.override.startingWave(2).moveset([MoveId.SPLASH]);
game.override.moveset([MoveId.SPLASH]);
await game.classicMode.startBattle([SpeciesId.MIGHTYENA, SpeciesId.POOCHYENA]); await game.classicMode.startBattle([SpeciesId.MIGHTYENA, SpeciesId.POOCHYENA]);
const playerPokemon = game.scene.getPlayerPokemon()!; const playerPokemon = game.scene.getPlayerPokemon()!;

View File

@ -22,10 +22,11 @@ describe("Abilities - Intrepid Sword", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.enemySpecies(SpeciesId.ZACIAN); .battleStyle("single")
game.override.enemyAbility(AbilityId.INTREPID_SWORD); .enemySpecies(SpeciesId.ZACIAN)
game.override.ability(AbilityId.INTREPID_SWORD); .enemyAbility(AbilityId.INTREPID_SWORD)
.ability(AbilityId.INTREPID_SWORD);
}); });
it("should raise ATK stat stage by 1 on entry", async () => { it("should raise ATK stat stage by 1 on entry", async () => {

View File

@ -108,8 +108,7 @@ describe("Abilities - Libero", () => {
}); });
test("ability applies correctly even if the type has changed by another ability", async () => { test("ability applies correctly even if the type has changed by another ability", async () => {
game.override.moveset([MoveId.TACKLE]); game.override.moveset([MoveId.TACKLE]).passiveAbility(AbilityId.REFRIGERATE);
game.override.passiveAbility(AbilityId.REFRIGERATE);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -156,8 +155,7 @@ describe("Abilities - Libero", () => {
}); });
test("ability applies correctly even if the pokemon's move misses", async () => { test("ability applies correctly even if the pokemon's move misses", async () => {
game.override.moveset([MoveId.TACKLE]); game.override.moveset([MoveId.TACKLE]).enemyMoveset(MoveId.SPLASH);
game.override.enemyMoveset(MoveId.SPLASH);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -188,8 +186,7 @@ describe("Abilities - Libero", () => {
}); });
test("ability applies correctly even if the pokemon's move fails because of type immunity", async () => { test("ability applies correctly even if the pokemon's move fails because of type immunity", async () => {
game.override.moveset([MoveId.TACKLE]); game.override.moveset([MoveId.TACKLE]).enemySpecies(SpeciesId.GASTLY);
game.override.enemySpecies(SpeciesId.GASTLY);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -262,8 +259,7 @@ describe("Abilities - Libero", () => {
}); });
test("ability applies correctly even if the pokemon's Trick-or-Treat fails", async () => { test("ability applies correctly even if the pokemon's Trick-or-Treat fails", async () => {
game.override.moveset([MoveId.TRICK_OR_TREAT]); game.override.moveset([MoveId.TRICK_OR_TREAT]).enemySpecies(SpeciesId.GASTLY);
game.override.enemySpecies(SpeciesId.GASTLY);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);

View File

@ -41,18 +41,16 @@ describe("Abilities - Magic Bounce", () => {
it("should reflect basic status moves", async () => { it("should reflect basic status moves", async () => {
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
game.move.select(MoveId.GROWL); game.move.use(MoveId.GROWL);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
expect(game.scene.getPlayerPokemon()!.getStatStage(Stat.ATK)).toBe(-1); expect(game.scene.getPlayerPokemon()!.getStatStage(Stat.ATK)).toBe(-1);
}); });
it("should not bounce moves while the target is in the semi-invulnerable state", async () => { it("should not bounce moves while the target is in the semi-invulnerable state", async () => {
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
game.override.moveset([MoveId.GROWL]);
game.override.enemyMoveset([MoveId.FLY]);
game.move.select(MoveId.GROWL); game.move.use(MoveId.GROWL);
await game.move.selectEnemyMove(MoveId.FLY); await game.move.forceEnemyMove(MoveId.FLY);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
@ -61,11 +59,10 @@ describe("Abilities - Magic Bounce", () => {
it("should individually bounce back multi-target moves", async () => { it("should individually bounce back multi-target moves", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double");
game.override.moveset([MoveId.GROWL, MoveId.SPLASH]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]);
game.move.select(MoveId.GROWL, 0); game.move.use(MoveId.GROWL, 0);
game.move.select(MoveId.SPLASH, 1); game.move.use(MoveId.SPLASH, 1);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
const user = game.scene.getPlayerField()[0]; const user = game.scene.getPlayerField()[0];
@ -75,9 +72,8 @@ describe("Abilities - Magic Bounce", () => {
it("should still bounce back a move that would otherwise fail", async () => { it("should still bounce back a move that would otherwise fail", async () => {
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
game.scene.getEnemyPokemon()?.setStatStage(Stat.ATK, -6); game.scene.getEnemyPokemon()?.setStatStage(Stat.ATK, -6);
game.override.moveset([MoveId.GROWL]);
game.move.select(MoveId.GROWL); game.move.use(MoveId.GROWL);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
expect(game.scene.getPlayerPokemon()!.getStatStage(Stat.ATK)).toBe(-1); expect(game.scene.getPlayerPokemon()!.getStatStage(Stat.ATK)).toBe(-1);
@ -107,29 +103,26 @@ describe("Abilities - Magic Bounce", () => {
game.override.ability(AbilityId.MOLD_BREAKER); game.override.ability(AbilityId.MOLD_BREAKER);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
game.move.select(MoveId.GROWL); game.move.use(MoveId.GROWL);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
expect(game.scene.getEnemyPokemon()!.getStatStage(Stat.ATK)).toBe(-1); expect(game.scene.getEnemyPokemon()!.getStatStage(Stat.ATK)).toBe(-1);
}); });
it("should bounce back a spread status move against both pokemon", async () => { it("should bounce back a spread status move against both pokemon", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double").enemyMoveset([MoveId.SPLASH]);
game.override.moveset([MoveId.GROWL, MoveId.SPLASH]);
game.override.enemyMoveset([MoveId.SPLASH]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]);
game.move.select(MoveId.GROWL, 0); game.move.use(MoveId.GROWL, 0);
game.move.select(MoveId.SPLASH, 1); game.move.use(MoveId.SPLASH, 1);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
expect(game.scene.getPlayerField().every(p => p.getStatStage(Stat.ATK) === -2)).toBeTruthy(); expect(game.scene.getPlayerField().every(p => p.getStatStage(Stat.ATK) === -2)).toBeTruthy();
}); });
it("should only bounce spikes back once in doubles when both targets have magic bounce", async () => { it("should only bounce spikes back once in doubles when both targets have magic bounce", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double").moveset([MoveId.SPIKES]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
game.override.moveset([MoveId.SPIKES]);
game.move.select(MoveId.SPIKES); game.move.select(MoveId.SPIKES);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
@ -139,8 +132,7 @@ describe("Abilities - Magic Bounce", () => {
}); });
it("should bounce spikes even when the target is protected", async () => { it("should bounce spikes even when the target is protected", async () => {
game.override.moveset([MoveId.SPIKES]); game.override.moveset([MoveId.SPIKES]).enemyMoveset([MoveId.PROTECT]);
game.override.enemyMoveset([MoveId.PROTECT]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
game.move.select(MoveId.SPIKES); game.move.select(MoveId.SPIKES);
@ -149,8 +141,7 @@ describe("Abilities - Magic Bounce", () => {
}); });
it("should not bounce spikes when the target is in the semi-invulnerable state", async () => { it("should not bounce spikes when the target is in the semi-invulnerable state", async () => {
game.override.moveset([MoveId.SPIKES]); game.override.moveset([MoveId.SPIKES]).enemyMoveset([MoveId.FLY]);
game.override.enemyMoveset([MoveId.FLY]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
game.move.select(MoveId.SPIKES); game.move.select(MoveId.SPIKES);
@ -160,9 +151,8 @@ describe("Abilities - Magic Bounce", () => {
}); });
it("should not bounce back curse", async () => { it("should not bounce back curse", async () => {
game.override.starterSpecies(SpeciesId.GASTLY);
await game.classicMode.startBattle([SpeciesId.GASTLY]);
game.override.moveset([MoveId.CURSE]); game.override.moveset([MoveId.CURSE]);
await game.classicMode.startBattle([SpeciesId.GASTLY]);
game.move.select(MoveId.CURSE); game.move.select(MoveId.CURSE);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
@ -171,8 +161,7 @@ describe("Abilities - Magic Bounce", () => {
}); });
it("should not cause encore to be interrupted after bouncing", async () => { it("should not cause encore to be interrupted after bouncing", async () => {
game.override.moveset([MoveId.SPLASH, MoveId.GROWL, MoveId.ENCORE]); game.override.moveset([MoveId.SPLASH, MoveId.GROWL, MoveId.ENCORE]).enemyMoveset([MoveId.TACKLE, MoveId.GROWL]);
game.override.enemyMoveset([MoveId.TACKLE, MoveId.GROWL]);
// game.override.ability(AbilityId.MOLD_BREAKER); // game.override.ability(AbilityId.MOLD_BREAKER);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
const playerPokemon = game.scene.getPlayerPokemon()!; const playerPokemon = game.scene.getPlayerPokemon()!;
@ -199,9 +188,10 @@ describe("Abilities - Magic Bounce", () => {
// TODO: encore is failing if the last move was virtual. // TODO: encore is failing if the last move was virtual.
it.todo("should not cause the bounced move to count for encore", async () => { it.todo("should not cause the bounced move to count for encore", async () => {
game.override.moveset([MoveId.SPLASH, MoveId.GROWL, MoveId.ENCORE]); game.override
game.override.enemyMoveset([MoveId.GROWL, MoveId.TACKLE]); .moveset([MoveId.SPLASH, MoveId.GROWL, MoveId.ENCORE])
game.override.enemyAbility(AbilityId.MAGIC_BOUNCE); .enemyMoveset([MoveId.GROWL, MoveId.TACKLE])
.enemyAbility(AbilityId.MAGIC_BOUNCE);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
const playerPokemon = game.scene.getPlayerPokemon()!; const playerPokemon = game.scene.getPlayerPokemon()!;
@ -227,9 +217,8 @@ describe("Abilities - Magic Bounce", () => {
// TODO: stomping tantrum should consider moves that were bounced. // TODO: stomping tantrum should consider moves that were bounced.
it.todo("should cause stomping tantrum to double in power when the last move was bounced", async () => { it.todo("should cause stomping tantrum to double in power when the last move was bounced", async () => {
game.override.battleStyle("single"); game.override.battleStyle("single").moveset([MoveId.STOMPING_TANTRUM, MoveId.CHARM]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
game.override.moveset([MoveId.STOMPING_TANTRUM, MoveId.CHARM]);
const stomping_tantrum = allMoves[MoveId.STOMPING_TANTRUM]; const stomping_tantrum = allMoves[MoveId.STOMPING_TANTRUM];
vi.spyOn(stomping_tantrum, "calculateBattlePower"); vi.spyOn(stomping_tantrum, "calculateBattlePower");
@ -242,36 +231,30 @@ describe("Abilities - Magic Bounce", () => {
expect(stomping_tantrum.calculateBattlePower).toHaveReturnedWith(150); expect(stomping_tantrum.calculateBattlePower).toHaveReturnedWith(150);
}); });
// TODO: stomping tantrum should consider moves that were bounced. // TODO: stomping tantrum should consider moves that were bounced
it.todo( it.todo("should boost enemy's stomping tantrum after failed bounce", async () => {
"should properly cause the enemy's stomping tantrum to be doubled in power after bouncing and failing", game.override.enemyMoveset([MoveId.STOMPING_TANTRUM, MoveId.SPLASH, MoveId.CHARM]);
async () => { await game.classicMode.startBattle([SpeciesId.BULBASAUR]);
game.override.enemyMoveset([MoveId.STOMPING_TANTRUM, MoveId.SPLASH, MoveId.CHARM]);
await game.classicMode.startBattle([SpeciesId.BULBASAUR]);
const stomping_tantrum = allMoves[MoveId.STOMPING_TANTRUM]; const stomping_tantrum = allMoves[MoveId.STOMPING_TANTRUM];
const enemy = game.scene.getEnemyPokemon()!; const enemy = game.scene.getEnemyPokemon()!;
vi.spyOn(stomping_tantrum, "calculateBattlePower"); vi.spyOn(stomping_tantrum, "calculateBattlePower");
game.move.select(MoveId.SPORE); // Spore gets reflected back onto us
await game.move.selectEnemyMove(MoveId.CHARM); game.move.select(MoveId.SPORE);
await game.phaseInterceptor.to("TurnEndPhase"); await game.move.selectEnemyMove(MoveId.CHARM);
expect(enemy.getLastXMoves(1)[0].result).toBe("success"); await game.toNextTurn();
expect(enemy.getLastXMoves(1)[0].result).toBe("success");
await game.phaseInterceptor.to("BerryPhase"); game.move.select(MoveId.SPORE);
expect(stomping_tantrum.calculateBattlePower).toHaveReturnedWith(75); await game.move.selectEnemyMove(MoveId.STOMPING_TANTRUM);
await game.toNextTurn();
await game.toNextTurn(); expect(stomping_tantrum.calculateBattlePower).toHaveReturnedWith(150);
game.move.select(MoveId.GROWL); });
await game.phaseInterceptor.to("BerryPhase");
expect(stomping_tantrum.calculateBattlePower).toHaveReturnedWith(75);
},
);
it("should respect immunities when bouncing a move", async () => { it("should respect immunities when bouncing a move", async () => {
vi.spyOn(allMoves[MoveId.THUNDER_WAVE], "accuracy", "get").mockReturnValue(100); vi.spyOn(allMoves[MoveId.THUNDER_WAVE], "accuracy", "get").mockReturnValue(100);
game.override.moveset([MoveId.THUNDER_WAVE, MoveId.GROWL]); game.override.moveset([MoveId.THUNDER_WAVE, MoveId.GROWL]).ability(AbilityId.SOUNDPROOF);
game.override.ability(AbilityId.SOUNDPROOF);
await game.classicMode.startBattle([SpeciesId.PHANPY]); await game.classicMode.startBattle([SpeciesId.PHANPY]);
// Turn 1 - thunder wave immunity test // Turn 1 - thunder wave immunity test
@ -309,8 +292,7 @@ describe("Abilities - Magic Bounce", () => {
}); });
it("should always apply the leftmost available target's magic bounce when bouncing moves like sticky webs in doubles", async () => { it("should always apply the leftmost available target's magic bounce when bouncing moves like sticky webs in doubles", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double").moveset([MoveId.STICKY_WEB, MoveId.SPLASH, MoveId.TRICK_ROOM]);
game.override.moveset([MoveId.STICKY_WEB, MoveId.SPLASH, MoveId.TRICK_ROOM]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]);
const [enemy_1, enemy_2] = game.scene.getEnemyField(); const [enemy_1, enemy_2] = game.scene.getEnemyField();
@ -345,6 +327,7 @@ describe("Abilities - Magic Bounce", () => {
it("should not bounce back status moves that hit through semi-invulnerable states", async () => { it("should not bounce back status moves that hit through semi-invulnerable states", async () => {
game.override.moveset([MoveId.TOXIC, MoveId.CHARM]); game.override.moveset([MoveId.TOXIC, MoveId.CHARM]);
await game.classicMode.startBattle([SpeciesId.BULBASAUR]); await game.classicMode.startBattle([SpeciesId.BULBASAUR]);
game.move.select(MoveId.TOXIC); game.move.select(MoveId.TOXIC);
await game.move.selectEnemyMove(MoveId.FLY); await game.move.selectEnemyMove(MoveId.FLY);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);

View File

@ -30,16 +30,16 @@ describe("Abilities - Magic Guard", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
/** Player Pokemon overrides */ game.override
game.override.ability(AbilityId.MAGIC_GUARD); /** Player Pokemon overrides */
game.override.moveset([MoveId.SPLASH]); .ability(AbilityId.MAGIC_GUARD)
game.override.startingLevel(100); .moveset([MoveId.SPLASH])
.startingLevel(100)
/** Enemy Pokemon overrides */ /** Enemy Pokemon overrides */
game.override.enemySpecies(SpeciesId.SNORLAX); .enemySpecies(SpeciesId.SNORLAX)
game.override.enemyAbility(AbilityId.INSOMNIA); .enemyAbility(AbilityId.INSOMNIA)
game.override.enemyMoveset(MoveId.SPLASH); .enemyMoveset(MoveId.SPLASH)
game.override.enemyLevel(100); .enemyLevel(100);
}); });
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Magic_Guard_(Ability) //Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Magic_Guard_(Ability)
@ -89,8 +89,9 @@ describe("Abilities - Magic Guard", () => {
}); });
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([MoveId.WORRY_SEED, MoveId.WORRY_SEED, MoveId.WORRY_SEED, MoveId.WORRY_SEED]); game.override
game.override.statusEffect(StatusEffect.POISON); .enemyMoveset([MoveId.WORRY_SEED, MoveId.WORRY_SEED, MoveId.WORRY_SEED, MoveId.WORRY_SEED])
.statusEffect(StatusEffect.POISON);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -108,8 +109,7 @@ describe("Abilities - Magic Guard", () => {
}); });
it("Magic Guard prevents damage caused by burn but other non-damaging effects are still applied", async () => { it("Magic Guard prevents damage caused by burn but other non-damaging effects are still applied", async () => {
game.override.enemyStatusEffect(StatusEffect.BURN); game.override.enemyStatusEffect(StatusEffect.BURN).enemyAbility(AbilityId.MAGIC_GUARD);
game.override.enemyAbility(AbilityId.MAGIC_GUARD);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -130,8 +130,7 @@ describe("Abilities - Magic Guard", () => {
}); });
it("Magic Guard prevents damage caused by toxic but other non-damaging effects are still applied", async () => { it("Magic Guard prevents damage caused by toxic but other non-damaging effects are still applied", async () => {
game.override.enemyStatusEffect(StatusEffect.TOXIC); game.override.enemyStatusEffect(StatusEffect.TOXIC).enemyAbility(AbilityId.MAGIC_GUARD);
game.override.enemyAbility(AbilityId.MAGIC_GUARD);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -208,8 +207,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.classicMode.startBattle([SpeciesId.DUSKULL]); await game.classicMode.startBattle([SpeciesId.DUSKULL]);
game.override.moveset([MoveId.CURSE]); game.override.moveset([MoveId.CURSE]).enemyAbility(AbilityId.MAGIC_GUARD);
game.override.enemyAbility(AbilityId.MAGIC_GUARD);
const leadPokemon = game.scene.getPlayerPokemon()!; const leadPokemon = game.scene.getPlayerPokemon()!;
@ -331,8 +329,9 @@ describe("Abilities - Magic Guard", () => {
//Tests the ability Bad Dreams //Tests the ability Bad Dreams
game.override.statusEffect(StatusEffect.SLEEP); game.override.statusEffect(StatusEffect.SLEEP);
//enemy pokemon is given Spore just in case player pokemon somehow awakens during test //enemy pokemon is given Spore just in case player pokemon somehow awakens during test
game.override.enemyMoveset([MoveId.SPORE, MoveId.SPORE, MoveId.SPORE, MoveId.SPORE]); game.override
game.override.enemyAbility(AbilityId.BAD_DREAMS); .enemyMoveset([MoveId.SPORE, MoveId.SPORE, MoveId.SPORE, MoveId.SPORE])
.enemyAbility(AbilityId.BAD_DREAMS);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -353,8 +352,7 @@ describe("Abilities - Magic Guard", () => {
it("Magic Guard prevents damage from abilities with PostFaintContactDamageAbAttr", async () => { it("Magic Guard prevents damage from abilities with PostFaintContactDamageAbAttr", async () => {
//Tests the abilities Innards Out/Aftermath //Tests the abilities Innards Out/Aftermath
game.override.moveset([MoveId.TACKLE]); game.override.moveset([MoveId.TACKLE]).enemyAbility(AbilityId.AFTERMATH);
game.override.enemyAbility(AbilityId.AFTERMATH);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -377,8 +375,7 @@ describe("Abilities - Magic Guard", () => {
it("Magic Guard prevents damage from abilities with PostDefendContactDamageAbAttr", async () => { it("Magic Guard prevents damage from abilities with PostDefendContactDamageAbAttr", async () => {
//Tests the abilities Iron Barbs/Rough Skin //Tests the abilities Iron Barbs/Rough Skin
game.override.moveset([MoveId.TACKLE]); game.override.moveset([MoveId.TACKLE]).enemyAbility(AbilityId.IRON_BARBS);
game.override.enemyAbility(AbilityId.IRON_BARBS);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -400,8 +397,7 @@ describe("Abilities - Magic Guard", () => {
it("Magic Guard prevents damage from abilities with ReverseDrainAbAttr", async () => { it("Magic Guard prevents damage from abilities with ReverseDrainAbAttr", async () => {
//Tests the ability Liquid Ooze //Tests the ability Liquid Ooze
game.override.moveset([MoveId.ABSORB]); game.override.moveset([MoveId.ABSORB]).enemyAbility(AbilityId.LIQUID_OOZE);
game.override.enemyAbility(AbilityId.LIQUID_OOZE);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -422,9 +418,7 @@ describe("Abilities - Magic Guard", () => {
}); });
it("Magic Guard prevents HP loss from abilities with PostWeatherLapseDamageAbAttr", async () => { it("Magic Guard prevents HP loss from abilities with PostWeatherLapseDamageAbAttr", async () => {
//Tests the abilities Solar Power/Dry Skin game.override.passiveAbility(AbilityId.SOLAR_POWER).weather(WeatherType.SUNNY);
game.override.passiveAbility(AbilityId.SOLAR_POWER);
game.override.weather(WeatherType.SUNNY);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
const leadPokemon = game.scene.getPlayerPokemon()!; const leadPokemon = game.scene.getPlayerPokemon()!;

View File

@ -37,8 +37,7 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Player side + single battle Intimidate - opponent loses stats", async () => { it("Player side + single battle Intimidate - opponent loses stats", async () => {
game.override.ability(AbilityId.MIRROR_ARMOR); game.override.ability(AbilityId.MIRROR_ARMOR).enemyAbility(AbilityId.INTIMIDATE);
game.override.enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([SpeciesId.BULBASAUR]); await game.classicMode.startBattle([SpeciesId.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -54,8 +53,7 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Enemy side + single battle Intimidate - player loses stats", async () => { it("Enemy side + single battle Intimidate - player loses stats", async () => {
game.override.enemyAbility(AbilityId.MIRROR_ARMOR); game.override.enemyAbility(AbilityId.MIRROR_ARMOR).ability(AbilityId.INTIMIDATE);
game.override.ability(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([SpeciesId.BULBASAUR]); await game.classicMode.startBattle([SpeciesId.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -71,9 +69,7 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Player side + double battle Intimidate - opponents each lose -2 atk", async () => { it("Player side + double battle Intimidate - opponents each lose -2 atk", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double").ability(AbilityId.MIRROR_ARMOR).enemyAbility(AbilityId.INTIMIDATE);
game.override.ability(AbilityId.MIRROR_ARMOR);
game.override.enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([SpeciesId.BULBASAUR, SpeciesId.CHARMANDER]); await game.classicMode.startBattle([SpeciesId.BULBASAUR, SpeciesId.CHARMANDER]);
const [enemy1, enemy2] = game.scene.getEnemyField(); const [enemy1, enemy2] = game.scene.getEnemyField();
@ -93,9 +89,7 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Enemy side + double battle Intimidate - players each lose -2 atk", async () => { it("Enemy side + double battle Intimidate - players each lose -2 atk", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double").enemyAbility(AbilityId.MIRROR_ARMOR).ability(AbilityId.INTIMIDATE);
game.override.enemyAbility(AbilityId.MIRROR_ARMOR);
game.override.ability(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([SpeciesId.BULBASAUR, SpeciesId.CHARMANDER]); await game.classicMode.startBattle([SpeciesId.BULBASAUR, SpeciesId.CHARMANDER]);
const [enemy1, enemy2] = game.scene.getEnemyField(); const [enemy1, enemy2] = game.scene.getEnemyField();
@ -115,8 +109,7 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Player side + single battle Intimidate + Tickle - opponent loses stats", async () => { it("Player side + single battle Intimidate + Tickle - opponent loses stats", async () => {
game.override.ability(AbilityId.MIRROR_ARMOR); game.override.ability(AbilityId.MIRROR_ARMOR).enemyAbility(AbilityId.INTIMIDATE);
game.override.enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([SpeciesId.BULBASAUR]); await game.classicMode.startBattle([SpeciesId.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -134,9 +127,7 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Player side + double battle Intimidate + Tickle - opponents each lose -3 atk, -1 def", async () => { it("Player side + double battle Intimidate + Tickle - opponents each lose -3 atk, -1 def", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double").ability(AbilityId.MIRROR_ARMOR).enemyAbility(AbilityId.INTIMIDATE);
game.override.ability(AbilityId.MIRROR_ARMOR);
game.override.enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([SpeciesId.BULBASAUR, SpeciesId.CHARMANDER]); await game.classicMode.startBattle([SpeciesId.BULBASAUR, SpeciesId.CHARMANDER]);
const [enemy1, enemy2] = game.scene.getEnemyField(); const [enemy1, enemy2] = game.scene.getEnemyField();
@ -159,8 +150,7 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Enemy side + single battle Intimidate + Tickle - player loses stats", async () => { it("Enemy side + single battle Intimidate + Tickle - player loses stats", async () => {
game.override.enemyAbility(AbilityId.MIRROR_ARMOR); game.override.enemyAbility(AbilityId.MIRROR_ARMOR).ability(AbilityId.INTIMIDATE);
game.override.ability(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([SpeciesId.BULBASAUR]); await game.classicMode.startBattle([SpeciesId.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -178,8 +168,7 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Player side + single battle Intimidate + oppoenent has white smoke - no one loses stats", async () => { it("Player side + single battle Intimidate + oppoenent has white smoke - no one loses stats", async () => {
game.override.enemyAbility(AbilityId.WHITE_SMOKE); game.override.enemyAbility(AbilityId.WHITE_SMOKE).ability(AbilityId.MIRROR_ARMOR);
game.override.ability(AbilityId.MIRROR_ARMOR);
await game.classicMode.startBattle([SpeciesId.BULBASAUR]); await game.classicMode.startBattle([SpeciesId.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -197,8 +186,7 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Enemy side + single battle Intimidate + player has white smoke - no one loses stats", async () => { it("Enemy side + single battle Intimidate + player has white smoke - no one loses stats", async () => {
game.override.ability(AbilityId.WHITE_SMOKE); game.override.ability(AbilityId.WHITE_SMOKE).enemyAbility(AbilityId.MIRROR_ARMOR);
game.override.enemyAbility(AbilityId.MIRROR_ARMOR);
await game.classicMode.startBattle([SpeciesId.BULBASAUR]); await game.classicMode.startBattle([SpeciesId.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -252,9 +240,7 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Both sides have mirror armor - does not loop, player loses attack", async () => { it("Both sides have mirror armor - does not loop, player loses attack", async () => {
game.override.enemyAbility(AbilityId.MIRROR_ARMOR); game.override.enemyAbility(AbilityId.MIRROR_ARMOR).ability(AbilityId.MIRROR_ARMOR).ability(AbilityId.INTIMIDATE);
game.override.ability(AbilityId.MIRROR_ARMOR);
game.override.ability(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([SpeciesId.BULBASAUR]); await game.classicMode.startBattle([SpeciesId.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -288,8 +274,7 @@ describe("Ability - Mirror Armor", () => {
}); });
it("Double battle + sticky web applied player side - player switches out and enemy 1 should lose -1 speed", async () => { it("Double battle + sticky web applied player side - player switches out and enemy 1 should lose -1 speed", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double").ability(AbilityId.MIRROR_ARMOR);
game.override.ability(AbilityId.MIRROR_ARMOR);
await game.classicMode.startBattle([SpeciesId.BULBASAUR, SpeciesId.CHARMANDER, SpeciesId.SQUIRTLE]); await game.classicMode.startBattle([SpeciesId.BULBASAUR, SpeciesId.CHARMANDER, SpeciesId.SQUIRTLE]);
const [enemy1, enemy2] = game.scene.getEnemyField(); const [enemy1, enemy2] = game.scene.getEnemyField();

View File

@ -27,13 +27,14 @@ describe("Abilities - Moxie", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
const moveToUse = MoveId.AERIAL_ACE; const moveToUse = MoveId.AERIAL_ACE;
game.override.battleStyle("single"); game.override
game.override.enemySpecies(SpeciesId.RATTATA); .battleStyle("single")
game.override.enemyAbility(AbilityId.MOXIE); .enemySpecies(SpeciesId.RATTATA)
game.override.ability(AbilityId.MOXIE); .enemyAbility(AbilityId.MOXIE)
game.override.startingLevel(2000); .ability(AbilityId.MOXIE)
game.override.moveset([moveToUse]); .startingLevel(2000)
game.override.enemyMoveset(MoveId.SPLASH); .moveset([moveToUse])
.enemyMoveset(MoveId.SPLASH);
}); });
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 () => {

View File

@ -45,8 +45,9 @@ describe("Abilities - Normalize", () => {
}); });
it("should not apply the old type boost item after changing a move's type", async () => { it("should not apply the old type boost item after changing a move's type", async () => {
game.override.startingHeldItems([{ name: "ATTACK_TYPE_BOOSTER", count: 1, type: PokemonType.GRASS }]); game.override
game.override.moveset([MoveId.LEAFAGE]); .startingHeldItems([{ name: "ATTACK_TYPE_BOOSTER", count: 1, type: PokemonType.GRASS }])
.moveset([MoveId.LEAFAGE]);
const powerSpy = vi.spyOn(allMoves[MoveId.LEAFAGE], "calculateBattlePower"); const powerSpy = vi.spyOn(allMoves[MoveId.LEAFAGE], "calculateBattlePower");
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -58,8 +59,9 @@ describe("Abilities - Normalize", () => {
}); });
it("should apply silk scarf's power boost after changing a move's type", async () => { it("should apply silk scarf's power boost after changing a move's type", async () => {
game.override.startingHeldItems([{ name: "ATTACK_TYPE_BOOSTER", count: 1, type: PokemonType.NORMAL }]); game.override
game.override.moveset([MoveId.LEAFAGE]); .startingHeldItems([{ name: "ATTACK_TYPE_BOOSTER", count: 1, type: PokemonType.NORMAL }])
.moveset([MoveId.LEAFAGE]);
const powerSpy = vi.spyOn(allMoves[MoveId.LEAFAGE], "calculateBattlePower"); const powerSpy = vi.spyOn(allMoves[MoveId.LEAFAGE], "calculateBattlePower");
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);

View File

@ -26,14 +26,15 @@ describe("Abilities - Parental Bond", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.disableCrits(); .battleStyle("single")
game.override.ability(AbilityId.PARENTAL_BOND); .disableCrits()
game.override.enemySpecies(SpeciesId.SNORLAX); .ability(AbilityId.PARENTAL_BOND)
game.override.enemyAbility(AbilityId.FUR_COAT); .enemySpecies(SpeciesId.SNORLAX)
game.override.enemyMoveset(MoveId.SPLASH); .enemyAbility(AbilityId.FUR_COAT)
game.override.startingLevel(100); .enemyMoveset(MoveId.SPLASH)
game.override.enemyLevel(100); .startingLevel(100)
.enemyLevel(100);
}); });
it("should add second strike to attack move", async () => { it("should add second strike to attack move", async () => {
@ -61,8 +62,7 @@ describe("Abilities - Parental Bond", () => {
}); });
it("should apply secondary effects to both strikes", async () => { it("should apply secondary effects to both strikes", async () => {
game.override.moveset([MoveId.POWER_UP_PUNCH]); game.override.moveset([MoveId.POWER_UP_PUNCH]).enemySpecies(SpeciesId.AMOONGUSS);
game.override.enemySpecies(SpeciesId.AMOONGUSS);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -148,8 +148,7 @@ describe("Abilities - Parental Bond", () => {
}); });
it("should not apply multiplier to counter moves", async () => { it("should not apply multiplier to counter moves", async () => {
game.override.moveset([MoveId.COUNTER]); game.override.moveset([MoveId.COUNTER]).enemyMoveset([MoveId.TACKLE]);
game.override.enemyMoveset([MoveId.TACKLE]);
await game.classicMode.startBattle([SpeciesId.SHUCKLE]); await game.classicMode.startBattle([SpeciesId.SHUCKLE]);
@ -167,9 +166,7 @@ describe("Abilities - Parental Bond", () => {
}); });
it("should not apply to multi-target moves", async () => { it("should not apply to multi-target moves", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double").moveset([MoveId.EARTHQUAKE]).passiveAbility(AbilityId.LEVITATE);
game.override.moveset([MoveId.EARTHQUAKE]);
game.override.passiveAbility(AbilityId.LEVITATE);
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.FEEBAS]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.FEEBAS]);
@ -237,8 +234,7 @@ describe("Abilities - Parental Bond", () => {
}); });
it("Moves boosted by this ability and Multi-Lens should strike 3 times", async () => { it("Moves boosted by this ability and Multi-Lens should strike 3 times", async () => {
game.override.moveset([MoveId.TACKLE]); game.override.moveset([MoveId.TACKLE]).startingHeldItems([{ name: "MULTI_LENS", count: 1 }]);
game.override.startingHeldItems([{ name: "MULTI_LENS", count: 1 }]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -252,8 +248,7 @@ describe("Abilities - Parental Bond", () => {
}); });
it("Seismic Toss boosted by this ability and Multi-Lens should strike 3 times", async () => { it("Seismic Toss boosted by this ability and Multi-Lens should strike 3 times", async () => {
game.override.moveset([MoveId.SEISMIC_TOSS]); game.override.moveset([MoveId.SEISMIC_TOSS]).startingHeldItems([{ name: "MULTI_LENS", count: 1 }]);
game.override.startingHeldItems([{ name: "MULTI_LENS", count: 1 }]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -378,8 +373,7 @@ describe("Abilities - Parental Bond", () => {
}); });
it("should not cause user to hit into King's Shield more than once", async () => { it("should not cause user to hit into King's Shield more than once", async () => {
game.override.moveset([MoveId.TACKLE]); game.override.moveset([MoveId.TACKLE]).enemyMoveset([MoveId.KINGS_SHIELD]);
game.override.enemyMoveset([MoveId.KINGS_SHIELD]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -393,8 +387,7 @@ describe("Abilities - Parental Bond", () => {
}); });
it("should not cause user to hit into Storm Drain more than once", async () => { it("should not cause user to hit into Storm Drain more than once", async () => {
game.override.moveset([MoveId.WATER_GUN]); game.override.moveset([MoveId.WATER_GUN]).enemyAbility(AbilityId.STORM_DRAIN);
game.override.enemyAbility(AbilityId.STORM_DRAIN);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);

View File

@ -21,19 +21,18 @@ describe("Abilities - Perish Song", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.disableCrits(); .battleStyle("single")
.disableCrits()
game.override.enemySpecies(SpeciesId.MAGIKARP); .enemySpecies(SpeciesId.MAGIKARP)
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemyAbility(AbilityId.BALL_FETCH)
.starterSpecies(SpeciesId.CURSOLA)
game.override.starterSpecies(SpeciesId.CURSOLA); .ability(AbilityId.PERISH_BODY)
game.override.ability(AbilityId.PERISH_BODY); .moveset([MoveId.SPLASH])
game.override.moveset([MoveId.SPLASH]); .enemyMoveset([MoveId.AQUA_JET]);
}); });
it("should trigger when hit with damaging move", async () => { it("should trigger when hit with damaging move", async () => {
game.override.enemyMoveset([MoveId.AQUA_JET]);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
const cursola = game.scene.getPlayerPokemon(); const cursola = game.scene.getPlayerPokemon();
const magikarp = game.scene.getEnemyPokemon(); const magikarp = game.scene.getEnemyPokemon();
@ -46,7 +45,7 @@ describe("Abilities - Perish Song", () => {
}); });
it("should trigger even when fainting", async () => { it("should trigger even when fainting", async () => {
game.override.enemyMoveset([MoveId.AQUA_JET]).enemyLevel(100).startingLevel(1); game.override.enemyLevel(100).startingLevel(1);
await game.classicMode.startBattle([SpeciesId.CURSOLA, SpeciesId.FEEBAS]); await game.classicMode.startBattle([SpeciesId.CURSOLA, SpeciesId.FEEBAS]);
const magikarp = game.scene.getEnemyPokemon(); const magikarp = game.scene.getEnemyPokemon();
@ -87,9 +86,10 @@ describe("Abilities - Perish Song", () => {
}); });
it("should activate if cursola already has perish song, but not reset its counter", async () => { it("should activate if cursola already has perish song, but not reset its counter", async () => {
game.override.enemyMoveset([MoveId.PERISH_SONG, MoveId.AQUA_JET, MoveId.SPLASH]); game.override
game.override.moveset([MoveId.WHIRLWIND, MoveId.SPLASH]); .enemyMoveset([MoveId.PERISH_SONG, MoveId.AQUA_JET, MoveId.SPLASH])
game.override.startingWave(5); .moveset([MoveId.WHIRLWIND, MoveId.SPLASH])
.startingWave(5);
await game.classicMode.startBattle([SpeciesId.CURSOLA]); await game.classicMode.startBattle([SpeciesId.CURSOLA]);
const cursola = game.scene.getPlayerPokemon(); const cursola = game.scene.getPlayerPokemon();

View File

@ -35,8 +35,7 @@ describe("Abilities - POWER CONSTRUCT", () => {
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 () => {
const baseForm = 2, const baseForm = 2,
completeForm = 4; completeForm = 4;
game.override.startingWave(4); game.override.startingWave(4).starterForms({
game.override.starterForms({
[SpeciesId.ZYGARDE]: completeForm, [SpeciesId.ZYGARDE]: completeForm,
}); });
@ -62,8 +61,7 @@ describe("Abilities - POWER CONSTRUCT", () => {
test("check if fainted 10% Power Construct Pokemon switches to base form on arena reset", async () => { test("check if fainted 10% Power Construct Pokemon switches to base form on arena reset", async () => {
const baseForm = 3, const baseForm = 3,
completeForm = 5; completeForm = 5;
game.override.startingWave(4); game.override.startingWave(4).starterForms({
game.override.starterForms({
[SpeciesId.ZYGARDE]: completeForm, [SpeciesId.ZYGARDE]: completeForm,
}); });

View File

@ -26,11 +26,12 @@ describe("Abilities - Power Spot", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
game.override.moveset([MoveId.TACKLE, MoveId.BREAKING_SWIPE, MoveId.SPLASH, MoveId.DAZZLING_GLEAM]); .battleStyle("double")
game.override.enemyMoveset(MoveId.SPLASH); .moveset([MoveId.TACKLE, MoveId.BREAKING_SWIPE, MoveId.SPLASH, MoveId.DAZZLING_GLEAM])
game.override.enemySpecies(SpeciesId.SHUCKLE); .enemyMoveset(MoveId.SPLASH)
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemySpecies(SpeciesId.SHUCKLE)
.enemyAbility(AbilityId.BALL_FETCH);
}); });
it("raises the power of allies' special moves by 30%", async () => { it("raises the power of allies' special moves by 30%", async () => {

View File

@ -108,8 +108,7 @@ describe("Abilities - Protean", () => {
}); });
test("ability applies correctly even if the type has changed by another ability", async () => { test("ability applies correctly even if the type has changed by another ability", async () => {
game.override.moveset([MoveId.TACKLE]); game.override.moveset([MoveId.TACKLE]).passiveAbility(AbilityId.REFRIGERATE);
game.override.passiveAbility(AbilityId.REFRIGERATE);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -156,8 +155,7 @@ describe("Abilities - Protean", () => {
}); });
test("ability applies correctly even if the pokemon's move misses", async () => { test("ability applies correctly even if the pokemon's move misses", async () => {
game.override.moveset([MoveId.TACKLE]); game.override.moveset([MoveId.TACKLE]).enemyMoveset(MoveId.SPLASH);
game.override.enemyMoveset(MoveId.SPLASH);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -188,8 +186,7 @@ describe("Abilities - Protean", () => {
}); });
test("ability applies correctly even if the pokemon's move fails because of type immunity", async () => { test("ability applies correctly even if the pokemon's move fails because of type immunity", async () => {
game.override.moveset([MoveId.TACKLE]); game.override.moveset([MoveId.TACKLE]).enemySpecies(SpeciesId.GASTLY);
game.override.enemySpecies(SpeciesId.GASTLY);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -262,8 +259,7 @@ describe("Abilities - Protean", () => {
}); });
test("ability applies correctly even if the pokemon's Trick-or-Treat fails", async () => { test("ability applies correctly even if the pokemon's Trick-or-Treat fails", async () => {
game.override.moveset([MoveId.TRICK_OR_TREAT]); game.override.moveset([MoveId.TRICK_OR_TREAT]).enemySpecies(SpeciesId.GASTLY);
game.override.enemySpecies(SpeciesId.GASTLY);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);

View File

@ -23,16 +23,15 @@ describe("Abilities - Quick Draw", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
.battleStyle("single")
game.override.starterSpecies(SpeciesId.MAGIKARP); .starterSpecies(SpeciesId.MAGIKARP)
game.override.ability(AbilityId.QUICK_DRAW); .ability(AbilityId.QUICK_DRAW)
game.override.moveset([MoveId.TACKLE, MoveId.TAIL_WHIP]); .moveset([MoveId.TACKLE, MoveId.TAIL_WHIP])
.enemyLevel(100)
game.override.enemyLevel(100); .enemySpecies(SpeciesId.MAGIKARP)
game.override.enemySpecies(SpeciesId.MAGIKARP); .enemyAbility(AbilityId.BALL_FETCH)
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemyMoveset([MoveId.TACKLE]);
game.override.enemyMoveset([MoveId.TACKLE]);
vi.spyOn( vi.spyOn(
allAbilities[AbilityId.QUICK_DRAW].getAttrs("BypassSpeedChanceAbAttr")[0], allAbilities[AbilityId.QUICK_DRAW].getAttrs("BypassSpeedChanceAbAttr")[0],

View File

@ -22,15 +22,14 @@ describe("Abilities - Sand Spit", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.disableCrits(); .battleStyle("single")
.disableCrits()
game.override.enemySpecies(SpeciesId.MAGIKARP); .enemySpecies(SpeciesId.MAGIKARP)
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemyAbility(AbilityId.BALL_FETCH)
.starterSpecies(SpeciesId.SILICOBRA)
game.override.starterSpecies(SpeciesId.SILICOBRA); .ability(AbilityId.SAND_SPIT)
game.override.ability(AbilityId.SAND_SPIT); .moveset([MoveId.SPLASH, MoveId.COIL]);
game.override.moveset([MoveId.SPLASH, MoveId.COIL]);
}); });
it("should trigger when hit with damaging move", async () => { it("should trigger when hit with damaging move", async () => {

View File

@ -31,8 +31,7 @@ describe("Abilities - SCHOOLING", () => {
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 () => {
const soloForm = 0, const soloForm = 0,
schoolForm = 1; schoolForm = 1;
game.override.startingWave(4); game.override.startingWave(4).starterForms({
game.override.starterForms({
[SpeciesId.WISHIWASHI]: schoolForm, [SpeciesId.WISHIWASHI]: schoolForm,
}); });

View File

@ -24,9 +24,7 @@ describe("Abilities - Screen Cleaner", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override.battleStyle("single").ability(AbilityId.SCREEN_CLEANER).enemySpecies(SpeciesId.SHUCKLE);
game.override.ability(AbilityId.SCREEN_CLEANER);
game.override.enemySpecies(SpeciesId.SHUCKLE);
}); });
it("removes Aurora Veil", async () => { it("removes Aurora Veil", async () => {

View File

@ -22,15 +22,14 @@ describe("Abilities - Seed Sower", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.disableCrits(); .battleStyle("single")
.disableCrits()
game.override.enemySpecies(SpeciesId.MAGIKARP); .enemySpecies(SpeciesId.MAGIKARP)
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemyAbility(AbilityId.BALL_FETCH)
.starterSpecies(SpeciesId.ARBOLIVA)
game.override.starterSpecies(SpeciesId.ARBOLIVA); .ability(AbilityId.SEED_SOWER)
game.override.ability(AbilityId.SEED_SOWER); .moveset([MoveId.SPLASH]);
game.override.moveset([MoveId.SPLASH]);
}); });
it("should trigger when hit with damaging move", async () => { it("should trigger when hit with damaging move", async () => {

View File

@ -26,12 +26,13 @@ describe("Abilities - Shield Dust", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.enemySpecies(SpeciesId.ONIX); .battleStyle("single")
game.override.enemyAbility(AbilityId.SHIELD_DUST); .enemySpecies(SpeciesId.ONIX)
game.override.startingLevel(100); .enemyAbility(AbilityId.SHIELD_DUST)
game.override.moveset(MoveId.AIR_SLASH); .startingLevel(100)
game.override.enemyMoveset(MoveId.TACKLE); .moveset(MoveId.AIR_SLASH)
.enemyMoveset(MoveId.TACKLE);
}); });
it("Shield Dust", async () => { it("Shield Dust", async () => {

View File

@ -26,17 +26,17 @@ describe("Abilities - SHIELDS DOWN", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
const moveToUse = MoveId.SPLASH; const moveToUse = MoveId.SPLASH;
game.override.battleStyle("single"); game.override
game.override.ability(AbilityId.SHIELDS_DOWN); .battleStyle("single")
game.override.moveset([moveToUse]); .ability(AbilityId.SHIELDS_DOWN)
game.override.enemyMoveset([MoveId.TACKLE]); .moveset([moveToUse])
.enemyMoveset([MoveId.TACKLE]);
}); });
test("check if fainted pokemon switched to base form on arena reset", async () => { test("check if fainted pokemon switched to base form on arena reset", async () => {
const meteorForm = 0, const meteorForm = 0,
coreForm = 7; coreForm = 7;
game.override.startingWave(4); game.override.startingWave(4).starterForms({
game.override.starterForms({
[SpeciesId.MINIOR]: coreForm, [SpeciesId.MINIOR]: coreForm,
}); });
@ -70,8 +70,7 @@ describe("Abilities - SHIELDS DOWN", () => {
}); });
test("should still ignore non-volatile status moves used by a pokemon with mold breaker", async () => { test("should still ignore non-volatile status moves used by a pokemon with mold breaker", async () => {
game.override.enemyAbility(AbilityId.MOLD_BREAKER); game.override.enemyAbility(AbilityId.MOLD_BREAKER).enemyMoveset([MoveId.SPORE]);
game.override.enemyMoveset([MoveId.SPORE]);
await game.classicMode.startBattle([SpeciesId.MINIOR]); await game.classicMode.startBattle([SpeciesId.MINIOR]);
@ -94,8 +93,7 @@ describe("Abilities - SHIELDS DOWN", () => {
}); });
test("should ignore status moves even through mold breaker", async () => { test("should ignore status moves even through mold breaker", async () => {
game.override.enemyMoveset([MoveId.SPORE]); game.override.enemyMoveset([MoveId.SPORE]).enemyAbility(AbilityId.MOLD_BREAKER);
game.override.enemyAbility(AbilityId.MOLD_BREAKER);
await game.classicMode.startBattle([SpeciesId.MINIOR]); await game.classicMode.startBattle([SpeciesId.MINIOR]);
@ -108,8 +106,9 @@ describe("Abilities - SHIELDS DOWN", () => {
// toxic spikes currently does not poison flying types when gravity is in effect // toxic spikes currently does not poison flying types when gravity is in effect
test.todo("should become poisoned by toxic spikes when grounded", async () => { test.todo("should become poisoned by toxic spikes when grounded", async () => {
game.override.enemyMoveset([MoveId.GRAVITY, MoveId.TOXIC_SPIKES, MoveId.SPLASH]); game.override
game.override.moveset([MoveId.GRAVITY, MoveId.SPLASH]); .enemyMoveset([MoveId.GRAVITY, MoveId.TOXIC_SPIKES, MoveId.SPLASH])
.moveset([MoveId.GRAVITY, MoveId.SPLASH]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MINIOR]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MINIOR]);
@ -155,9 +154,7 @@ describe("Abilities - SHIELDS DOWN", () => {
// the `NoTransformAbilityAbAttr` attribute is not checked anywhere, so this test cannot pass. // the `NoTransformAbilityAbAttr` attribute is not checked anywhere, so this test cannot pass.
test.todo("ditto should not be immune to status after transforming", async () => { test.todo("ditto should not be immune to status after transforming", async () => {
game.override.enemySpecies(SpeciesId.DITTO); game.override.enemySpecies(SpeciesId.DITTO).enemyAbility(AbilityId.IMPOSTER).moveset([MoveId.SPLASH, MoveId.SPORE]);
game.override.enemyAbility(AbilityId.IMPOSTER);
game.override.moveset([MoveId.SPLASH, MoveId.SPORE]);
await game.classicMode.startBattle([SpeciesId.MINIOR]); await game.classicMode.startBattle([SpeciesId.MINIOR]);
@ -169,11 +166,12 @@ describe("Abilities - SHIELDS DOWN", () => {
}); });
test("should not prevent minior from receiving the fainted status effect in trainer battles", async () => { test("should not prevent minior from receiving the fainted status effect in trainer battles", async () => {
game.override.enemyMoveset([MoveId.TACKLE]); game.override
game.override.moveset([MoveId.THUNDERBOLT]); .enemyMoveset([MoveId.TACKLE])
game.override.startingLevel(100); .moveset([MoveId.THUNDERBOLT])
game.override.startingWave(5); .startingLevel(100)
game.override.enemySpecies(SpeciesId.MINIOR); .startingWave(5)
.enemySpecies(SpeciesId.MINIOR);
await game.classicMode.startBattle([SpeciesId.REGIELEKI]); await game.classicMode.startBattle([SpeciesId.REGIELEKI]);
const minior = game.scene.getEnemyPokemon()!; const minior = game.scene.getEnemyPokemon()!;

View File

@ -28,11 +28,12 @@ describe("Abilities - Steely Spirit", () => {
beforeEach(() => { beforeEach(() => {
ironHeadPower = allMoves[moveToCheck].power; ironHeadPower = allMoves[moveToCheck].power;
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
game.override.enemySpecies(SpeciesId.SHUCKLE); .battleStyle("double")
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemySpecies(SpeciesId.SHUCKLE)
game.override.moveset([MoveId.IRON_HEAD, MoveId.SPLASH]); .enemyAbility(AbilityId.BALL_FETCH)
game.override.enemyMoveset(MoveId.SPLASH); .moveset([MoveId.IRON_HEAD, MoveId.SPLASH])
.enemyMoveset(MoveId.SPLASH);
vi.spyOn(allMoves[moveToCheck], "calculateBattlePower"); vi.spyOn(allMoves[moveToCheck], "calculateBattlePower");
}); });

View File

@ -24,15 +24,14 @@ describe("Abilities - Sturdy", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
.battleStyle("single")
game.override.starterSpecies(SpeciesId.LUCARIO); .starterSpecies(SpeciesId.LUCARIO)
game.override.startingLevel(100); .startingLevel(100)
game.override.moveset([MoveId.CLOSE_COMBAT, MoveId.FISSURE]); .moveset([MoveId.CLOSE_COMBAT, MoveId.FISSURE])
.enemySpecies(SpeciesId.ARON)
game.override.enemySpecies(SpeciesId.ARON); .enemyLevel(5)
game.override.enemyLevel(5); .enemyAbility(AbilityId.STURDY);
game.override.enemyAbility(AbilityId.STURDY);
}); });
test("Sturdy activates when user is at full HP", async () => { test("Sturdy activates when user is at full HP", async () => {

View File

@ -69,10 +69,7 @@ describe("Abilities - Sweet Veil", () => {
}); });
it("prevents the user and its allies already drowsy due to Yawn from falling asleep.", async () => { it("prevents the user and its allies already drowsy due to Yawn from falling asleep.", async () => {
game.override.enemySpecies(SpeciesId.PIKACHU); game.override.enemySpecies(SpeciesId.PIKACHU).enemyLevel(5).startingLevel(5).enemyMoveset(MoveId.SPLASH);
game.override.enemyLevel(5);
game.override.startingLevel(5);
game.override.enemyMoveset(MoveId.SPLASH);
await game.classicMode.startBattle([SpeciesId.SHUCKLE, SpeciesId.SHUCKLE, SpeciesId.SWIRLIX]); await game.classicMode.startBattle([SpeciesId.SHUCKLE, SpeciesId.SHUCKLE, SpeciesId.SWIRLIX]);

View File

@ -51,8 +51,7 @@ describe("Abilities - Unseen Fist", () => {
await testUnseenFistHitResult(game, MoveId.BULLDOZE, MoveId.WIDE_GUARD, false)); await testUnseenFistHitResult(game, MoveId.BULLDOZE, MoveId.WIDE_GUARD, false));
it("should cause a contact move to ignore Protect, but not Substitute", async () => { it("should cause a contact move to ignore Protect, but not Substitute", async () => {
game.override.enemyLevel(1); game.override.enemyLevel(1).moveset([MoveId.TACKLE]);
game.override.moveset([MoveId.TACKLE]);
await game.classicMode.startBattle(); await game.classicMode.startBattle();

View File

@ -3,11 +3,11 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { AbilityId } from "#enums/ability-id"; import { AbilityId } from "#enums/ability-id";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { MoveId } from "#enums/move-id"; import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import { BattlerIndex } from "#enums/battler-index"; import { BattlerIndex } from "#enums/battler-index";
import { SpeciesId } from "#enums/species-id";
// See also: TypeImmunityAbAttr // See also: TypeImmunityAbAttr
describe("Abilities - Volt Absorb", () => { describe("Abilities - Volt Absorb", () => {
@ -26,19 +26,19 @@ describe("Abilities - Volt Absorb", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override.battleStyle("single").disableCrits();
game.override.disableCrits();
}); });
it("does not activate when CHARGE is used", async () => { it("does not activate when CHARGE is used", async () => {
const moveToUse = MoveId.CHARGE; const moveToUse = MoveId.CHARGE;
const ability = AbilityId.VOLT_ABSORB; const ability = AbilityId.VOLT_ABSORB;
game.override.moveset([moveToUse]); game.override
game.override.ability(ability); .moveset([moveToUse])
game.override.enemyMoveset([MoveId.SPLASH, MoveId.NONE, MoveId.NONE, MoveId.NONE]); .ability(ability)
game.override.enemySpecies(SpeciesId.DUSKULL); .enemyMoveset([MoveId.SPLASH])
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemySpecies(SpeciesId.DUSKULL)
.enemyAbility(AbilityId.BALL_FETCH);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
@ -54,10 +54,11 @@ describe("Abilities - Volt Absorb", () => {
}); });
it("should activate regardless of accuracy checks", async () => { it("should activate regardless of accuracy checks", async () => {
game.override.moveset(MoveId.THUNDERBOLT); game.override
game.override.enemyMoveset(MoveId.SPLASH); .moveset(MoveId.THUNDERBOLT)
game.override.enemySpecies(SpeciesId.MAGIKARP); .enemyMoveset(MoveId.SPLASH)
game.override.enemyAbility(AbilityId.VOLT_ABSORB); .enemySpecies(SpeciesId.MAGIKARP)
.enemyAbility(AbilityId.VOLT_ABSORB);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
@ -74,10 +75,11 @@ describe("Abilities - Volt Absorb", () => {
}); });
it("regardless of accuracy should not trigger on pokemon in semi invulnerable state", async () => { it("regardless of accuracy should not trigger on pokemon in semi invulnerable state", async () => {
game.override.moveset(MoveId.THUNDERBOLT); game.override
game.override.enemyMoveset(MoveId.DIVE); .moveset(MoveId.THUNDERBOLT)
game.override.enemySpecies(SpeciesId.MAGIKARP); .enemyMoveset(MoveId.DIVE)
game.override.enemyAbility(AbilityId.VOLT_ABSORB); .enemySpecies(SpeciesId.MAGIKARP)
.enemyAbility(AbilityId.VOLT_ABSORB);
await game.classicMode.startBattle(); await game.classicMode.startBattle();

View File

@ -23,14 +23,15 @@ describe("Abilities - Wind Power", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.enemySpecies(SpeciesId.SHIFTRY); .battleStyle("single")
game.override.enemyAbility(AbilityId.WIND_POWER); .enemySpecies(SpeciesId.SHIFTRY)
game.override.moveset([MoveId.TAILWIND, MoveId.SPLASH, MoveId.PETAL_BLIZZARD, MoveId.SANDSTORM]); .enemyAbility(AbilityId.WIND_POWER)
game.override.enemyMoveset(MoveId.SPLASH); .moveset([MoveId.TAILWIND, MoveId.SPLASH, MoveId.PETAL_BLIZZARD, MoveId.SANDSTORM])
.enemyMoveset(MoveId.SPLASH);
}); });
it("it becomes charged when hit by wind moves", async () => { it("becomes charged when hit by wind moves", async () => {
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
const shiftry = game.scene.getEnemyPokemon()!; const shiftry = game.scene.getEnemyPokemon()!;
@ -42,9 +43,8 @@ describe("Abilities - Wind Power", () => {
expect(shiftry.getTag(BattlerTagType.CHARGED)).toBeDefined(); expect(shiftry.getTag(BattlerTagType.CHARGED)).toBeDefined();
}); });
it("it becomes charged when Tailwind takes effect on its side", async () => { it("becomes charged when Tailwind takes effect on its side", async () => {
game.override.ability(AbilityId.WIND_POWER); game.override.ability(AbilityId.WIND_POWER).enemySpecies(SpeciesId.MAGIKARP);
game.override.enemySpecies(SpeciesId.MAGIKARP);
await game.classicMode.startBattle([SpeciesId.SHIFTRY]); await game.classicMode.startBattle([SpeciesId.SHIFTRY]);
const shiftry = game.scene.getPlayerPokemon()!; const shiftry = game.scene.getPlayerPokemon()!;
@ -58,8 +58,7 @@ describe("Abilities - Wind Power", () => {
}); });
it("does not become charged when Tailwind takes effect on opposing side", async () => { it("does not become charged when Tailwind takes effect on opposing side", async () => {
game.override.enemySpecies(SpeciesId.MAGIKARP); game.override.enemySpecies(SpeciesId.MAGIKARP).ability(AbilityId.WIND_POWER);
game.override.ability(AbilityId.WIND_POWER);
await game.classicMode.startBattle([SpeciesId.SHIFTRY]); await game.classicMode.startBattle([SpeciesId.SHIFTRY]);
const magikarp = game.scene.getEnemyPokemon()!; const magikarp = game.scene.getEnemyPokemon()!;

View File

@ -23,12 +23,13 @@ describe("Abilities - Wonder Skin", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.moveset([MoveId.TACKLE, MoveId.CHARM]); .battleStyle("single")
game.override.ability(AbilityId.BALL_FETCH); .moveset([MoveId.TACKLE, MoveId.CHARM])
game.override.enemySpecies(SpeciesId.SHUCKLE); .ability(AbilityId.BALL_FETCH)
game.override.enemyAbility(AbilityId.WONDER_SKIN); .enemySpecies(SpeciesId.SHUCKLE)
game.override.enemyMoveset(MoveId.SPLASH); .enemyAbility(AbilityId.WONDER_SKIN)
.enemyMoveset(MoveId.SPLASH);
}); });
it("lowers accuracy of status moves to 50%", async () => { it("lowers accuracy of status moves to 50%", async () => {

View File

@ -85,8 +85,7 @@ describe("Abilities - ZEN MODE", () => {
}); });
it("should switch to base form on arena reset", async () => { it("should switch to base form on arena reset", async () => {
game.override.startingWave(4); game.override.startingWave(4).starterForms({
game.override.starterForms({
[SpeciesId.DARMANITAN]: zenForm, [SpeciesId.DARMANITAN]: zenForm,
}); });

View File

@ -34,8 +34,7 @@ describe("Abilities - ZERO TO HERO", () => {
}); });
it("should swap to base form on arena reset", async () => { it("should swap to base form on arena reset", async () => {
game.override.startingWave(4); game.override.startingWave(4).starterForms({
game.override.starterForms({
[SpeciesId.PALAFIN]: heroForm, [SpeciesId.PALAFIN]: heroForm,
}); });

View File

@ -130,12 +130,6 @@ describe("RibbonAchv", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.moveset([]);
game.override.startingLevel(0);
game.override.starterSpecies(0);
game.override.enemyMoveset([]);
game.override.enemySpecies(0);
game.override.startingWave(0);
scene = game.scene; scene = game.scene;
}); });

View File

@ -24,12 +24,14 @@ describe("Weather - Fog", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.weather(WeatherType.FOG).battleStyle("single"); game.override
game.override.moveset([MoveId.TACKLE]); .weather(WeatherType.FOG)
game.override.ability(AbilityId.BALL_FETCH); .battleStyle("single")
game.override.enemyAbility(AbilityId.BALL_FETCH); .moveset([MoveId.TACKLE])
game.override.enemySpecies(SpeciesId.MAGIKARP); .ability(AbilityId.BALL_FETCH)
game.override.enemyMoveset([MoveId.SPLASH]); .enemyAbility(AbilityId.BALL_FETCH)
.enemySpecies(SpeciesId.MAGIKARP)
.enemyMoveset([MoveId.SPLASH]);
}); });
it("move accuracy is multiplied by 90%", async () => { it("move accuracy is multiplied by 90%", async () => {

View File

@ -24,11 +24,12 @@ describe("Weather - Strong Winds", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.startingLevel(10); .battleStyle("single")
game.override.enemySpecies(SpeciesId.TAILLOW); .startingLevel(10)
game.override.enemyAbility(AbilityId.DELTA_STREAM); .enemySpecies(SpeciesId.TAILLOW)
game.override.moveset([MoveId.THUNDERBOLT, MoveId.ICE_BEAM, MoveId.ROCK_SLIDE]); .enemyAbility(AbilityId.DELTA_STREAM)
.moveset([MoveId.THUNDERBOLT, MoveId.ICE_BEAM, MoveId.ROCK_SLIDE]);
}); });
it("electric type move is not very effective on Rayquaza", async () => { it("electric type move is not very effective on Rayquaza", async () => {

View File

@ -24,11 +24,12 @@ describe("Battle order", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.enemySpecies(SpeciesId.MEWTWO); .battleStyle("single")
game.override.enemyAbility(AbilityId.INSOMNIA); .enemySpecies(SpeciesId.MEWTWO)
game.override.ability(AbilityId.INSOMNIA); .enemyAbility(AbilityId.INSOMNIA)
game.override.moveset([MoveId.TACKLE]); .ability(AbilityId.INSOMNIA)
.moveset([MoveId.TACKLE]);
}); });
it("opponent faster than player 50 vs 150", async () => { it("opponent faster than player 50 vs 150", async () => {

View File

@ -10,13 +10,11 @@ import { EnemyCommandPhase } from "#app/phases/enemy-command-phase";
import { LoginPhase } from "#app/phases/login-phase"; import { LoginPhase } from "#app/phases/login-phase";
import { NextEncounterPhase } from "#app/phases/next-encounter-phase"; import { NextEncounterPhase } from "#app/phases/next-encounter-phase";
import { SelectGenderPhase } from "#app/phases/select-gender-phase"; import { SelectGenderPhase } from "#app/phases/select-gender-phase";
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
import { SelectStarterPhase } from "#app/phases/select-starter-phase"; import { SelectStarterPhase } from "#app/phases/select-starter-phase";
import { SummonPhase } from "#app/phases/summon-phase"; import { SummonPhase } from "#app/phases/summon-phase";
import { SwitchPhase } from "#app/phases/switch-phase"; import { SwitchPhase } from "#app/phases/switch-phase";
import { TitlePhase } from "#app/phases/title-phase"; import { TitlePhase } from "#app/phases/title-phase";
import { TurnInitPhase } from "#app/phases/turn-init-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase";
import { VictoryPhase } from "#app/phases/victory-phase";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import { generateStarter } from "#test/testUtils/gameManagerUtils"; import { generateStarter } from "#test/testUtils/gameManagerUtils";
import { UiMode } from "#enums/ui-mode"; import { UiMode } from "#enums/ui-mode";
@ -92,28 +90,22 @@ 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(SpeciesId.MEWTWO); game.override.enemySpecies(SpeciesId.RATTATA).startingLevel(2000).battleStyle("single");
game.override.enemySpecies(SpeciesId.RATTATA); await game.classicMode.startBattle([SpeciesId.MEWTWO]);
game.override.startingLevel(2000); game.move.use(MoveId.TACKLE);
game.override.startingWave(3).battleStyle("single"); await game.phaseInterceptor.to("SelectModifierPhase");
game.override.moveset([MoveId.TACKLE]);
game.override.enemyAbility(AbilityId.HYDRATION);
game.override.enemyMoveset([MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE]);
await game.classicMode.startBattle();
game.move.select(MoveId.TACKLE);
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(SpeciesId.MEWTWO); game.override
game.override.enemySpecies(SpeciesId.RATTATA); .enemySpecies(SpeciesId.RATTATA)
game.override.startingLevel(5); .startingLevel(5)
game.override.startingWave(3); .startingWave(3)
game.override.moveset([MoveId.TACKLE]); .moveset([MoveId.TACKLE])
game.override.enemyAbility(AbilityId.HYDRATION); .enemyAbility(AbilityId.HYDRATION)
game.override.enemyMoveset([MoveId.TAIL_WHIP, MoveId.TAIL_WHIP, MoveId.TAIL_WHIP, MoveId.TAIL_WHIP]); .enemyMoveset([MoveId.TAIL_WHIP, MoveId.TAIL_WHIP, MoveId.TAIL_WHIP, MoveId.TAIL_WHIP])
game.override.battleStyle("single"); .battleStyle("single");
await game.classicMode.startBattle(); await game.classicMode.startBattle([SpeciesId.MEWTWO]);
game.move.select(MoveId.TACKLE); game.move.select(MoveId.TACKLE);
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnInitPhase, false); await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnInitPhase, false);
}, 20000); }, 20000);
@ -247,36 +239,37 @@ describe("Test Battle Phase", () => {
it("kill opponent pokemon", async () => { it("kill opponent pokemon", async () => {
const moveToUse = MoveId.SPLASH; const moveToUse = MoveId.SPLASH;
game.override.battleStyle("single"); game.override
game.override.starterSpecies(SpeciesId.MEWTWO); .battleStyle("single")
game.override.enemySpecies(SpeciesId.RATTATA); .starterSpecies(SpeciesId.MEWTWO)
game.override.enemyAbility(AbilityId.HYDRATION); .enemySpecies(SpeciesId.RATTATA)
game.override.ability(AbilityId.ZEN_MODE); .enemyAbility(AbilityId.HYDRATION)
game.override.startingLevel(2000); .ability(AbilityId.ZEN_MODE)
game.override.startingWave(3); .startingLevel(2000)
game.override.moveset([moveToUse]); .startingWave(3)
game.override.enemyMoveset([MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE]); .moveset([moveToUse])
.enemyMoveset([MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE]);
await game.classicMode.startBattle([SpeciesId.DARMANITAN, SpeciesId.CHARIZARD]); await game.classicMode.startBattle([SpeciesId.DARMANITAN, SpeciesId.CHARIZARD]);
game.move.select(moveToUse); game.move.select(moveToUse);
await game.phaseInterceptor.to(DamageAnimPhase, false); await game.phaseInterceptor.to(DamageAnimPhase, false);
await game.killPokemon(game.scene.currentBattle.enemyParty[0]); await game.killPokemon(game.scene.currentBattle.enemyParty[0]);
expect(game.scene.currentBattle.enemyParty[0].isFainted()).toBe(true); expect(game.scene.currentBattle.enemyParty[0].isFainted()).toBe(true);
await game.phaseInterceptor.to(VictoryPhase, false); await game.phaseInterceptor.to("VictoryPhase");
}, 200000); });
it("to next turn", async () => { it("to next turn", async () => {
const moveToUse = MoveId.SPLASH; const moveToUse = MoveId.SPLASH;
game.override.battleStyle("single"); game.override
game.override.starterSpecies(SpeciesId.MEWTWO); .battleStyle("single")
game.override.enemySpecies(SpeciesId.RATTATA); .enemySpecies(SpeciesId.RATTATA)
game.override.enemyAbility(AbilityId.HYDRATION); .enemyAbility(AbilityId.HYDRATION)
game.override.ability(AbilityId.ZEN_MODE); .ability(AbilityId.ZEN_MODE)
game.override.startingLevel(2000); .startingLevel(2000)
game.override.startingWave(3); .startingWave(3)
game.override.moveset([moveToUse]); .moveset([moveToUse])
game.override.enemyMoveset([MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE]); .enemyMoveset([MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE]);
await game.classicMode.startBattle(); await game.classicMode.startBattle([SpeciesId.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();
@ -294,8 +287,8 @@ describe("Test Battle Phase", () => {
.startingLevel(2000) .startingLevel(2000)
.startingWave(3) .startingWave(3)
.startingBiome(BiomeId.LAKE) .startingBiome(BiomeId.LAKE)
.moveset([moveToUse]); .moveset([moveToUse])
game.override.enemyMoveset([MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE]); .enemyMoveset([MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE, MoveId.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

@ -262,8 +262,7 @@ describe("Escape chance calculations", () => {
}, 20000); }, 20000);
it("double boss opponent", async () => { it("double boss opponent", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double").startingWave(10);
game.override.startingWave(10);
await game.classicMode.startBattle([SpeciesId.BULBASAUR, SpeciesId.ABOMASNOW]); await game.classicMode.startBattle([SpeciesId.BULBASAUR, SpeciesId.ABOMASNOW]);
const playerPokemon = game.scene.getPlayerField(); const playerPokemon = game.scene.getPlayerField();

View File

@ -28,12 +28,11 @@ describe("Evolution", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
.battleStyle("single")
game.override.enemySpecies(SpeciesId.MAGIKARP); .enemySpecies(SpeciesId.MAGIKARP)
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemyAbility(AbilityId.BALL_FETCH)
.startingLevel(60);
game.override.startingLevel(60);
}); });
it("should keep hidden ability after evolving", async () => { it("should keep hidden ability after evolving", async () => {

View File

@ -88,9 +88,7 @@ describe("Spec - Pokemon", () => {
let scene: BattleScene; let scene: BattleScene;
beforeEach(async () => { beforeEach(async () => {
game.override.enemySpecies(SpeciesId.ZUBAT); game.override.enemySpecies(SpeciesId.ZUBAT).starterSpecies(SpeciesId.ABRA).enableStarterFusion();
game.override.starterSpecies(SpeciesId.ABRA);
game.override.enableStarterFusion();
scene = game.scene; scene = game.scene;
}); });
@ -146,8 +144,7 @@ describe("Spec - Pokemon", () => {
}); });
it("Fusing mons with one and two types", async () => { it("Fusing mons with one and two types", async () => {
game.override.starterSpecies(SpeciesId.CHARMANDER); game.override.starterSpecies(SpeciesId.CHARMANDER).starterFusionSpecies(SpeciesId.HOUNDOUR);
game.override.starterFusionSpecies(SpeciesId.HOUNDOUR);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
const pokemon = scene.getPlayerParty()[0]; const pokemon = scene.getPlayerParty()[0];
@ -157,8 +154,7 @@ describe("Spec - Pokemon", () => {
}); });
it("Fusing mons with two and one types", async () => { it("Fusing mons with two and one types", async () => {
game.override.starterSpecies(SpeciesId.NUMEL); game.override.starterSpecies(SpeciesId.NUMEL).starterFusionSpecies(SpeciesId.CHARMANDER);
game.override.starterFusionSpecies(SpeciesId.CHARMANDER);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
const pokemon = scene.getPlayerParty()[0]; const pokemon = scene.getPlayerParty()[0];
@ -168,8 +164,7 @@ describe("Spec - Pokemon", () => {
}); });
it("Fusing two mons with two types", async () => { it("Fusing two mons with two types", async () => {
game.override.starterSpecies(SpeciesId.NATU); game.override.starterSpecies(SpeciesId.NATU).starterFusionSpecies(SpeciesId.HOUNDOUR);
game.override.starterFusionSpecies(SpeciesId.HOUNDOUR);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
const pokemon = scene.getPlayerParty()[0]; const pokemon = scene.getPlayerParty()[0];

View File

@ -22,9 +22,7 @@ describe("EXP Modifier Items", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.enemyAbility(AbilityId.BALL_FETCH); game.override.enemyAbility(AbilityId.BALL_FETCH).ability(AbilityId.BALL_FETCH).battleStyle("single");
game.override.ability(AbilityId.BALL_FETCH);
game.override.battleStyle("single");
}); });
it("EXP booster items stack multiplicatively", async () => { it("EXP booster items stack multiplicatively", async () => {

View File

@ -24,16 +24,14 @@ describe("Moves - Baneful Bunker", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
.battleStyle("single")
game.override.moveset(MoveId.SLASH); .moveset(MoveId.SLASH)
.enemySpecies(SpeciesId.SNORLAX)
game.override.enemySpecies(SpeciesId.SNORLAX); .enemyAbility(AbilityId.INSOMNIA)
game.override.enemyAbility(AbilityId.INSOMNIA); .enemyMoveset(MoveId.BANEFUL_BUNKER)
game.override.enemyMoveset(MoveId.BANEFUL_BUNKER); .startingLevel(100)
.enemyLevel(100);
game.override.startingLevel(100);
game.override.enemyLevel(100);
}); });
test("should protect the user and poison attackers that make contact", async () => { test("should protect the user and poison attackers that make contact", async () => {
await game.classicMode.startBattle([SpeciesId.CHARIZARD]); await game.classicMode.startBattle([SpeciesId.CHARIZARD]);

View File

@ -59,28 +59,23 @@ describe("Moves - Baton Pass", () => {
it("passes stat stage buffs when AI uses it", async () => { it("passes stat stage buffs when AI uses it", async () => {
// arrange // arrange
game.override.startingWave(5).enemyMoveset(new Array(4).fill([MoveId.NASTY_PLOT])); game.override.startingWave(5).enemyMoveset([MoveId.NASTY_PLOT, MoveId.BATON_PASS]);
await game.classicMode.startBattle([SpeciesId.RAICHU, SpeciesId.SHUCKLE]); await game.classicMode.startBattle([SpeciesId.RAICHU, SpeciesId.SHUCKLE]);
// round 1 - ai buffs // round 1 - ai buffs
game.move.select(MoveId.SPLASH); game.move.select(MoveId.SPLASH);
await game.move.forceEnemyMove(MoveId.NASTY_PLOT);
await game.toNextTurn(); await game.toNextTurn();
// round 2 - baton pass // round 2 - baton pass
game.scene.getEnemyPokemon()!.hp = 100;
game.override.enemyMoveset([MoveId.BATON_PASS]);
// Force moveset to update mid-battle
// TODO: replace with enemy ai control function when it's added
game.scene.getEnemyParty()[0].getMoveset();
game.move.select(MoveId.SPLASH); game.move.select(MoveId.SPLASH);
await game.move.forceEnemyMove(MoveId.BATON_PASS);
await game.phaseInterceptor.to("PostSummonPhase", false); await game.phaseInterceptor.to("PostSummonPhase", false);
// assert
// check buffs are still there // check buffs are still there
expect(game.scene.getEnemyPokemon()!.getStatStage(Stat.SPATK)).toEqual(2); expect(game.scene.getEnemyPokemon()?.getStatStage(Stat.SPATK)).toEqual(2);
// confirm that a switch actually happened. can't use species because I // confirm that a switch actually happened. can't use species because I
// can't find a way to override trainer parties with more than 1 pokemon species // can't find a way to override trainer parties with more than 1 pokemon species
expect(game.scene.getEnemyPokemon()!.hp).not.toEqual(100);
expect(game.phaseInterceptor.log.slice(-4)).toEqual([ expect(game.phaseInterceptor.log.slice(-4)).toEqual([
"MoveEffectPhase", "MoveEffectPhase",
"SwitchSummonPhase", "SwitchSummonPhase",

View File

@ -129,8 +129,7 @@ describe("Moves - Beak Blast", () => {
}); });
it("should not burn a long reach enemy that hits the user with a contact move", async () => { it("should not burn a long reach enemy that hits the user with a contact move", async () => {
game.override.enemyAbility(AbilityId.LONG_REACH); game.override.enemyAbility(AbilityId.LONG_REACH).enemyMoveset([MoveId.FALSE_SWIPE]).enemyLevel(100);
game.override.enemyMoveset([MoveId.FALSE_SWIPE]).enemyLevel(100);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
game.move.select(MoveId.BEAK_BLAST); game.move.select(MoveId.BEAK_BLAST);
await game.phaseInterceptor.to("BerryPhase", false); await game.phaseInterceptor.to("BerryPhase", false);

View File

@ -23,15 +23,14 @@ describe("Moves - Beat Up", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
.battleStyle("single")
game.override.enemySpecies(SpeciesId.SNORLAX); .enemySpecies(SpeciesId.SNORLAX)
game.override.enemyLevel(100); .enemyLevel(100)
game.override.enemyMoveset([MoveId.SPLASH]); .enemyMoveset([MoveId.SPLASH])
game.override.enemyAbility(AbilityId.INSOMNIA); .enemyAbility(AbilityId.INSOMNIA)
.startingLevel(100)
game.override.startingLevel(100); .moveset([MoveId.BEAT_UP]);
game.override.moveset([MoveId.BEAT_UP]);
}); });
it("should hit once for each healthy player Pokemon", async () => { it("should hit once for each healthy player Pokemon", async () => {

View File

@ -27,14 +27,15 @@ describe("Moves - Ceaseless Edge", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.enemySpecies(SpeciesId.RATTATA); .battleStyle("single")
game.override.enemyAbility(AbilityId.RUN_AWAY); .enemySpecies(SpeciesId.RATTATA)
game.override.enemyPassiveAbility(AbilityId.RUN_AWAY); .enemyAbility(AbilityId.RUN_AWAY)
game.override.startingLevel(100); .enemyPassiveAbility(AbilityId.RUN_AWAY)
game.override.enemyLevel(100); .startingLevel(100)
game.override.moveset([MoveId.CEASELESS_EDGE, MoveId.SPLASH, MoveId.ROAR]); .enemyLevel(100)
game.override.enemyMoveset(MoveId.SPLASH); .moveset([MoveId.CEASELESS_EDGE, MoveId.SPLASH, MoveId.ROAR])
.enemyMoveset(MoveId.SPLASH);
vi.spyOn(allMoves[MoveId.CEASELESS_EDGE], "accuracy", "get").mockReturnValue(100); vi.spyOn(allMoves[MoveId.CEASELESS_EDGE], "accuracy", "get").mockReturnValue(100);
}); });
@ -82,8 +83,7 @@ describe("Moves - Ceaseless Edge", () => {
}); });
test("trainer - move should hit twice, apply two layers of spikes, force switch opponent - opponent takes damage", async () => { test("trainer - move should hit twice, apply two layers of spikes, force switch opponent - opponent takes damage", async () => {
game.override.startingHeldItems([{ name: "MULTI_LENS" }]); game.override.startingHeldItems([{ name: "MULTI_LENS" }]).startingWave(25);
game.override.startingWave(25);
await game.classicMode.startBattle([SpeciesId.ILLUMISE]); await game.classicMode.startBattle([SpeciesId.ILLUMISE]);

View File

@ -27,12 +27,13 @@ describe("Moves - Clangorous Soul", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.starterSpecies(SpeciesId.MAGIKARP); game.override
game.override.enemySpecies(SpeciesId.SNORLAX); .starterSpecies(SpeciesId.MAGIKARP)
game.override.startingLevel(100); .enemySpecies(SpeciesId.SNORLAX)
game.override.enemyLevel(100); .startingLevel(100)
game.override.moveset([MoveId.CLANGOROUS_SOUL]); .enemyLevel(100)
game.override.enemyMoveset(MoveId.SPLASH); .moveset([MoveId.CLANGOROUS_SOUL])
.enemyMoveset(MoveId.SPLASH);
}); });
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Clangorous_Soul_(move) //Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Clangorous_Soul_(move)

View File

@ -26,16 +26,14 @@ describe("Moves - Crafty Shield", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
.battleStyle("double")
game.override.moveset([MoveId.CRAFTY_SHIELD, MoveId.SPLASH, MoveId.SWORDS_DANCE]); .moveset([MoveId.CRAFTY_SHIELD, MoveId.SPLASH, MoveId.SWORDS_DANCE])
.enemySpecies(SpeciesId.SNORLAX)
game.override.enemySpecies(SpeciesId.SNORLAX); .enemyMoveset([MoveId.GROWL])
game.override.enemyMoveset([MoveId.GROWL]); .enemyAbility(AbilityId.INSOMNIA)
game.override.enemyAbility(AbilityId.INSOMNIA); .startingLevel(100)
.enemyLevel(100);
game.override.startingLevel(100);
game.override.enemyLevel(100);
}); });
test("should protect the user and allies from status moves", async () => { test("should protect the user and allies from status moves", async () => {
@ -73,8 +71,7 @@ describe("Moves - Crafty Shield", () => {
}); });
test("should protect the user and allies from moves that ignore other protection", async () => { test("should protect the user and allies from moves that ignore other protection", async () => {
game.override.enemySpecies(SpeciesId.DUSCLOPS); game.override.enemySpecies(SpeciesId.DUSCLOPS).enemyMoveset([MoveId.CURSE]);
game.override.enemyMoveset([MoveId.CURSE]);
await game.classicMode.startBattle([SpeciesId.CHARIZARD, SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.CHARIZARD, SpeciesId.BLASTOISE]);

View File

@ -1,6 +1,5 @@
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import { PokemonType } from "#enums/pokemon-type"; import { PokemonType } from "#enums/pokemon-type";
import { SpeciesId } from "#enums/species-id";
import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { AbilityId } from "#enums/ability-id"; import { AbilityId } from "#enums/ability-id";
@ -9,6 +8,7 @@ import { MoveId } from "#enums/move-id";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser"; 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 { SpeciesId } from "#enums/species-id";
describe("Moves - Dragon Rage", () => { describe("Moves - Dragon Rage", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -31,19 +31,18 @@ describe("Moves - Dragon Rage", () => {
beforeEach(async () => { beforeEach(async () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
.battleStyle("single")
game.override.starterSpecies(SpeciesId.SNORLAX); .starterSpecies(SpeciesId.SNORLAX)
game.override.moveset([MoveId.DRAGON_RAGE]); .moveset([MoveId.DRAGON_RAGE])
game.override.ability(AbilityId.BALL_FETCH); .ability(AbilityId.BALL_FETCH)
game.override.passiveAbility(AbilityId.BALL_FETCH); .passiveAbility(AbilityId.BALL_FETCH)
game.override.startingLevel(100); .startingLevel(100)
.enemySpecies(SpeciesId.SNORLAX)
game.override.enemySpecies(SpeciesId.SNORLAX); .enemyMoveset(MoveId.SPLASH)
game.override.enemyMoveset(MoveId.SPLASH); .enemyAbility(AbilityId.BALL_FETCH)
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemyPassiveAbility(AbilityId.BALL_FETCH)
game.override.enemyPassiveAbility(AbilityId.BALL_FETCH); .enemyLevel(100);
game.override.enemyLevel(100);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
@ -101,8 +100,7 @@ describe("Moves - Dragon Rage", () => {
}); });
it("ignores damage modification from abilities, for example ICE_SCALES", async () => { it("ignores damage modification from abilities, for example ICE_SCALES", async () => {
game.override.disableCrits(); game.override.disableCrits().enemyAbility(AbilityId.ICE_SCALES);
game.override.enemyAbility(AbilityId.ICE_SCALES);
game.move.select(MoveId.DRAGON_RAGE); game.move.select(MoveId.DRAGON_RAGE);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);

View File

@ -38,15 +38,7 @@ describe("Moves - Dynamax Cannon", () => {
.enemySpecies(SpeciesId.MAGIKARP) .enemySpecies(SpeciesId.MAGIKARP)
.enemyMoveset(MoveId.SPLASH); .enemyMoveset(MoveId.SPLASH);
// Note that, for Waves 1-10, the level cap is 10 vi.spyOn(allMoves[MoveId.DYNAMAX_CANNON], "calculateBattlePower");
game.override.startingWave(1);
game.override.battleStyle("single");
game.override.disableCrits();
game.override.enemySpecies(SpeciesId.MAGIKARP);
game.override.enemyMoveset([MoveId.SPLASH, MoveId.SPLASH, MoveId.SPLASH, MoveId.SPLASH]);
vi.spyOn(dynamaxCannon, "calculateBattlePower");
}); });
it("should return 100 power against an enemy below level cap", async () => { it("should return 100 power against an enemy below level cap", async () => {

View File

@ -28,12 +28,13 @@ describe("Moves - FILLET AWAY", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.starterSpecies(SpeciesId.MAGIKARP); game.override
game.override.enemySpecies(SpeciesId.SNORLAX); .starterSpecies(SpeciesId.MAGIKARP)
game.override.startingLevel(100); .enemySpecies(SpeciesId.SNORLAX)
game.override.enemyLevel(100); .startingLevel(100)
game.override.moveset([MoveId.FILLET_AWAY]); .enemyLevel(100)
game.override.enemyMoveset(MoveId.SPLASH); .moveset([MoveId.FILLET_AWAY])
.enemyMoveset(MoveId.SPLASH);
}); });
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/fillet_away_(move) //Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/fillet_away_(move)

View File

@ -1,5 +1,4 @@
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import { SpeciesId } from "#enums/species-id";
import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon";
import { DamageAnimPhase } from "#app/phases/damage-anim-phase"; import { DamageAnimPhase } from "#app/phases/damage-anim-phase";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
@ -8,6 +7,7 @@ import { MoveId } from "#enums/move-id";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser"; 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 { SpeciesId } from "#enums/species-id";
describe("Moves - Fissure", () => { describe("Moves - Fissure", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -28,18 +28,17 @@ describe("Moves - Fissure", () => {
beforeEach(async () => { beforeEach(async () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.disableCrits(); .battleStyle("single")
.disableCrits()
game.override.starterSpecies(SpeciesId.SNORLAX); .starterSpecies(SpeciesId.SNORLAX)
game.override.moveset([MoveId.FISSURE]); .moveset([MoveId.FISSURE])
game.override.passiveAbility(AbilityId.BALL_FETCH); .passiveAbility(AbilityId.BALL_FETCH)
game.override.startingLevel(100); .startingLevel(100)
.enemySpecies(SpeciesId.SNORLAX)
game.override.enemySpecies(SpeciesId.SNORLAX); .enemyMoveset(MoveId.SPLASH)
game.override.enemyMoveset(MoveId.SPLASH); .enemyPassiveAbility(AbilityId.BALL_FETCH)
game.override.enemyPassiveAbility(AbilityId.BALL_FETCH); .enemyLevel(100);
game.override.enemyLevel(100);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
@ -48,8 +47,7 @@ describe("Moves - Fissure", () => {
}); });
it("ignores damage modification from abilities, for example FUR_COAT", async () => { it("ignores damage modification from abilities, for example FUR_COAT", async () => {
game.override.ability(AbilityId.NO_GUARD); game.override.ability(AbilityId.NO_GUARD).enemyAbility(AbilityId.FUR_COAT);
game.override.enemyAbility(AbilityId.FUR_COAT);
game.move.select(MoveId.FISSURE); game.move.select(MoveId.FISSURE);
await game.phaseInterceptor.to(DamageAnimPhase, true); await game.phaseInterceptor.to(DamageAnimPhase, true);

View File

@ -35,14 +35,15 @@ describe("Moves - Flame Burst", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
game.override.moveset([MoveId.FLAME_BURST, MoveId.SPLASH]); .battleStyle("double")
game.override.disableCrits(); .moveset([MoveId.FLAME_BURST, MoveId.SPLASH])
game.override.ability(AbilityId.UNNERVE); .disableCrits()
game.override.startingWave(4); .ability(AbilityId.UNNERVE)
game.override.enemySpecies(SpeciesId.SHUCKLE); .startingWave(4)
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemySpecies(SpeciesId.SHUCKLE)
game.override.enemyMoveset([MoveId.SPLASH]); .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset([MoveId.SPLASH]);
}); });
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 () => {

View File

@ -26,11 +26,12 @@ describe("Moves - Flower Shield", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.ability(AbilityId.NONE); game.override
game.override.enemyAbility(AbilityId.NONE); .ability(AbilityId.NONE)
game.override.battleStyle("single"); .enemyAbility(AbilityId.NONE)
game.override.moveset([MoveId.FLOWER_SHIELD, MoveId.SPLASH]); .battleStyle("single")
game.override.enemyMoveset(MoveId.SPLASH); .moveset([MoveId.FLOWER_SHIELD, MoveId.SPLASH])
.enemyMoveset(MoveId.SPLASH);
}); });
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 () => {

View File

@ -24,14 +24,15 @@ describe("Moves - Follow Me", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
game.override.starterSpecies(SpeciesId.AMOONGUSS); .battleStyle("double")
game.override.ability(AbilityId.BALL_FETCH); .starterSpecies(SpeciesId.AMOONGUSS)
game.override.enemySpecies(SpeciesId.SNORLAX); .ability(AbilityId.BALL_FETCH)
game.override.startingLevel(100); .enemySpecies(SpeciesId.SNORLAX)
game.override.enemyLevel(100); .startingLevel(100)
game.override.moveset([MoveId.FOLLOW_ME, MoveId.RAGE_POWDER, MoveId.SPOTLIGHT, MoveId.QUICK_ATTACK]); .enemyLevel(100)
game.override.enemyMoveset([MoveId.TACKLE, MoveId.FOLLOW_ME, MoveId.SPLASH]); .moveset([MoveId.FOLLOW_ME, MoveId.RAGE_POWDER, MoveId.SPOTLIGHT, MoveId.QUICK_ATTACK])
.enemyMoveset([MoveId.TACKLE, MoveId.FOLLOW_ME, MoveId.SPLASH]);
}); });
test("move should redirect enemy attacks to the user", async () => { test("move should redirect enemy attacks to the user", async () => {
@ -73,8 +74,7 @@ describe("Moves - Follow Me", () => {
}); });
test("move effect should be bypassed by Stalwart", async () => { test("move effect should be bypassed by Stalwart", async () => {
game.override.ability(AbilityId.STALWART); game.override.ability(AbilityId.STALWART).moveset([MoveId.QUICK_ATTACK]);
game.override.moveset([MoveId.QUICK_ATTACK]);
await game.classicMode.startBattle([SpeciesId.AMOONGUSS, SpeciesId.CHARIZARD]); await game.classicMode.startBattle([SpeciesId.AMOONGUSS, SpeciesId.CHARIZARD]);

View File

@ -22,14 +22,15 @@ describe("Moves - Gastro Acid", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
game.override.startingLevel(1); .battleStyle("double")
game.override.enemyLevel(100); .startingLevel(1)
game.override.ability(AbilityId.BALL_FETCH); .enemyLevel(100)
game.override.moveset([MoveId.GASTRO_ACID, MoveId.WATER_GUN, MoveId.SPLASH, MoveId.CORE_ENFORCER]); .ability(AbilityId.NONE)
game.override.enemySpecies(SpeciesId.BIDOOF); .moveset([MoveId.GASTRO_ACID, MoveId.WATER_GUN, MoveId.SPLASH, MoveId.CORE_ENFORCER])
game.override.enemyMoveset(MoveId.SPLASH); .enemySpecies(SpeciesId.BIDOOF)
game.override.enemyAbility(AbilityId.WATER_ABSORB); .enemyMoveset(MoveId.SPLASH)
.enemyAbility(AbilityId.WATER_ABSORB);
}); });
it("suppresses effect of ability", async () => { it("suppresses effect of ability", async () => {

View File

@ -28,13 +28,12 @@ describe("Moves - Glaive Rush", () => {
.enemySpecies(SpeciesId.MAGIKARP) .enemySpecies(SpeciesId.MAGIKARP)
.enemyAbility(AbilityId.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset([MoveId.GLAIVE_RUSH]) .enemyMoveset([MoveId.GLAIVE_RUSH])
.starterSpecies(SpeciesId.KLINK)
.ability(AbilityId.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.moveset([MoveId.SHADOW_SNEAK, MoveId.AVALANCHE, MoveId.SPLASH, MoveId.GLAIVE_RUSH]); .moveset([MoveId.SHADOW_SNEAK, MoveId.AVALANCHE, MoveId.SPLASH, MoveId.GLAIVE_RUSH]);
}); });
it("takes double damage from attacks", async () => { it("takes double damage from attacks", async () => {
await game.classicMode.startBattle(); await game.classicMode.startBattle([SpeciesId.KLINK]);
const enemy = game.scene.getEnemyPokemon()!; const enemy = game.scene.getEnemyPokemon()!;
enemy.hp = 1000; enemy.hp = 1000;
@ -49,7 +48,7 @@ describe("Moves - Glaive Rush", () => {
}); });
it("always gets hit by attacks", async () => { it("always gets hit by attacks", async () => {
await game.classicMode.startBattle(); await game.classicMode.startBattle([SpeciesId.KLINK]);
const enemy = game.scene.getEnemyPokemon()!; const enemy = game.scene.getEnemyPokemon()!;
enemy.hp = 1000; enemy.hp = 1000;
@ -62,7 +61,7 @@ describe("Moves - Glaive Rush", () => {
it("interacts properly with multi-lens", async () => { it("interacts properly with multi-lens", async () => {
game.override.startingHeldItems([{ name: "MULTI_LENS", count: 2 }]).enemyMoveset([MoveId.AVALANCHE]); game.override.startingHeldItems([{ name: "MULTI_LENS", count: 2 }]).enemyMoveset([MoveId.AVALANCHE]);
await game.classicMode.startBattle(); await game.classicMode.startBattle([SpeciesId.KLINK]);
const player = game.scene.getPlayerPokemon()!; const player = game.scene.getPlayerPokemon()!;
const enemy = game.scene.getEnemyPokemon()!; const enemy = game.scene.getEnemyPokemon()!;
@ -82,7 +81,7 @@ describe("Moves - Glaive Rush", () => {
it("secondary effects only last until next move", async () => { it("secondary effects only last until next move", async () => {
game.override.enemyMoveset([MoveId.SHADOW_SNEAK]); game.override.enemyMoveset([MoveId.SHADOW_SNEAK]);
await game.classicMode.startBattle(); await game.classicMode.startBattle([SpeciesId.KLINK]);
const player = game.scene.getPlayerPokemon()!; const player = game.scene.getPlayerPokemon()!;
const enemy = game.scene.getEnemyPokemon()!; const enemy = game.scene.getEnemyPokemon()!;
@ -106,7 +105,7 @@ describe("Moves - Glaive Rush", () => {
}); });
it("secondary effects are removed upon switching", async () => { it("secondary effects are removed upon switching", async () => {
game.override.enemyMoveset([MoveId.SHADOW_SNEAK]).starterSpecies(0); game.override.enemyMoveset([MoveId.SHADOW_SNEAK]);
await game.classicMode.startBattle([SpeciesId.KLINK, SpeciesId.FEEBAS]); await game.classicMode.startBattle([SpeciesId.KLINK, SpeciesId.FEEBAS]);
const player = game.scene.getPlayerPokemon()!; const player = game.scene.getPlayerPokemon()!;
@ -127,8 +126,10 @@ describe("Moves - Glaive Rush", () => {
}); });
it("secondary effects don't activate if move fails", async () => { it("secondary effects don't activate if move fails", async () => {
game.override.moveset([MoveId.SHADOW_SNEAK, MoveId.PROTECT, MoveId.SPLASH, MoveId.GLAIVE_RUSH]); game.override
await game.classicMode.startBattle(); .moveset([MoveId.SHADOW_SNEAK, MoveId.PROTECT, MoveId.SPLASH, MoveId.GLAIVE_RUSH])
.enemyMoveset([MoveId.GLAIVE_RUSH, MoveId.SPLASH]);
await game.classicMode.startBattle([SpeciesId.KLINK]);
const player = game.scene.getPlayerPokemon()!; const player = game.scene.getPlayerPokemon()!;
const enemy = game.scene.getEnemyPokemon()!; const enemy = game.scene.getEnemyPokemon()!;
@ -137,15 +138,17 @@ describe("Moves - Glaive Rush", () => {
player.hp = 1000; player.hp = 1000;
game.move.select(MoveId.PROTECT); game.move.select(MoveId.PROTECT);
await game.move.forceEnemyMove(MoveId.GLAIVE_RUSH);
await game.phaseInterceptor.to("TurnEndPhase"); await game.phaseInterceptor.to("TurnEndPhase");
game.move.select(MoveId.SHADOW_SNEAK); game.move.select(MoveId.SHADOW_SNEAK);
await game.move.forceEnemyMove(MoveId.GLAIVE_RUSH);
await game.phaseInterceptor.to("TurnEndPhase"); await game.phaseInterceptor.to("TurnEndPhase");
game.override.enemyMoveset([MoveId.SPLASH]);
const damagedHP1 = 1000 - enemy.hp; const damagedHP1 = 1000 - enemy.hp;
enemy.hp = 1000; enemy.hp = 1000;
game.move.select(MoveId.SHADOW_SNEAK); game.move.select(MoveId.SHADOW_SNEAK);
await game.move.forceEnemyMove(MoveId.SPLASH);
await game.phaseInterceptor.to("TurnEndPhase"); await game.phaseInterceptor.to("TurnEndPhase");
const damagedHP2 = 1000 - enemy.hp; const damagedHP2 = 1000 - enemy.hp;

View File

@ -24,11 +24,12 @@ describe("Moves - Growth", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.enemyAbility(AbilityId.MOXIE); .battleStyle("single")
game.override.ability(AbilityId.INSOMNIA); .enemyAbility(AbilityId.MOXIE)
game.override.moveset([MoveId.GROWTH]); .ability(AbilityId.INSOMNIA)
game.override.enemyMoveset(MoveId.SPLASH); .moveset([MoveId.GROWTH])
.enemyMoveset(MoveId.SPLASH);
}); });
it("should raise SPATK stat stage by 1", async () => { it("should raise SPATK stat stage by 1", async () => {

View File

@ -27,12 +27,13 @@ describe("Moves - Hard Press", () => {
beforeEach(() => { beforeEach(() => {
moveToCheck = allMoves[MoveId.HARD_PRESS]; moveToCheck = allMoves[MoveId.HARD_PRESS];
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.ability(AbilityId.BALL_FETCH); .battleStyle("single")
game.override.enemySpecies(SpeciesId.MUNCHLAX); .ability(AbilityId.BALL_FETCH)
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemySpecies(SpeciesId.MUNCHLAX)
game.override.enemyMoveset(MoveId.SPLASH); .enemyAbility(AbilityId.BALL_FETCH)
game.override.moveset([MoveId.HARD_PRESS]); .enemyMoveset(MoveId.SPLASH)
.moveset([MoveId.HARD_PRESS]);
vi.spyOn(moveToCheck, "calculateBattlePower"); vi.spyOn(moveToCheck, "calculateBattlePower");
}); });

View File

@ -23,16 +23,15 @@ describe("Moves - Haze", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
.battleStyle("single")
game.override.enemySpecies(SpeciesId.RATTATA); .enemySpecies(SpeciesId.RATTATA)
game.override.enemyLevel(100); .enemyLevel(100)
game.override.enemyMoveset(MoveId.SPLASH); .enemyMoveset(MoveId.SPLASH)
game.override.enemyAbility(AbilityId.NONE); .enemyAbility(AbilityId.BALL_FETCH)
.startingLevel(100)
game.override.startingLevel(100); .moveset([MoveId.HAZE, MoveId.SWORDS_DANCE, MoveId.CHARM, MoveId.SPLASH])
game.override.moveset([MoveId.HAZE, MoveId.SWORDS_DANCE, MoveId.CHARM, MoveId.SPLASH]); .ability(AbilityId.BALL_FETCH);
game.override.ability(AbilityId.NONE);
}); });
it("should reset all stat changes of all Pokemon on field", async () => { it("should reset all stat changes of all Pokemon on field", async () => {

View File

@ -26,14 +26,14 @@ describe("Moves - Hyper Beam", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.ability(AbilityId.BALL_FETCH); .battleStyle("single")
game.override.enemySpecies(SpeciesId.SNORLAX); .ability(AbilityId.BALL_FETCH)
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemySpecies(SpeciesId.SNORLAX)
game.override.enemyMoveset([MoveId.SPLASH]); .enemyAbility(AbilityId.BALL_FETCH)
game.override.enemyLevel(100); .enemyMoveset([MoveId.SPLASH])
.enemyLevel(100)
game.override.moveset([MoveId.HYPER_BEAM, MoveId.TACKLE]); .moveset([MoveId.HYPER_BEAM, MoveId.TACKLE]);
vi.spyOn(allMoves[MoveId.HYPER_BEAM], "accuracy", "get").mockReturnValue(100); vi.spyOn(allMoves[MoveId.HYPER_BEAM], "accuracy", "get").mockReturnValue(100);
}); });

View File

@ -22,14 +22,13 @@ describe("Moves - Lunar Blessing", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
.battleStyle("double")
game.override.enemySpecies(SpeciesId.SHUCKLE); .enemySpecies(SpeciesId.SHUCKLE)
game.override.enemyMoveset(MoveId.SPLASH); .enemyMoveset(MoveId.SPLASH)
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemyAbility(AbilityId.BALL_FETCH)
.moveset([MoveId.LUNAR_BLESSING, MoveId.SPLASH])
game.override.moveset([MoveId.LUNAR_BLESSING, MoveId.SPLASH]); .ability(AbilityId.BALL_FETCH);
game.override.ability(AbilityId.BALL_FETCH);
}); });
it("should restore 25% HP of the user and its ally", async () => { it("should restore 25% HP of the user and its ally", async () => {

View File

@ -56,8 +56,7 @@ describe("Moves - Magic Coat", () => {
}); });
it("should not reflect moves used on the next turn", async () => { it("should not reflect moves used on the next turn", async () => {
game.override.moveset([MoveId.GROWL, MoveId.SPLASH]); game.override.moveset([MoveId.GROWL, MoveId.SPLASH]).enemyMoveset([MoveId.MAGIC_COAT, MoveId.SPLASH]);
game.override.enemyMoveset([MoveId.MAGIC_COAT, MoveId.SPLASH]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
// turn 1 // turn 1
@ -82,8 +81,7 @@ describe("Moves - Magic Coat", () => {
}); });
it("should individually bounce back multi-target moves when used by both targets in doubles", async () => { it("should individually bounce back multi-target moves when used by both targets in doubles", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double").moveset([MoveId.GROWL, MoveId.SPLASH]);
game.override.moveset([MoveId.GROWL, MoveId.SPLASH]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]);
game.move.select(MoveId.GROWL, 0); game.move.select(MoveId.GROWL, 0);
@ -95,9 +93,10 @@ describe("Moves - Magic Coat", () => {
}); });
it("should bounce back a spread status move against both pokemon", async () => { it("should bounce back a spread status move against both pokemon", async () => {
game.override.battleStyle("double"); game.override
game.override.moveset([MoveId.GROWL, MoveId.SPLASH]); .battleStyle("double")
game.override.enemyMoveset([MoveId.SPLASH, MoveId.MAGIC_COAT]); .moveset([MoveId.GROWL, MoveId.SPLASH])
.enemyMoveset([MoveId.SPLASH, MoveId.MAGIC_COAT]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]);
game.move.select(MoveId.GROWL, 0); game.move.select(MoveId.GROWL, 0);
@ -121,10 +120,11 @@ describe("Moves - Magic Coat", () => {
}); });
it("should not bounce back a move that was just bounced", async () => { it("should not bounce back a move that was just bounced", async () => {
game.override.battleStyle("double"); game.override
game.override.ability(AbilityId.MAGIC_BOUNCE); .battleStyle("double")
game.override.moveset([MoveId.GROWL, MoveId.MAGIC_COAT]); .ability(AbilityId.MAGIC_BOUNCE)
game.override.enemyMoveset([MoveId.SPLASH, MoveId.MAGIC_COAT]); .moveset([MoveId.GROWL, MoveId.MAGIC_COAT])
.enemyMoveset([MoveId.SPLASH, MoveId.MAGIC_COAT]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]);
game.move.select(MoveId.MAGIC_COAT, 0); game.move.select(MoveId.MAGIC_COAT, 0);
@ -147,8 +147,7 @@ describe("Moves - Magic Coat", () => {
}); });
it("should still bounce back a move from a mold breaker user", async () => { it("should still bounce back a move from a mold breaker user", async () => {
game.override.ability(AbilityId.MOLD_BREAKER); game.override.ability(AbilityId.MOLD_BREAKER).moveset([MoveId.GROWL]);
game.override.moveset([MoveId.GROWL]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
game.move.select(MoveId.GROWL); game.move.select(MoveId.GROWL);
@ -159,9 +158,8 @@ describe("Moves - Magic Coat", () => {
}); });
it("should only bounce spikes back once when both targets use magic coat in doubles", async () => { it("should only bounce spikes back once when both targets use magic coat in doubles", async () => {
game.override.battleStyle("double"); game.override.battleStyle("double").moveset([MoveId.SPIKES]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
game.override.moveset([MoveId.SPIKES]);
game.move.select(MoveId.SPIKES); game.move.select(MoveId.SPIKES);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
@ -171,9 +169,8 @@ describe("Moves - Magic Coat", () => {
}); });
it("should not bounce back curse", async () => { it("should not bounce back curse", async () => {
game.override.starterSpecies(SpeciesId.GASTLY);
await game.classicMode.startBattle([SpeciesId.GASTLY]);
game.override.moveset([MoveId.CURSE]); game.override.moveset([MoveId.CURSE]);
await game.classicMode.startBattle([SpeciesId.GASTLY]);
game.move.select(MoveId.CURSE); game.move.select(MoveId.CURSE);
await game.phaseInterceptor.to("BerryPhase"); await game.phaseInterceptor.to("BerryPhase");
@ -183,9 +180,10 @@ describe("Moves - Magic Coat", () => {
// TODO: encore is failing if the last move was virtual. // TODO: encore is failing if the last move was virtual.
it.todo("should not cause the bounced move to count for encore", async () => { it.todo("should not cause the bounced move to count for encore", async () => {
game.override.moveset([MoveId.GROWL, MoveId.ENCORE]); game.override
game.override.enemyMoveset([MoveId.MAGIC_COAT, MoveId.TACKLE]); .moveset([MoveId.GROWL, MoveId.ENCORE])
game.override.enemyAbility(AbilityId.MAGIC_BOUNCE); .enemyMoveset([MoveId.MAGIC_COAT, MoveId.TACKLE])
.enemyAbility(AbilityId.MAGIC_BOUNCE);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -206,9 +204,8 @@ describe("Moves - Magic Coat", () => {
// TODO: stomping tantrum should consider moves that were bounced. // TODO: stomping tantrum should consider moves that were bounced.
it.todo("should cause stomping tantrum to double in power when the last move was bounced", async () => { it.todo("should cause stomping tantrum to double in power when the last move was bounced", async () => {
game.override.battleStyle("single"); game.override.battleStyle("single").moveset([MoveId.STOMPING_TANTRUM, MoveId.CHARM]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
game.override.moveset([MoveId.STOMPING_TANTRUM, MoveId.CHARM]);
const stomping_tantrum = allMoves[MoveId.STOMPING_TANTRUM]; const stomping_tantrum = allMoves[MoveId.STOMPING_TANTRUM];
vi.spyOn(stomping_tantrum, "calculateBattlePower"); vi.spyOn(stomping_tantrum, "calculateBattlePower");
@ -249,8 +246,7 @@ describe("Moves - Magic Coat", () => {
it("should respect immunities when bouncing a move", async () => { it("should respect immunities when bouncing a move", async () => {
vi.spyOn(allMoves[MoveId.THUNDER_WAVE], "accuracy", "get").mockReturnValue(100); vi.spyOn(allMoves[MoveId.THUNDER_WAVE], "accuracy", "get").mockReturnValue(100);
game.override.moveset([MoveId.THUNDER_WAVE, MoveId.GROWL]); game.override.moveset([MoveId.THUNDER_WAVE, MoveId.GROWL]).ability(AbilityId.SOUNDPROOF);
game.override.ability(AbilityId.SOUNDPROOF);
await game.classicMode.startBattle([SpeciesId.PHANPY]); await game.classicMode.startBattle([SpeciesId.PHANPY]);
// Turn 1 - thunder wave immunity test // Turn 1 - thunder wave immunity test

View File

@ -24,13 +24,14 @@ describe("Moves - Make It Rain", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
game.override.moveset([MoveId.MAKE_IT_RAIN, MoveId.SPLASH]); .battleStyle("double")
game.override.enemySpecies(SpeciesId.SNORLAX); .moveset([MoveId.MAKE_IT_RAIN, MoveId.SPLASH])
game.override.enemyAbility(AbilityId.INSOMNIA); .enemySpecies(SpeciesId.SNORLAX)
game.override.enemyMoveset(MoveId.SPLASH); .enemyAbility(AbilityId.INSOMNIA)
game.override.startingLevel(100); .enemyMoveset(MoveId.SPLASH)
game.override.enemyLevel(100); .startingLevel(100)
.enemyLevel(100);
}); });
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 () => {
@ -47,8 +48,9 @@ describe("Moves - Make It Rain", () => {
}); });
it("should apply effects even if the target faints", async () => { it("should apply effects even if the target faints", async () => {
game.override.enemyLevel(1); // ensures the enemy will faint game.override
game.override.battleStyle("single"); .enemyLevel(1) // ensures the enemy will faint
.battleStyle("single");
await game.classicMode.startBattle([SpeciesId.CHARIZARD]); await game.classicMode.startBattle([SpeciesId.CHARIZARD]);

View File

@ -26,16 +26,14 @@ describe("Moves - Mat Block", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
.battleStyle("double")
game.override.moveset([MoveId.MAT_BLOCK, MoveId.SPLASH]); .moveset([MoveId.MAT_BLOCK, MoveId.SPLASH])
.enemySpecies(SpeciesId.SNORLAX)
game.override.enemySpecies(SpeciesId.SNORLAX); .enemyMoveset([MoveId.TACKLE])
game.override.enemyMoveset([MoveId.TACKLE]); .enemyAbility(AbilityId.INSOMNIA)
game.override.enemyAbility(AbilityId.INSOMNIA); .startingLevel(100)
.enemyLevel(100);
game.override.startingLevel(100);
game.override.enemyLevel(100);
}); });
test("should protect the user and allies from attack moves", async () => { test("should protect the user and allies from attack moves", async () => {

View File

@ -26,11 +26,12 @@ describe("Moves - Parting Shot", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.moveset([MoveId.PARTING_SHOT, MoveId.SPLASH]); .battleStyle("single")
game.override.enemyMoveset(MoveId.SPLASH); .moveset([MoveId.PARTING_SHOT, MoveId.SPLASH])
game.override.startingLevel(5); .enemyMoveset(MoveId.SPLASH)
game.override.enemyLevel(5); .startingLevel(5)
.enemyLevel(5);
}); });
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 () => {

View File

@ -28,9 +28,8 @@ describe("Moves - Powder", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single");
game.override game.override
.battleStyle("single")
.enemySpecies(SpeciesId.SNORLAX) .enemySpecies(SpeciesId.SNORLAX)
.enemyLevel(100) .enemyLevel(100)
.enemyMoveset(MoveId.EMBER) .enemyMoveset(MoveId.EMBER)

View File

@ -28,16 +28,14 @@ describe("Moves - Protect", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
.battleStyle("single")
game.override.moveset([MoveId.PROTECT]); .moveset([MoveId.PROTECT])
game.override.enemySpecies(SpeciesId.SNORLAX); .enemySpecies(SpeciesId.SNORLAX)
.enemyAbility(AbilityId.INSOMNIA)
game.override.enemyAbility(AbilityId.INSOMNIA); .enemyMoveset([MoveId.TACKLE])
game.override.enemyMoveset([MoveId.TACKLE]); .startingLevel(100)
.enemyLevel(100);
game.override.startingLevel(100);
game.override.enemyLevel(100);
}); });
test("should protect the user from attacks", async () => { test("should protect the user from attacks", async () => {

View File

@ -25,15 +25,14 @@ describe("Moves - Purify", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
.battleStyle("single")
game.override.starterSpecies(SpeciesId.PYUKUMUKU); .starterSpecies(SpeciesId.PYUKUMUKU)
game.override.startingLevel(10); .startingLevel(10)
game.override.moveset([MoveId.PURIFY, MoveId.SIZZLY_SLIDE]); .moveset([MoveId.PURIFY, MoveId.SIZZLY_SLIDE])
.enemySpecies(SpeciesId.MAGIKARP)
game.override.enemySpecies(SpeciesId.MAGIKARP); .enemyLevel(10)
game.override.enemyLevel(10); .enemyMoveset([MoveId.SPLASH]);
game.override.enemyMoveset([MoveId.SPLASH, MoveId.NONE, MoveId.NONE, MoveId.NONE]);
}); });
test("Purify heals opponent status effect and restores user hp", async () => { test("Purify heals opponent status effect and restores user hp", async () => {

View File

@ -25,16 +25,14 @@ describe("Moves - Quick Guard", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
.battleStyle("double")
game.override.moveset([MoveId.QUICK_GUARD, MoveId.SPLASH, MoveId.FOLLOW_ME]); .moveset([MoveId.QUICK_GUARD, MoveId.SPLASH, MoveId.FOLLOW_ME])
.enemySpecies(SpeciesId.SNORLAX)
game.override.enemySpecies(SpeciesId.SNORLAX); .enemyMoveset([MoveId.QUICK_ATTACK])
game.override.enemyMoveset([MoveId.QUICK_ATTACK]); .enemyAbility(AbilityId.INSOMNIA)
game.override.enemyAbility(AbilityId.INSOMNIA); .startingLevel(100)
.enemyLevel(100);
game.override.startingLevel(100);
game.override.enemyLevel(100);
}); });
test("should protect the user and allies from priority moves", async () => { test("should protect the user and allies from priority moves", async () => {
@ -51,8 +49,7 @@ describe("Moves - Quick Guard", () => {
}); });
test("should protect the user and allies from Prankster-boosted moves", async () => { test("should protect the user and allies from Prankster-boosted moves", async () => {
game.override.enemyAbility(AbilityId.PRANKSTER); game.override.enemyAbility(AbilityId.PRANKSTER).enemyMoveset([MoveId.GROWL]);
game.override.enemyMoveset([MoveId.GROWL]);
await game.classicMode.startBattle([SpeciesId.CHARIZARD, SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.CHARIZARD, SpeciesId.BLASTOISE]);
@ -84,8 +81,7 @@ describe("Moves - Quick Guard", () => {
}); });
test("should fail if the user is the last to move in the turn", async () => { test("should fail if the user is the last to move in the turn", async () => {
game.override.battleStyle("single"); game.override.battleStyle("single").enemyMoveset([MoveId.QUICK_GUARD]);
game.override.enemyMoveset([MoveId.QUICK_GUARD]);
await game.classicMode.startBattle([SpeciesId.CHARIZARD]); await game.classicMode.startBattle([SpeciesId.CHARIZARD]);

View File

@ -22,12 +22,13 @@ describe("Moves - Rage Powder", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
game.override.enemySpecies(SpeciesId.SNORLAX); .battleStyle("double")
game.override.startingLevel(100); .enemySpecies(SpeciesId.SNORLAX)
game.override.enemyLevel(100); .startingLevel(100)
game.override.moveset([MoveId.FOLLOW_ME, MoveId.RAGE_POWDER, MoveId.SPOTLIGHT, MoveId.QUICK_ATTACK]); .enemyLevel(100)
game.override.enemyMoveset([MoveId.RAGE_POWDER, MoveId.TACKLE, MoveId.SPLASH]); .moveset([MoveId.FOLLOW_ME, MoveId.RAGE_POWDER, MoveId.SPOTLIGHT, MoveId.QUICK_ATTACK])
.enemyMoveset([MoveId.RAGE_POWDER, MoveId.TACKLE, MoveId.SPLASH]);
}); });
test("move effect should be bypassed by Grass type", async () => { test("move effect should be bypassed by Grass type", async () => {

View File

@ -23,18 +23,19 @@ describe("Moves - Rollout", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.disableCrits(); game.override
game.override.battleStyle("single"); .disableCrits()
game.override.starterSpecies(SpeciesId.RATTATA); .battleStyle("single")
game.override.ability(AbilityId.BALL_FETCH); .starterSpecies(SpeciesId.RATTATA)
game.override.enemySpecies(SpeciesId.BIDOOF); .ability(AbilityId.BALL_FETCH)
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemySpecies(SpeciesId.BIDOOF)
game.override.startingLevel(100); .enemyAbility(AbilityId.BALL_FETCH)
game.override.enemyLevel(100); .startingLevel(100)
game.override.enemyMoveset(MoveId.SPLASH); .enemyLevel(100)
.enemyMoveset(MoveId.SPLASH);
}); });
it("should double it's dmg on sequential uses but reset after 5", async () => { it("should double its dmg on sequential uses but reset after 5", async () => {
game.override.moveset([MoveId.ROLLOUT]); game.override.moveset([MoveId.ROLLOUT]);
vi.spyOn(allMoves[MoveId.ROLLOUT], "accuracy", "get").mockReturnValue(100); //always hit vi.spyOn(allMoves[MoveId.ROLLOUT], "accuracy", "get").mockReturnValue(100); //always hit

View File

@ -25,12 +25,13 @@ describe("Moves - Roost", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.enemySpecies(SpeciesId.RELICANTH); .battleStyle("single")
game.override.startingLevel(100); .enemySpecies(SpeciesId.RELICANTH)
game.override.enemyLevel(100); .startingLevel(100)
game.override.enemyMoveset(MoveId.EARTHQUAKE); .enemyLevel(100)
game.override.moveset([MoveId.ROOST, MoveId.BURN_UP, MoveId.DOUBLE_SHOCK]); .enemyMoveset(MoveId.EARTHQUAKE)
.moveset([MoveId.ROOST, MoveId.BURN_UP, MoveId.DOUBLE_SHOCK]);
}); });
/** /**

View File

@ -1,12 +1,12 @@
import { BattlerIndex } from "#enums/battler-index"; import { BattlerIndex } from "#enums/battler-index";
import { allAbilities } from "#app/data/data-lists"; import { allAbilities } from "#app/data/data-lists";
import { AbilityId } from "#enums/ability-id";
import { StatusEffect } from "#app/enums/status-effect"; import { StatusEffect } from "#app/enums/status-effect";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import { MoveId } from "#enums/move-id"; import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id"; import { SpeciesId } from "#enums/species-id";
import Phaser from "phaser"; 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 { AbilityId } from "#enums/ability-id";
describe("Moves - Safeguard", () => { describe("Moves - Safeguard", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -109,49 +109,50 @@ describe("Moves - Safeguard", () => {
game.move.select(MoveId.SPLASH); game.move.select(MoveId.SPLASH);
await game.toNextTurn(); await game.toNextTurn();
expect(enemyPokemon.status?.effect).toEqual(StatusEffect.SLEEP); expect(enemyPokemon.status?.effect).toBe(StatusEffect.SLEEP);
}); });
it("doesn't protect from self-inflicted via Rest or Flame Orb", async () => { it("doesn't protect from self-inflicted status from Rest or Flame Orb", async () => {
game.override.enemyHeldItems([{ name: "FLAME_ORB" }]); game.override.enemyHeldItems([{ name: "FLAME_ORB" }]);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
enemyPokemon.hp = 1;
game.move.select(MoveId.SPLASH); game.move.select(MoveId.SPLASH);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.move.forceEnemyMove(MoveId.SAFEGUARD);
await game.toNextTurn(); await game.toNextTurn();
enemyPokemon.damageAndUpdate(1);
expect(enemyPokemon.status?.effect).toEqual(StatusEffect.BURN); expect(enemyPokemon.status?.effect).toBe(StatusEffect.BURN);
enemyPokemon.resetStatus();
game.override.enemyMoveset([MoveId.REST]);
// Force the moveset to update mid-battle
// TODO: Remove after enemy AI rework is in
enemyPokemon.getMoveset();
game.move.select(MoveId.SPLASH); game.move.select(MoveId.SPLASH);
enemyPokemon.damageAndUpdate(1); await game.move.forceEnemyMove(MoveId.REST);
await game.toNextTurn(); await game.toNextTurn();
expect(enemyPokemon.status?.effect).toEqual(StatusEffect.SLEEP); expect(enemyPokemon.status?.effect).toBe(StatusEffect.SLEEP);
}); });
it("protects from ability-inflicted status", async () => { it("protects from ability-inflicted status", async () => {
game.override.ability(AbilityId.STATIC); await game.classicMode.startBattle();
const player = game.field.getPlayerPokemon();
game.field.mockAbility(player, AbilityId.STATIC);
vi.spyOn( vi.spyOn(
allAbilities[AbilityId.STATIC].getAttrs("PostDefendContactApplyStatusEffectAbAttr")[0], allAbilities[AbilityId.STATIC].getAttrs("PostDefendContactApplyStatusEffectAbAttr")[0],
"chance", "chance",
"get", "get",
).mockReturnValue(100); ).mockReturnValue(100);
await game.classicMode.startBattle();
const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(MoveId.SPLASH); game.move.select(MoveId.SPLASH);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.move.forceEnemyMove(MoveId.SAFEGUARD);
await game.toNextTurn();
game.override.enemyMoveset([MoveId.TACKLE]);
game.move.select(MoveId.SPLASH);
await game.toNextTurn(); await game.toNextTurn();
game.move.select(MoveId.SPLASH);
await game.move.forceEnemyMove(MoveId.TACKLE);
await game.toNextTurn();
const enemyPokemon = game.field.getEnemyPokemon();
expect(enemyPokemon.status).toBeUndefined(); expect(enemyPokemon.status).toBeUndefined();
}); });
}); });

View File

@ -81,9 +81,7 @@ describe("Moves - Spikes", () => {
}, 20000); }, 20000);
it("should work when all targets fainted", async () => { it("should work when all targets fainted", async () => {
game.override.enemySpecies(SpeciesId.DIGLETT); game.override.enemySpecies(SpeciesId.DIGLETT).battleStyle("double").startingLevel(50);
game.override.battleStyle("double");
game.override.startingLevel(50);
await game.classicMode.startBattle([SpeciesId.RAYQUAZA, SpeciesId.ROWLET]); await game.classicMode.startBattle([SpeciesId.RAYQUAZA, SpeciesId.ROWLET]);
game.move.select(MoveId.EARTHQUAKE); game.move.select(MoveId.EARTHQUAKE);

View File

@ -32,15 +32,14 @@ describe("Moves - Spit Up", () => {
spitUp = allMoves[MoveId.SPIT_UP]; spitUp = allMoves[MoveId.SPIT_UP];
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
.battleStyle("single")
game.override.enemySpecies(SpeciesId.RATTATA); .enemySpecies(SpeciesId.RATTATA)
game.override.enemyMoveset(MoveId.SPLASH); .enemyMoveset(MoveId.SPLASH)
game.override.enemyAbility(AbilityId.NONE); .enemyAbility(AbilityId.NONE)
game.override.enemyLevel(2000); .enemyLevel(2000)
.moveset(MoveId.SPIT_UP)
game.override.moveset(new Array(4).fill(spitUp.id)); .ability(AbilityId.NONE);
game.override.ability(AbilityId.NONE);
vi.spyOn(spitUp, "calculateBattlePower"); vi.spyOn(spitUp, "calculateBattlePower");
}); });

View File

@ -22,13 +22,14 @@ describe("Moves - Spotlight", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
game.override.starterSpecies(SpeciesId.AMOONGUSS); .battleStyle("double")
game.override.enemySpecies(SpeciesId.SNORLAX); .starterSpecies(SpeciesId.AMOONGUSS)
game.override.startingLevel(100); .enemySpecies(SpeciesId.SNORLAX)
game.override.enemyLevel(100); .startingLevel(100)
game.override.moveset([MoveId.FOLLOW_ME, MoveId.RAGE_POWDER, MoveId.SPOTLIGHT, MoveId.QUICK_ATTACK]); .enemyLevel(100)
game.override.enemyMoveset([MoveId.FOLLOW_ME, MoveId.SPLASH]); .moveset([MoveId.FOLLOW_ME, MoveId.RAGE_POWDER, MoveId.SPOTLIGHT, MoveId.QUICK_ATTACK])
.enemyMoveset([MoveId.FOLLOW_ME, MoveId.SPLASH]);
}); });
test("move should redirect attacks to the target", async () => { test("move should redirect attacks to the target", async () => {

View File

@ -27,15 +27,14 @@ describe("Moves - Stockpile", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
.battleStyle("single")
game.override.enemySpecies(SpeciesId.RATTATA); .enemySpecies(SpeciesId.RATTATA)
game.override.enemyMoveset(MoveId.SPLASH); .enemyMoveset(MoveId.SPLASH)
game.override.enemyAbility(AbilityId.NONE); .enemyAbility(AbilityId.NONE)
.startingLevel(2000)
game.override.startingLevel(2000); .moveset([MoveId.STOCKPILE, MoveId.SPLASH])
game.override.moveset([MoveId.STOCKPILE, MoveId.SPLASH]); .ability(AbilityId.NONE);
game.override.ability(AbilityId.NONE);
}); });
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 () => {

View File

@ -138,8 +138,7 @@ describe("Moves - Substitute", () => {
}); });
it("should be bypassed by attackers with Infiltrator", async () => { it("should be bypassed by attackers with Infiltrator", async () => {
game.override.enemyMoveset(MoveId.TACKLE); game.override.enemyMoveset(MoveId.TACKLE).enemyAbility(AbilityId.INFILTRATOR);
game.override.enemyAbility(AbilityId.INFILTRATOR);
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -230,8 +229,7 @@ describe("Moves - Substitute", () => {
}); });
it("should protect the user from flinching", async () => { it("should protect the user from flinching", async () => {
game.override.enemyMoveset(MoveId.FAKE_OUT); game.override.enemyMoveset(MoveId.FAKE_OUT).startingLevel(1); // Ensures the Substitute will break
game.override.startingLevel(1); // Ensures the Substitute will break
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -298,9 +296,8 @@ describe("Moves - Substitute", () => {
}); });
it("should prevent the user's items from being stolen", async () => { it("should prevent the user's items from being stolen", async () => {
game.override.enemyMoveset(MoveId.THIEF); game.override.enemyMoveset(MoveId.THIEF).startingHeldItems([{ name: "BERRY", type: BerryType.SITRUS }]);
vi.spyOn(allMoves[MoveId.THIEF], "attrs", "get").mockReturnValue([new StealHeldItemChanceAttr(1.0)]); // give Thief 100% steal rate vi.spyOn(allMoves[MoveId.THIEF], "attrs", "get").mockReturnValue([new StealHeldItemChanceAttr(1.0)]); // give Thief 100% steal rate
game.override.startingHeldItems([{ name: "BERRY", type: BerryType.SITRUS }]);
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -316,8 +313,7 @@ describe("Moves - Substitute", () => {
}); });
it("should prevent the user's items from being removed", async () => { it("should prevent the user's items from being removed", async () => {
game.override.moveset([MoveId.KNOCK_OFF]); game.override.moveset([MoveId.KNOCK_OFF]).enemyHeldItems([{ name: "BERRY", type: BerryType.SITRUS }]);
game.override.enemyHeldItems([{ name: "BERRY", type: BerryType.SITRUS }]);
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -334,8 +330,7 @@ describe("Moves - Substitute", () => {
}); });
it("move effect should prevent the user's berries from being stolen and eaten", async () => { it("move effect should prevent the user's berries from being stolen and eaten", async () => {
game.override.enemyMoveset(MoveId.BUG_BITE); game.override.enemyMoveset(MoveId.BUG_BITE).startingHeldItems([{ name: "BERRY", type: BerryType.SITRUS }]);
game.override.startingHeldItems([{ name: "BERRY", type: BerryType.SITRUS }]);
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -412,8 +407,7 @@ describe("Moves - Substitute", () => {
}); });
it("should prevent the source's Rough Skin from activating when hit", async () => { it("should prevent the source's Rough Skin from activating when hit", async () => {
game.override.enemyMoveset(MoveId.TACKLE); game.override.enemyMoveset(MoveId.TACKLE).ability(AbilityId.ROUGH_SKIN);
game.override.ability(AbilityId.ROUGH_SKIN);
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -427,8 +421,7 @@ describe("Moves - Substitute", () => {
}); });
it("should prevent the source's Focus Punch from failing when hit", async () => { it("should prevent the source's Focus Punch from failing when hit", async () => {
game.override.enemyMoveset(MoveId.TACKLE); game.override.enemyMoveset(MoveId.TACKLE).moveset([MoveId.FOCUS_PUNCH]);
game.override.moveset([MoveId.FOCUS_PUNCH]);
// Make Focus Punch 40 power to avoid a KO // Make Focus Punch 40 power to avoid a KO
vi.spyOn(allMoves[MoveId.FOCUS_PUNCH], "calculateBattlePower").mockReturnValue(40); vi.spyOn(allMoves[MoveId.FOCUS_PUNCH], "calculateBattlePower").mockReturnValue(40);
@ -449,8 +442,7 @@ describe("Moves - Substitute", () => {
}); });
it("should not allow Shell Trap to activate when attacked", async () => { it("should not allow Shell Trap to activate when attacked", async () => {
game.override.enemyMoveset(MoveId.TACKLE); game.override.enemyMoveset(MoveId.TACKLE).moveset([MoveId.SHELL_TRAP]);
game.override.moveset([MoveId.SHELL_TRAP]);
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -466,8 +458,7 @@ describe("Moves - Substitute", () => {
}); });
it("should not allow Beak Blast to burn opponents when hit", async () => { it("should not allow Beak Blast to burn opponents when hit", async () => {
game.override.enemyMoveset(MoveId.TACKLE); game.override.enemyMoveset(MoveId.TACKLE).moveset([MoveId.BEAK_BLAST]);
game.override.moveset([MoveId.BEAK_BLAST]);
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -484,8 +475,7 @@ describe("Moves - Substitute", () => {
}); });
it("should cause incoming attacks to not activate Counter", async () => { it("should cause incoming attacks to not activate Counter", async () => {
game.override.enemyMoveset(MoveId.TACKLE); game.override.enemyMoveset(MoveId.TACKLE).moveset([MoveId.COUNTER]);
game.override.moveset([MoveId.COUNTER]);
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);

View File

@ -37,6 +37,7 @@ describe("Moves - Tackle", () => {
it("TACKLE against ghost", async () => { it("TACKLE against ghost", async () => {
const moveToUse = MoveId.TACKLE; const moveToUse = MoveId.TACKLE;
game.override.enemySpecies(SpeciesId.GENGAR); game.override.enemySpecies(SpeciesId.GENGAR);
await game.classicMode.startBattle([SpeciesId.MIGHTYENA]); await game.classicMode.startBattle([SpeciesId.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);

View File

@ -25,13 +25,14 @@ describe("Moves - Tail whip", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
const moveToUse = MoveId.TAIL_WHIP; const moveToUse = MoveId.TAIL_WHIP;
game.override.battleStyle("single"); game.override
game.override.enemySpecies(SpeciesId.RATTATA); .battleStyle("single")
game.override.enemyAbility(AbilityId.INSOMNIA); .enemySpecies(SpeciesId.RATTATA)
game.override.ability(AbilityId.INSOMNIA); .enemyAbility(AbilityId.INSOMNIA)
game.override.startingLevel(2000); .ability(AbilityId.INSOMNIA)
game.override.moveset([moveToUse]); .startingLevel(2000)
game.override.enemyMoveset(MoveId.SPLASH); .moveset([moveToUse])
.enemyMoveset(MoveId.SPLASH);
}); });
it("should lower DEF stat stage by 1", async () => { it("should lower DEF stat stage by 1", async () => {

View File

@ -24,12 +24,13 @@ describe("Moves - Thousand Arrows", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.enemySpecies(SpeciesId.TOGETIC); .battleStyle("single")
game.override.startingLevel(100); .enemySpecies(SpeciesId.TOGETIC)
game.override.enemyLevel(100); .startingLevel(100)
game.override.moveset([MoveId.THOUSAND_ARROWS]); .enemyLevel(100)
game.override.enemyMoveset([MoveId.SPLASH, MoveId.SPLASH, MoveId.SPLASH, MoveId.SPLASH]); .moveset([MoveId.THOUSAND_ARROWS])
.enemyMoveset(MoveId.SPLASH);
}); });
it("move should hit and ground Flying-type targets", async () => { it("move should hit and ground Flying-type targets", async () => {
@ -50,8 +51,7 @@ describe("Moves - Thousand Arrows", () => {
}); });
it("move should hit and ground targets with Levitate", async () => { it("move should hit and ground targets with Levitate", async () => {
game.override.enemySpecies(SpeciesId.SNORLAX); game.override.enemySpecies(SpeciesId.SNORLAX).enemyAbility(AbilityId.LEVITATE);
game.override.enemyAbility(AbilityId.LEVITATE);
await game.classicMode.startBattle([SpeciesId.ILLUMISE]); await game.classicMode.startBattle([SpeciesId.ILLUMISE]);

View File

@ -4,11 +4,11 @@ import { MoveEndPhase } from "#app/phases/move-end-phase";
import { TurnEndPhase } from "#app/phases/turn-end-phase"; import { TurnEndPhase } from "#app/phases/turn-end-phase";
import { AbilityId } from "#enums/ability-id"; import { AbilityId } from "#enums/ability-id";
import { MoveId } from "#enums/move-id"; import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import { SubstituteTag } from "#app/data/battler-tags"; import { SubstituteTag } from "#app/data/battler-tags";
import { SpeciesId } from "#enums/species-id";
describe("Moves - Tidy Up", () => { describe("Moves - Tidy Up", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -26,14 +26,15 @@ describe("Moves - Tidy Up", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("single"); game.override
game.override.enemySpecies(SpeciesId.MAGIKARP); .battleStyle("single")
game.override.enemyAbility(AbilityId.BALL_FETCH); .enemySpecies(SpeciesId.MAGIKARP)
game.override.enemyMoveset(MoveId.SPLASH); .enemyAbility(AbilityId.BALL_FETCH)
game.override.starterSpecies(SpeciesId.FEEBAS); .enemyMoveset(MoveId.SPLASH)
game.override.ability(AbilityId.BALL_FETCH); .starterSpecies(SpeciesId.FEEBAS)
game.override.moveset([MoveId.TIDY_UP]); .ability(AbilityId.BALL_FETCH)
game.override.startingLevel(50); .moveset([MoveId.TIDY_UP])
.startingLevel(50);
}); });
it("spikes are cleared", async () => { it("spikes are cleared", async () => {

View File

@ -75,8 +75,7 @@ describe("Moves - Toxic", () => {
}); });
it("moves other than Toxic should not hit semi-invulnerable targets even if user is Poison-type", async () => { it("moves other than Toxic should not hit semi-invulnerable targets even if user is Poison-type", async () => {
game.override.moveset(MoveId.SWIFT); game.override.moveset(MoveId.SWIFT).enemyMoveset(MoveId.FLY);
game.override.enemyMoveset(MoveId.FLY);
await game.classicMode.startBattle([SpeciesId.TOXAPEX]); await game.classicMode.startBattle([SpeciesId.TOXAPEX]);
game.move.select(MoveId.SWIFT); game.move.select(MoveId.SWIFT);

View File

@ -154,8 +154,7 @@ describe("Moves - Transform", () => {
}); });
it("should stay transformed with the correct form after reload", async () => { it("should stay transformed with the correct form after reload", async () => {
game.override.enemyMoveset([]).moveset([]); game.override.enemyMoveset([]).moveset([]).enemySpecies(SpeciesId.DARMANITAN);
game.override.enemySpecies(SpeciesId.DARMANITAN);
await game.classicMode.startBattle([SpeciesId.DITTO]); await game.classicMode.startBattle([SpeciesId.DITTO]);

View File

@ -25,16 +25,14 @@ describe("Moves - Wide Guard", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override.battleStyle("double"); game.override
.battleStyle("double")
game.override.moveset([MoveId.WIDE_GUARD, MoveId.SPLASH, MoveId.SURF]); .moveset([MoveId.WIDE_GUARD, MoveId.SPLASH, MoveId.SURF])
.enemySpecies(SpeciesId.SNORLAX)
game.override.enemySpecies(SpeciesId.SNORLAX); .enemyMoveset(MoveId.SWIFT)
game.override.enemyMoveset([MoveId.SWIFT]); .enemyAbility(AbilityId.INSOMNIA)
game.override.enemyAbility(AbilityId.INSOMNIA); .startingLevel(100)
.enemyLevel(100);
game.override.startingLevel(100);
game.override.enemyLevel(100);
}); });
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 () => {

View File

@ -38,10 +38,11 @@ describe("A Trainer's Test - Mystery Encounter", () => {
beforeEach(async () => { beforeEach(async () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
scene = game.scene; scene = game.scene;
game.override.mysteryEncounterChance(100); game.override
game.override.startingWave(defaultWave); .mysteryEncounterChance(100)
game.override.startingBiome(defaultBiome); .startingWave(defaultWave)
game.override.disableTrainerWaves(); .startingBiome(defaultBiome)
.disableTrainerWaves();
const biomeMap = new Map<BiomeId, MysteryEncounterType[]>([ const biomeMap = new Map<BiomeId, MysteryEncounterType[]>([
[BiomeId.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]], [BiomeId.VOLCANO, [MysteryEncounterType.MYSTERIOUS_CHALLENGERS]],

View File

@ -38,10 +38,11 @@ describe("Absolute Avarice - Mystery Encounter", () => {
beforeEach(async () => { beforeEach(async () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
scene = game.scene; scene = game.scene;
game.override.mysteryEncounterChance(100); game.override
game.override.startingWave(defaultWave); .mysteryEncounterChance(100)
game.override.startingBiome(defaultBiome); .startingWave(defaultWave)
game.override.disableTrainerWaves(); .startingBiome(defaultBiome)
.disableTrainerWaves();
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue( vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<BiomeId, MysteryEncounterType[]>([ new Map<BiomeId, MysteryEncounterType[]>([
@ -71,8 +72,7 @@ describe("Absolute Avarice - Mystery Encounter", () => {
}); });
it("should not spawn outside of proper biomes", async () => { it("should not spawn outside of proper biomes", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT); game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT).startingBiome(BiomeId.VOLCANO);
game.override.startingBiome(BiomeId.VOLCANO);
await game.runToMysteryEncounter(); await game.runToMysteryEncounter();
expect(game.scene.currentBattle.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.ABSOLUTE_AVARICE); expect(game.scene.currentBattle.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.ABSOLUTE_AVARICE);
@ -87,8 +87,7 @@ describe("Absolute Avarice - Mystery Encounter", () => {
}); });
it("should spawn if player has enough berries", async () => { it("should spawn if player has enough berries", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT); game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT).startingHeldItems([
game.override.startingHeldItems([
{ name: "BERRY", count: 2, type: BerryType.SITRUS }, { name: "BERRY", count: 2, type: BerryType.SITRUS },
{ name: "BERRY", count: 3, type: BerryType.GANLON }, { name: "BERRY", count: 3, type: BerryType.GANLON },
{ name: "BERRY", count: 2, type: BerryType.APICOT }, { name: "BERRY", count: 2, type: BerryType.APICOT },
@ -139,7 +138,6 @@ describe("Absolute Avarice - Mystery Encounter", () => {
expect(enemyField.length).toBe(1); expect(enemyField.length).toBe(1);
expect(enemyField[0].species.speciesId).toBe(SpeciesId.GREEDENT); expect(enemyField[0].species.speciesId).toBe(SpeciesId.GREEDENT);
const moveset = enemyField[0].moveset.map(m => m.moveId); const moveset = enemyField[0].moveset.map(m => m.moveId);
expect(moveset?.length).toBe(4);
expect(moveset).toEqual([MoveId.THRASH, MoveId.CRUNCH, MoveId.BODY_PRESS, MoveId.SLACK_OFF]); expect(moveset).toEqual([MoveId.THRASH, MoveId.CRUNCH, MoveId.BODY_PRESS, MoveId.SLACK_OFF]);
const movePhases = phaseSpy.mock.calls.filter(p => p[0] instanceof MovePhase).map(p => p[0]); const movePhases = phaseSpy.mock.calls.filter(p => p[0] instanceof MovePhase).map(p => p[0]);

View File

@ -79,8 +79,7 @@ describe("An Offer You Can't Refuse - Mystery Encounter", () => {
}); });
it("should not spawn outside of HUMAN_TRANSITABLE_BIOMES", async () => { it("should not spawn outside of HUMAN_TRANSITABLE_BIOMES", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT); game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT).startingBiome(BiomeId.VOLCANO);
game.override.startingBiome(BiomeId.VOLCANO);
await game.runToMysteryEncounter(); await game.runToMysteryEncounter();
expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe( expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe(

View File

@ -154,10 +154,11 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
beforeEach(async () => { beforeEach(async () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
scene = game.scene; scene = game.scene;
game.override.mysteryEncounterChance(100); game.override
game.override.startingWave(defaultWave); .mysteryEncounterChance(100)
game.override.startingBiome(defaultBiome); .startingWave(defaultWave)
game.override.disableTrainerWaves(); .startingBiome(defaultBiome)
.disableTrainerWaves();
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue( vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.BUG_TYPE_SUPERFAN]]]), new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.BUG_TYPE_SUPERFAN]]]),

View File

@ -55,10 +55,11 @@ describe("Clowning Around - Mystery Encounter", () => {
beforeEach(async () => { beforeEach(async () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
scene = game.scene; scene = game.scene;
game.override.mysteryEncounterChance(100); game.override
game.override.startingWave(defaultWave); .mysteryEncounterChance(100)
game.override.startingBiome(defaultBiome); .startingWave(defaultWave)
game.override.disableTrainerWaves(); .startingBiome(defaultBiome)
.disableTrainerWaves();
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue( vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.CLOWNING_AROUND]]]), new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.CLOWNING_AROUND]]]),

View File

@ -41,10 +41,11 @@ describe("Dancing Lessons - Mystery Encounter", () => {
beforeEach(async () => { beforeEach(async () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
scene = game.scene; scene = game.scene;
game.override.mysteryEncounterChance(100); game.override
game.override.startingWave(defaultWave); .mysteryEncounterChance(100)
game.override.startingBiome(defaultBiome); .startingWave(defaultWave)
game.override.disableTrainerWaves(); .startingBiome(defaultBiome)
.disableTrainerWaves();
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue( vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<BiomeId, MysteryEncounterType[]>([ new Map<BiomeId, MysteryEncounterType[]>([
@ -74,8 +75,7 @@ describe("Dancing Lessons - Mystery Encounter", () => {
}); });
it("should not spawn outside of proper biomes", async () => { it("should not spawn outside of proper biomes", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT); game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT).startingBiome(BiomeId.SPACE);
game.override.startingBiome(BiomeId.SPACE);
await game.runToMysteryEncounter(); await game.runToMysteryEncounter();
expect(game.scene.currentBattle.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.DANCING_LESSONS); expect(game.scene.currentBattle.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.DANCING_LESSONS);

View File

@ -46,10 +46,11 @@ describe("Delibird-y - Mystery Encounter", () => {
beforeEach(async () => { beforeEach(async () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
scene = game.scene; scene = game.scene;
game.override.mysteryEncounterChance(100); game.override
game.override.startingWave(defaultWave); .mysteryEncounterChance(100)
game.override.startingBiome(defaultBiome); .startingWave(defaultWave)
game.override.disableTrainerWaves(); .startingBiome(defaultBiome)
.disableTrainerWaves();
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue( vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.DELIBIRDY]]]), new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.DELIBIRDY]]]),

Some files were not shown because too many files have changed in this diff Show More