Fixed stuff

This commit is contained in:
Bertie690 2025-06-05 08:16:37 -04:00
parent 90f3803d54
commit ef08575b4c
101 changed files with 442 additions and 429 deletions

View File

@ -138,7 +138,6 @@ export class SwitchSummonPhase extends SummonPhase {
return; return;
} }
if (this.switchType === SwitchType.BATON_PASS) { if (this.switchType === SwitchType.BATON_PASS) {
// If switching via baton pass, update opposing tags coming from the prior pokemon // If switching via baton pass, update opposing tags coming from the prior pokemon
(this.player ? globalScene.getEnemyField() : globalScene.getPlayerField()).forEach((enemyPokemon: Pokemon) => (this.player ? globalScene.getEnemyField() : globalScene.getPlayerField()).forEach((enemyPokemon: Pokemon) =>

View File

@ -174,7 +174,24 @@ export async function initI18n(): Promise<void> {
"es-MX": ["es-ES", "en"], "es-MX": ["es-ES", "en"],
default: ["en"], default: ["en"],
}, },
supportedLngs: ["en", "es-ES", "es-MX", "fr", "it", "de", "zh-CN", "zh-TW", "pt-BR", "ko", "ja", "ca", "da", "tr", "ro", "ru"], supportedLngs: [
"en",
"es-ES",
"es-MX",
"fr",
"it",
"de",
"zh-CN",
"zh-TW",
"pt-BR",
"ko",
"ja",
"ca",
"da",
"tr",
"ro",
"ru",
],
backend: { backend: {
loadPath(lng: string, [ns]: string[]) { loadPath(lng: string, [ns]: string[]) {
let fileName: string; let fileName: string;

View File

@ -959,7 +959,7 @@ export function setSetting(setting: string, value: number): boolean {
}, },
{ {
label: "Türkçe (Needs Help)", label: "Türkçe (Needs Help)",
handler: () => changeLocaleHandler("tr") handler: () => changeLocaleHandler("tr"),
}, },
{ {
label: "Русский (Needs Help)", label: "Русский (Needs Help)",
@ -967,11 +967,11 @@ export function setSetting(setting: string, value: number): boolean {
}, },
{ {
label: "Dansk (Needs Help)", label: "Dansk (Needs Help)",
handler: () => changeLocaleHandler("da") handler: () => changeLocaleHandler("da"),
}, },
{ {
label: "Română (Needs Help)", label: "Română (Needs Help)",
handler: () => changeLocaleHandler("ro") handler: () => changeLocaleHandler("ro"),
}, },
{ {
label: i18next.t("settings:back"), label: i18next.t("settings:back"),

View File

@ -29,9 +29,9 @@ describe("Abilities - Battery", () => {
game.override game.override
.battleStyle("double") .battleStyle("double")
.enemySpecies(Species.SHUCKLE) .enemySpecies(Species.SHUCKLE)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]) .moveset([MoveId.TACKLE, MoveId.BREAKING_SWIPE, MoveId.SPLASH, MoveId.DAZZLING_GLEAM])
.enemyMoveset(Moves.SPLASH); .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

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

View File

@ -66,7 +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([Moves.SURGING_STRIKES]).enemyLevel(5); game.override.moveset([MoveId.SURGING_STRIKES]).enemyLevel(5);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
const mimikyu = game.scene.getEnemyPokemon()!; const mimikyu = game.scene.getEnemyPokemon()!;
@ -105,7 +105,7 @@ describe("Abilities - Disguise", () => {
}); });
it("persists form change when switched out", async () => { it("persists form change when switched out", async () => {
game.override.enemyMoveset([Moves.SHADOW_SNEAK]).starterSpecies(0); game.override.enemyMoveset([MoveId.SHADOW_SNEAK]).starterSpecies(0);
await game.classicMode.startBattle([SpeciesId.MIMIKYU, SpeciesId.FURRET]); await game.classicMode.startBattle([SpeciesId.MIMIKYU, SpeciesId.FURRET]);
@ -205,7 +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(Abilities.AERILATE).moveset([Moves.TACKLE]); game.override.ability(AbilityId.AERILATE).moveset([MoveId.TACKLE]);
await game.classicMode.startBattle(); await game.classicMode.startBattle();

View File

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

View File

@ -49,8 +49,8 @@ describe("Abilities - Flower Gift", () => {
): Promise<[number, number]> => { ): Promise<[number, number]> => {
game.override game.override
.battleStyle("double") .battleStyle("double")
.moveset([Moves.SPLASH, Moves.SUNNY_DAY, move, Moves.HEAL_PULSE]) .moveset([MoveId.SPLASH, MoveId.SUNNY_DAY, move, MoveId.HEAL_PULSE])
.enemyMoveset([Moves.SPLASH, Moves.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

@ -65,8 +65,8 @@ 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 game.override
.battleStyle("double") .battleStyle("double")
.enemyMoveset([Moves.STEALTH_ROCK, Moves.HAZE]) .enemyMoveset([MoveId.STEALTH_ROCK, MoveId.HAZE])
.moveset([Moves.SWORDS_DANCE, Moves.SAFEGUARD]); .moveset([MoveId.SWORDS_DANCE, MoveId.SAFEGUARD]);
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]); await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]);
const [good_as_gold, ball_fetch] = game.scene.getPlayerField(); const [good_as_gold, ball_fetch] = game.scene.getPlayerField();
@ -86,7 +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").enemyMoveset([Moves.SPIKES]); game.override.battleStyle("single").enemyMoveset([MoveId.SPIKES]);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.select(MoveId.SPLASH, 0); game.move.select(MoveId.SPLASH, 0);
@ -96,7 +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").moveset([Moves.HELPING_HAND, Moves.TACKLE]); game.override.battleStyle("double").moveset([MoveId.HELPING_HAND, MoveId.TACKLE]);
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]); await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]);
game.move.select(MoveId.HELPING_HAND, 0); game.move.select(MoveId.HELPING_HAND, 0);
@ -128,7 +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").enemyMoveset([Moves.RAIN_DANCE]); game.override.battleStyle("single").enemyMoveset([MoveId.RAIN_DANCE]);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.use(MoveId.SPLASH, 0); game.move.use(MoveId.SPLASH, 0);

View File

@ -33,8 +33,8 @@ describe("Abilities - Ice Face", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.EISCUE) .enemySpecies(Species.EISCUE)
.enemyAbility(Abilities.ICE_FACE) .enemyAbility(AbilityId.ICE_FACE)
.moveset([Moves.TACKLE, Moves.ICE_BEAM, Moves.TOXIC_THREAD, Moves.HAIL]); .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 () => {
@ -52,7 +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([Moves.SURGING_STRIKES]).enemyLevel(1); game.override.moveset([MoveId.SURGING_STRIKES]).enemyLevel(1);
await game.classicMode.startBattle([Species.HITMONLEE]); await game.classicMode.startBattle([Species.HITMONLEE]);
game.move.select(MoveId.SURGING_STRIKES); game.move.select(MoveId.SURGING_STRIKES);

View File

@ -117,12 +117,12 @@ describe("Abilities - Illusion", () => {
}); });
it("should not break from indirect damage from status, weather or recoil", async () => { it("should not break from indirect damage from status, weather or recoil", async () => {
game.override.enemySpecies(Species.GIGALITH).enemyAbility(Abilities.SAND_STREAM); game.override.enemySpecies(Species.GIGALITH).enemyAbility(AbilityId.SAND_STREAM);
await game.classicMode.startBattle([SpeciesId.ZOROARK, SpeciesId.AZUMARILL]); await game.classicMode.startBattle([SpeciesId.ZOROARK, SpeciesId.AZUMARILL]);
game.move.use(Moves.FLARE_BLITZ); game.move.use(MoveId.FLARE_BLITZ);
await game.move.forceEnemyMove(Moves.WILL_O_WISP); await game.move.forceEnemyMove(MoveId.WILL_O_WISP);
await game.toEndOfTurn(); await game.toEndOfTurn();
const zoroark = game.scene.getPlayerPokemon()!; const zoroark = game.scene.getPlayerPokemon()!;
@ -130,7 +130,7 @@ describe("Abilities - Illusion", () => {
}); });
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(Moves.SPLASH); game.override.enemyMoveset(MoveId.SPLASH);
await game.classicMode.startBattle([Species.ABRA, Species.ZOROARK, Species.AXEW]); await game.classicMode.startBattle([Species.ABRA, Species.ZOROARK, Species.AXEW]);
const axew = game.scene.getPlayerParty().at(2)!; const axew = game.scene.getPlayerParty().at(2)!;

View File

@ -162,7 +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([Moves.ABSORB]).enemySpecies(Species.UNOWN); game.override.moveset([MoveId.ABSORB]).enemySpecies(Species.UNOWN);
await game.classicMode.startBattle([Species.DITTO]); await game.classicMode.startBattle([Species.DITTO]);
const enemy = game.scene.getEnemyPokemon()!; const enemy = game.scene.getEnemyPokemon()!;

View File

@ -88,7 +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).moveset([Moves.SPLASH]); game.override.startingWave(2).moveset([MoveId.SPLASH]);
await game.classicMode.startBattle([Species.MIGHTYENA, Species.POOCHYENA]); await game.classicMode.startBattle([Species.MIGHTYENA, Species.POOCHYENA]);
const playerPokemon = game.scene.getPlayerPokemon()!; const playerPokemon = game.scene.getPlayerPokemon()!;

View File

@ -25,8 +25,8 @@ describe("Abilities - Intrepid Sword", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.ZACIAN) .enemySpecies(Species.ZACIAN)
.enemyAbility(Abilities.INTREPID_SWORD) .enemyAbility(AbilityId.INTREPID_SWORD)
.ability(Abilities.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,7 +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([Moves.TACKLE]).passiveAbility(Abilities.REFRIGERATE); game.override.moveset([MoveId.TACKLE]).passiveAbility(AbilityId.REFRIGERATE);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -155,7 +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([Moves.TACKLE]).enemyMoveset(Moves.SPLASH); game.override.moveset([MoveId.TACKLE]).enemyMoveset(MoveId.SPLASH);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -186,7 +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([Moves.TACKLE]).enemySpecies(Species.GASTLY); game.override.moveset([MoveId.TACKLE]).enemySpecies(Species.GASTLY);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -259,7 +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([Moves.TRICK_OR_TREAT]).enemySpecies(Species.GASTLY); game.override.moveset([MoveId.TRICK_OR_TREAT]).enemySpecies(Species.GASTLY);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);

View File

@ -41,7 +41,7 @@ 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.use(Moves.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);
}); });
@ -49,8 +49,8 @@ describe("Abilities - Magic Bounce", () => {
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([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.use(Moves.GROWL); game.move.use(MoveId.GROWL);
await game.move.forceEnemyMove(Moves.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,8 +61,8 @@ describe("Abilities - Magic Bounce", () => {
game.override.battleStyle("double"); game.override.battleStyle("double");
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
game.move.use(Moves.GROWL, 0); game.move.use(MoveId.GROWL, 0);
game.move.use(Moves.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];
@ -73,7 +73,7 @@ describe("Abilities - Magic Bounce", () => {
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.move.use(Moves.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);
@ -103,25 +103,25 @@ 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.use(Moves.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").enemyMoveset([Moves.SPLASH]); game.override.battleStyle("double").enemyMoveset([MoveId.SPLASH]);
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
game.move.use(Moves.GROWL, 0); game.move.use(MoveId.GROWL, 0);
game.move.use(Moves.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").moveset([Moves.SPIKES]); game.override.battleStyle("double").moveset([MoveId.SPIKES]);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.select(MoveId.SPIKES); game.move.select(MoveId.SPIKES);
@ -132,7 +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([Moves.SPIKES]).enemyMoveset([Moves.PROTECT]); game.override.moveset([MoveId.SPIKES]).enemyMoveset([MoveId.PROTECT]);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.select(MoveId.SPIKES); game.move.select(MoveId.SPIKES);
@ -141,7 +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([Moves.SPIKES]).enemyMoveset([Moves.FLY]); game.override.moveset([MoveId.SPIKES]).enemyMoveset([MoveId.FLY]);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.select(MoveId.SPIKES); game.move.select(MoveId.SPIKES);
@ -151,7 +151,7 @@ describe("Abilities - Magic Bounce", () => {
}); });
it("should not bounce back curse", async () => { it("should not bounce back curse", async () => {
game.override.moveset([Moves.CURSE]); game.override.moveset([MoveId.CURSE]);
await game.classicMode.startBattle([Species.GASTLY]); await game.classicMode.startBattle([Species.GASTLY]);
game.move.select(MoveId.CURSE); game.move.select(MoveId.CURSE);
@ -161,8 +161,8 @@ 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([Moves.SPLASH, Moves.GROWL, Moves.ENCORE]).enemyMoveset([Moves.TACKLE, Moves.GROWL]); game.override.moveset([MoveId.SPLASH, MoveId.GROWL, MoveId.ENCORE]).enemyMoveset([MoveId.TACKLE, MoveId.GROWL]);
// game.override.ability(Abilities.MOLD_BREAKER); // game.override.ability(AbilityId.MOLD_BREAKER);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
const playerPokemon = game.scene.getPlayerPokemon()!; const playerPokemon = game.scene.getPlayerPokemon()!;
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -189,9 +189,9 @@ 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 game.override
.moveset([Moves.SPLASH, Moves.GROWL, Moves.ENCORE]) .moveset([MoveId.SPLASH, MoveId.GROWL, MoveId.ENCORE])
.enemyMoveset([Moves.GROWL, Moves.TACKLE]) .enemyMoveset([MoveId.GROWL, MoveId.TACKLE])
.enemyAbility(Abilities.MAGIC_BOUNCE); .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()!;
@ -217,7 +217,7 @@ 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").moveset([Moves.STOMPING_TANTRUM, Moves.CHARM]); game.override.battleStyle("single").moveset([MoveId.STOMPING_TANTRUM, MoveId.CHARM]);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
const stomping_tantrum = allMoves[MoveId.STOMPING_TANTRUM]; const stomping_tantrum = allMoves[MoveId.STOMPING_TANTRUM];
@ -233,28 +233,28 @@ 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 boost enemy's stomping tantrum after failed bounce", async () => { it.todo("should boost enemy's stomping tantrum after failed bounce", async () => {
game.override.enemyMoveset([Moves.STOMPING_TANTRUM, Moves.SPLASH, Moves.CHARM]); game.override.enemyMoveset([MoveId.STOMPING_TANTRUM, MoveId.SPLASH, MoveId.CHARM]);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const stomping_tantrum = allMoves[Moves.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");
// Spore gets reflected back onto us // Spore gets reflected back onto us
game.move.select(Moves.SPORE); game.move.select(MoveId.SPORE);
await game.move.selectEnemyMove(Moves.CHARM); await game.move.selectEnemyMove(MoveId.CHARM);
await game.toNextTurn(); await game.toNextTurn();
expect(enemy.getLastXMoves(1)[0].result).toBe("success"); expect(enemy.getLastXMoves(1)[0].result).toBe("success");
game.move.select(Moves.SPORE); game.move.select(MoveId.SPORE);
await game.move.selectEnemyMove(Moves.STOMPING_TANTRUM); await game.move.selectEnemyMove(MoveId.STOMPING_TANTRUM);
await game.toNextTurn(); await game.toNextTurn();
expect(stomping_tantrum.calculateBattlePower).toHaveReturnedWith(150); expect(stomping_tantrum.calculateBattlePower).toHaveReturnedWith(150);
}); });
it("should respect immunities when bouncing a move", async () => { it("should respect immunities when bouncing a move", async () => {
vi.spyOn(allMoves[Moves.THUNDER_WAVE], "accuracy", "get").mockReturnValue(100); vi.spyOn(allMoves[MoveId.THUNDER_WAVE], "accuracy", "get").mockReturnValue(100);
game.override.moveset([Moves.THUNDER_WAVE, Moves.GROWL]).ability(Abilities.SOUNDPROOF); game.override.moveset([MoveId.THUNDER_WAVE, MoveId.GROWL]).ability(AbilityId.SOUNDPROOF);
await game.classicMode.startBattle([Species.PHANPY]); await game.classicMode.startBattle([Species.PHANPY]);
// Turn 1 - thunder wave immunity test // Turn 1 - thunder wave immunity test
@ -292,7 +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").moveset([Moves.STICKY_WEB, Moves.SPLASH, Moves.TRICK_ROOM]); game.override.battleStyle("double").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();
@ -325,11 +325,11 @@ 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([Moves.TOXIC, Moves.CHARM]); game.override.moveset([MoveId.TOXIC, MoveId.CHARM]);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
game.move.select(Moves.TOXIC); game.move.select(MoveId.TOXIC);
await game.move.selectEnemyMove(Moves.FLY); await game.move.selectEnemyMove(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");
expect(game.scene.getEnemyPokemon()!.status?.effect).toBe(StatusEffect.TOXIC); expect(game.scene.getEnemyPokemon()!.status?.effect).toBe(StatusEffect.TOXIC);

View File

@ -31,13 +31,13 @@ describe("Abilities - Magic Guard", () => {
game.override game.override
/** Player Pokemon overrides */ /** Player Pokemon overrides */
.ability(Abilities.MAGIC_GUARD) .ability(AbilityId.MAGIC_GUARD)
.moveset([Moves.SPLASH]) .moveset([MoveId.SPLASH])
.startingLevel(100) .startingLevel(100)
/** Enemy Pokemon overrides */ /** Enemy Pokemon overrides */
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyAbility(Abilities.INSOMNIA) .enemyAbility(AbilityId.INSOMNIA)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(MoveId.SPLASH)
.enemyLevel(100); .enemyLevel(100);
}); });
@ -89,7 +89,7 @@ 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 game.override
.enemyMoveset([Moves.WORRY_SEED, Moves.WORRY_SEED, Moves.WORRY_SEED, Moves.WORRY_SEED]) .enemyMoveset([MoveId.WORRY_SEED, MoveId.WORRY_SEED, MoveId.WORRY_SEED, MoveId.WORRY_SEED])
.statusEffect(StatusEffect.POISON); .statusEffect(StatusEffect.POISON);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -108,7 +108,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).enemyAbility(Abilities.MAGIC_GUARD); game.override.enemyStatusEffect(StatusEffect.BURN).enemyAbility(AbilityId.MAGIC_GUARD);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -129,7 +129,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).enemyAbility(Abilities.MAGIC_GUARD); game.override.enemyStatusEffect(StatusEffect.TOXIC).enemyAbility(AbilityId.MAGIC_GUARD);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -206,7 +206,7 @@ describe("Abilities - Magic Guard", () => {
it("Magic Guard prevents against damage from volatile status effects", async () => { it("Magic Guard prevents against damage from volatile status effects", async () => {
await game.classicMode.startBattle([Species.DUSKULL]); await game.classicMode.startBattle([Species.DUSKULL]);
game.override.moveset([Moves.CURSE]).enemyAbility(Abilities.MAGIC_GUARD); game.override.moveset([MoveId.CURSE]).enemyAbility(AbilityId.MAGIC_GUARD);
const leadPokemon = game.scene.getPlayerPokemon()!; const leadPokemon = game.scene.getPlayerPokemon()!;
@ -328,7 +328,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([Moves.SPORE, Moves.SPORE, Moves.SPORE, Moves.SPORE]).enemyAbility(Abilities.BAD_DREAMS); game.override
.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]);
@ -349,7 +351,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([Moves.TACKLE]).enemyAbility(Abilities.AFTERMATH); game.override.moveset([MoveId.TACKLE]).enemyAbility(AbilityId.AFTERMATH);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -372,7 +374,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([Moves.TACKLE]).enemyAbility(Abilities.IRON_BARBS); game.override.moveset([MoveId.TACKLE]).enemyAbility(AbilityId.IRON_BARBS);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -394,7 +396,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([Moves.ABSORB]).enemyAbility(Abilities.LIQUID_OOZE); game.override.moveset([MoveId.ABSORB]).enemyAbility(AbilityId.LIQUID_OOZE);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -415,7 +417,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 () => {
game.override.passiveAbility(Abilities.SOLAR_POWER).weather(WeatherType.SUNNY); game.override.passiveAbility(AbilityId.SOLAR_POWER).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,7 +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(Abilities.MIRROR_ARMOR).enemyAbility(Abilities.INTIMIDATE); game.override.ability(AbilityId.MIRROR_ARMOR).enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -53,7 +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(Abilities.MIRROR_ARMOR).ability(Abilities.INTIMIDATE); game.override.enemyAbility(AbilityId.MIRROR_ARMOR).ability(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -69,7 +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").ability(Abilities.MIRROR_ARMOR).enemyAbility(Abilities.INTIMIDATE); game.override.battleStyle("double").ability(AbilityId.MIRROR_ARMOR).enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER]); await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER]);
const [enemy1, enemy2] = game.scene.getEnemyField(); const [enemy1, enemy2] = game.scene.getEnemyField();
@ -89,7 +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").enemyAbility(Abilities.MIRROR_ARMOR).ability(Abilities.INTIMIDATE); game.override.battleStyle("double").enemyAbility(AbilityId.MIRROR_ARMOR).ability(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER]); await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER]);
const [enemy1, enemy2] = game.scene.getEnemyField(); const [enemy1, enemy2] = game.scene.getEnemyField();
@ -109,7 +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(Abilities.MIRROR_ARMOR).enemyAbility(Abilities.INTIMIDATE); game.override.ability(AbilityId.MIRROR_ARMOR).enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -127,7 +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").ability(Abilities.MIRROR_ARMOR).enemyAbility(Abilities.INTIMIDATE); game.override.battleStyle("double").ability(AbilityId.MIRROR_ARMOR).enemyAbility(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER]); await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER]);
const [enemy1, enemy2] = game.scene.getEnemyField(); const [enemy1, enemy2] = game.scene.getEnemyField();
@ -150,7 +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(Abilities.MIRROR_ARMOR).ability(Abilities.INTIMIDATE); game.override.enemyAbility(AbilityId.MIRROR_ARMOR).ability(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -168,7 +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(Abilities.WHITE_SMOKE).ability(Abilities.MIRROR_ARMOR); game.override.enemyAbility(AbilityId.WHITE_SMOKE).ability(AbilityId.MIRROR_ARMOR);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -186,7 +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(Abilities.WHITE_SMOKE).enemyAbility(Abilities.MIRROR_ARMOR); game.override.ability(AbilityId.WHITE_SMOKE).enemyAbility(AbilityId.MIRROR_ARMOR);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -240,7 +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(Abilities.MIRROR_ARMOR).ability(Abilities.MIRROR_ARMOR).ability(Abilities.INTIMIDATE); game.override.enemyAbility(AbilityId.MIRROR_ARMOR).ability(AbilityId.MIRROR_ARMOR).ability(AbilityId.INTIMIDATE);
await game.classicMode.startBattle([Species.BULBASAUR]); await game.classicMode.startBattle([Species.BULBASAUR]);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
@ -274,7 +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").ability(Abilities.MIRROR_ARMOR); game.override.battleStyle("double").ability(AbilityId.MIRROR_ARMOR);
await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE]); await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE]);
const [enemy1, enemy2] = game.scene.getEnemyField(); const [enemy1, enemy2] = game.scene.getEnemyField();

View File

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

@ -47,7 +47,7 @@ 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 game.override
.startingHeldItems([{ name: "ATTACK_TYPE_BOOSTER", count: 1, type: PokemonType.GRASS }]) .startingHeldItems([{ name: "ATTACK_TYPE_BOOSTER", count: 1, type: PokemonType.GRASS }])
.moveset([Moves.LEAFAGE]); .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]);
@ -61,7 +61,7 @@ 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 game.override
.startingHeldItems([{ name: "ATTACK_TYPE_BOOSTER", count: 1, type: PokemonType.NORMAL }]) .startingHeldItems([{ name: "ATTACK_TYPE_BOOSTER", count: 1, type: PokemonType.NORMAL }])
.moveset([Moves.LEAFAGE]); .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

@ -29,10 +29,10 @@ describe("Abilities - Parental Bond", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.ability(Abilities.PARENTAL_BOND) .ability(AbilityId.PARENTAL_BOND)
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyAbility(Abilities.FUR_COAT) .enemyAbility(AbilityId.FUR_COAT)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(MoveId.SPLASH)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100); .enemyLevel(100);
}); });
@ -62,7 +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([Moves.POWER_UP_PUNCH]).enemySpecies(Species.AMOONGUSS); game.override.moveset([MoveId.POWER_UP_PUNCH]).enemySpecies(Species.AMOONGUSS);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -148,7 +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([Moves.COUNTER]).enemyMoveset([Moves.TACKLE]); game.override.moveset([MoveId.COUNTER]).enemyMoveset([MoveId.TACKLE]);
await game.classicMode.startBattle([SpeciesId.SHUCKLE]); await game.classicMode.startBattle([SpeciesId.SHUCKLE]);
@ -166,7 +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").moveset([Moves.EARTHQUAKE]).passiveAbility(Abilities.LEVITATE); game.override.battleStyle("double").moveset([MoveId.EARTHQUAKE]).passiveAbility(AbilityId.LEVITATE);
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.FEEBAS]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.FEEBAS]);
@ -234,7 +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([Moves.TACKLE]).startingHeldItems([{ name: "MULTI_LENS", count: 1 }]); game.override.moveset([MoveId.TACKLE]).startingHeldItems([{ name: "MULTI_LENS", count: 1 }]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -248,7 +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([Moves.SEISMIC_TOSS]).startingHeldItems([{ name: "MULTI_LENS", count: 1 }]); game.override.moveset([MoveId.SEISMIC_TOSS]).startingHeldItems([{ name: "MULTI_LENS", count: 1 }]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -373,7 +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([Moves.TACKLE]).enemyMoveset([Moves.KINGS_SHIELD]); game.override.moveset([MoveId.TACKLE]).enemyMoveset([MoveId.KINGS_SHIELD]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -387,7 +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([Moves.WATER_GUN]).enemyAbility(Abilities.STORM_DRAIN); game.override.moveset([MoveId.WATER_GUN]).enemyAbility(AbilityId.STORM_DRAIN);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);

View File

@ -25,11 +25,11 @@ describe("Abilities - Perish Song", () => {
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.starterSpecies(Species.CURSOLA) .starterSpecies(Species.CURSOLA)
.ability(Abilities.PERISH_BODY) .ability(AbilityId.PERISH_BODY)
.moveset([Moves.SPLASH]) .moveset([MoveId.SPLASH])
.enemyMoveset([Moves.AQUA_JET]); .enemyMoveset([MoveId.AQUA_JET]);
}); });
it("should trigger when hit with damaging move", async () => { it("should trigger when hit with damaging move", async () => {
@ -87,8 +87,8 @@ 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 game.override
.enemyMoveset([Moves.PERISH_SONG, Moves.AQUA_JET, Moves.SPLASH]) .enemyMoveset([MoveId.PERISH_SONG, MoveId.AQUA_JET, MoveId.SPLASH])
.moveset([Moves.WHIRLWIND, Moves.SPLASH]) .moveset([MoveId.WHIRLWIND, MoveId.SPLASH])
.startingWave(5); .startingWave(5);
await game.classicMode.startBattle([Species.CURSOLA]); await game.classicMode.startBattle([Species.CURSOLA]);
const cursola = game.scene.getPlayerPokemon(); const cursola = game.scene.getPlayerPokemon();

View File

@ -36,7 +36,7 @@ describe("Abilities - POWER CONSTRUCT", () => {
const baseForm = 2, const baseForm = 2,
completeForm = 4; completeForm = 4;
game.override.startingWave(4).starterForms({ game.override.startingWave(4).starterForms({
[Species.ZYGARDE]: completeForm, [SpeciesId.ZYGARDE]: completeForm,
}); });
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.ZYGARDE]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.ZYGARDE]);
@ -62,7 +62,7 @@ describe("Abilities - POWER CONSTRUCT", () => {
const baseForm = 3, const baseForm = 3,
completeForm = 5; completeForm = 5;
game.override.startingWave(4).starterForms({ game.override.startingWave(4).starterForms({
[Species.ZYGARDE]: completeForm, [SpeciesId.ZYGARDE]: completeForm,
}); });
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.ZYGARDE]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.ZYGARDE]);

View File

@ -28,10 +28,10 @@ describe("Abilities - Power Spot", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.battleStyle("double") .battleStyle("double")
.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]) .moveset([MoveId.TACKLE, MoveId.BREAKING_SWIPE, MoveId.SPLASH, MoveId.DAZZLING_GLEAM])
.enemyMoveset(Moves.SPLASH) .enemyMoveset(MoveId.SPLASH)
.enemySpecies(Species.SHUCKLE) .enemySpecies(Species.SHUCKLE)
.enemyAbility(Abilities.BALL_FETCH); .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,7 +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([Moves.TACKLE]).passiveAbility(Abilities.REFRIGERATE); game.override.moveset([MoveId.TACKLE]).passiveAbility(AbilityId.REFRIGERATE);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -155,7 +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([Moves.TACKLE]).enemyMoveset(Moves.SPLASH); game.override.moveset([MoveId.TACKLE]).enemyMoveset(MoveId.SPLASH);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -186,7 +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([Moves.TACKLE]).enemySpecies(Species.GASTLY); game.override.moveset([MoveId.TACKLE]).enemySpecies(Species.GASTLY);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
@ -259,7 +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([Moves.TRICK_OR_TREAT]).enemySpecies(Species.GASTLY); game.override.moveset([MoveId.TRICK_OR_TREAT]).enemySpecies(Species.GASTLY);
await game.classicMode.startBattle([SpeciesId.MAGIKARP]); await game.classicMode.startBattle([SpeciesId.MAGIKARP]);

View File

@ -3,7 +3,6 @@ import { allAbilities } from "#app/data/data-lists";
import { FaintPhase } from "#app/phases/faint-phase"; import { FaintPhase } from "#app/phases/faint-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, test, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
@ -27,12 +26,12 @@ describe("Abilities - Quick Draw", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.starterSpecies(Species.MAGIKARP) .starterSpecies(Species.MAGIKARP)
.ability(Abilities.QUICK_DRAW) .ability(AbilityId.QUICK_DRAW)
.moveset([Moves.TACKLE, Moves.TAIL_WHIP]) .moveset([MoveId.TACKLE, MoveId.TAIL_WHIP])
.enemyLevel(100) .enemyLevel(100)
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset([Moves.TACKLE]); .enemyMoveset([MoveId.TACKLE]);
vi.spyOn(allAbilities[AbilityId.QUICK_DRAW].getAttrs(BypassSpeedChanceAbAttr)[0], "chance", "get").mockReturnValue( vi.spyOn(allAbilities[AbilityId.QUICK_DRAW].getAttrs(BypassSpeedChanceAbAttr)[0], "chance", "get").mockReturnValue(
100, 100,

View File

@ -26,10 +26,10 @@ describe("Abilities - Sand Spit", () => {
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.starterSpecies(Species.SILICOBRA) .starterSpecies(Species.SILICOBRA)
.ability(Abilities.SAND_SPIT) .ability(AbilityId.SAND_SPIT)
.moveset([Moves.SPLASH, Moves.COIL]); .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

@ -32,7 +32,7 @@ describe("Abilities - SCHOOLING", () => {
const soloForm = 0, const soloForm = 0,
schoolForm = 1; schoolForm = 1;
game.override.startingWave(4).starterForms({ game.override.startingWave(4).starterForms({
[Species.WISHIWASHI]: schoolForm, [SpeciesId.WISHIWASHI]: schoolForm,
}); });
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.WISHIWASHI]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.WISHIWASHI]);

View File

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

View File

@ -26,10 +26,10 @@ describe("Abilities - Seed Sower", () => {
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.starterSpecies(Species.ARBOLIVA) .starterSpecies(Species.ARBOLIVA)
.ability(Abilities.SEED_SOWER) .ability(AbilityId.SEED_SOWER)
.moveset([Moves.SPLASH]); .moveset([MoveId.SPLASH]);
}); });
it("should trigger when hit with damaging move", async () => { it("should trigger when hit with damaging move", async () => {

View File

@ -34,10 +34,10 @@ describe("Abilities - Shield Dust", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.ONIX) .enemySpecies(Species.ONIX)
.enemyAbility(Abilities.SHIELD_DUST) .enemyAbility(AbilityId.SHIELD_DUST)
.startingLevel(100) .startingLevel(100)
.moveset(Moves.AIR_SLASH) .moveset(MoveId.AIR_SLASH)
.enemyMoveset(Moves.TACKLE); .enemyMoveset(MoveId.TACKLE);
}); });
it("Shield Dust", async () => { it("Shield Dust", async () => {

View File

@ -25,12 +25,12 @@ describe("Abilities - SHIELDS DOWN", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
const moveToUse = Moves.SPLASH; const moveToUse = MoveId.SPLASH;
game.override game.override
.battleStyle("single") .battleStyle("single")
.ability(Abilities.SHIELDS_DOWN) .ability(AbilityId.SHIELDS_DOWN)
.moveset([moveToUse]) .moveset([moveToUse])
.enemyMoveset([Moves.TACKLE]); .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 () => {
@ -70,7 +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(Abilities.MOLD_BREAKER).enemyMoveset([Moves.SPORE]); game.override.enemyAbility(AbilityId.MOLD_BREAKER).enemyMoveset([MoveId.SPORE]);
await game.classicMode.startBattle([SpeciesId.MINIOR]); await game.classicMode.startBattle([SpeciesId.MINIOR]);
@ -93,7 +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([Moves.SPORE]).enemyAbility(Abilities.MOLD_BREAKER); game.override.enemyMoveset([MoveId.SPORE]).enemyAbility(AbilityId.MOLD_BREAKER);
await game.classicMode.startBattle([SpeciesId.MINIOR]); await game.classicMode.startBattle([SpeciesId.MINIOR]);
@ -107,8 +107,8 @@ 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 game.override
.enemyMoveset([Moves.GRAVITY, Moves.TOXIC_SPIKES, Moves.SPLASH]) .enemyMoveset([MoveId.GRAVITY, MoveId.TOXIC_SPIKES, MoveId.SPLASH])
.moveset([Moves.GRAVITY, Moves.SPLASH]); .moveset([MoveId.GRAVITY, MoveId.SPLASH]);
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MINIOR]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MINIOR]);
@ -154,7 +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(Species.DITTO).enemyAbility(Abilities.IMPOSTER).moveset([Moves.SPLASH, Moves.SPORE]); game.override.enemySpecies(Species.DITTO).enemyAbility(AbilityId.IMPOSTER).moveset([MoveId.SPLASH, MoveId.SPORE]);
await game.classicMode.startBattle([SpeciesId.MINIOR]); await game.classicMode.startBattle([SpeciesId.MINIOR]);
@ -167,8 +167,8 @@ 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 game.override
.enemyMoveset([Moves.TACKLE]) .enemyMoveset([MoveId.TACKLE])
.moveset([Moves.THUNDERBOLT]) .moveset([MoveId.THUNDERBOLT])
.startingLevel(100) .startingLevel(100)
.startingWave(5) .startingWave(5)
.enemySpecies(Species.MINIOR); .enemySpecies(Species.MINIOR);

View File

@ -31,9 +31,9 @@ describe("Abilities - Steely Spirit", () => {
game.override game.override
.battleStyle("double") .battleStyle("double")
.enemySpecies(Species.SHUCKLE) .enemySpecies(Species.SHUCKLE)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.moveset([Moves.IRON_HEAD, Moves.SPLASH]) .moveset([MoveId.IRON_HEAD, MoveId.SPLASH])
.enemyMoveset(Moves.SPLASH); .enemyMoveset(MoveId.SPLASH);
vi.spyOn(allMoves[moveToCheck], "calculateBattlePower"); vi.spyOn(allMoves[moveToCheck], "calculateBattlePower");
}); });

View File

@ -3,7 +3,6 @@ import { DamageAnimPhase } from "#app/phases/damage-anim-phase";
import { MoveEndPhase } from "#app/phases/move-end-phase"; import { MoveEndPhase } from "#app/phases/move-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, test } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
@ -28,10 +27,10 @@ describe("Abilities - Sturdy", () => {
.battleStyle("single") .battleStyle("single")
.starterSpecies(Species.LUCARIO) .starterSpecies(Species.LUCARIO)
.startingLevel(100) .startingLevel(100)
.moveset([Moves.CLOSE_COMBAT, Moves.FISSURE]) .moveset([MoveId.CLOSE_COMBAT, MoveId.FISSURE])
.enemySpecies(Species.ARON) .enemySpecies(Species.ARON)
.enemyLevel(5) .enemyLevel(5)
.enemyAbility(Abilities.STURDY); .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,7 +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(Species.PIKACHU).enemyLevel(5).startingLevel(5).enemyMoveset(Moves.SPLASH); game.override.enemySpecies(Species.PIKACHU).enemyLevel(5).startingLevel(5).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,7 +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).moveset([Moves.TACKLE]); game.override.enemyLevel(1).moveset([MoveId.TACKLE]);
await game.classicMode.startBattle(); await game.classicMode.startBattle();

View File

@ -3,7 +3,6 @@ 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";
@ -36,9 +35,9 @@ describe("Abilities - Volt Absorb", () => {
game.override game.override
.moveset([moveToUse]) .moveset([moveToUse])
.ability(ability) .ability(ability)
.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]) .enemyMoveset([MoveId.SPLASH, MoveId.NONE, MoveId.NONE, MoveId.NONE])
.enemySpecies(Species.DUSKULL) .enemySpecies(Species.DUSKULL)
.enemyAbility(Abilities.BALL_FETCH); .enemyAbility(AbilityId.BALL_FETCH);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
@ -55,10 +54,10 @@ describe("Abilities - Volt Absorb", () => {
it("should activate regardless of accuracy checks", async () => { it("should activate regardless of accuracy checks", async () => {
game.override game.override
.moveset(Moves.THUNDERBOLT) .moveset(MoveId.THUNDERBOLT)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(MoveId.SPLASH)
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.VOLT_ABSORB); .enemyAbility(AbilityId.VOLT_ABSORB);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
@ -76,10 +75,10 @@ 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 game.override
.moveset(Moves.THUNDERBOLT) .moveset(MoveId.THUNDERBOLT)
.enemyMoveset(Moves.DIVE) .enemyMoveset(MoveId.DIVE)
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.VOLT_ABSORB); .enemyAbility(AbilityId.VOLT_ABSORB);
await game.classicMode.startBattle(); await game.classicMode.startBattle();

View File

@ -26,9 +26,9 @@ describe("Abilities - Wind Power", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.SHIFTRY) .enemySpecies(Species.SHIFTRY)
.enemyAbility(Abilities.WIND_POWER) .enemyAbility(AbilityId.WIND_POWER)
.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]) .moveset([MoveId.TAILWIND, MoveId.SPLASH, MoveId.PETAL_BLIZZARD, MoveId.SANDSTORM])
.enemyMoveset(Moves.SPLASH); .enemyMoveset(MoveId.SPLASH);
}); });
it("becomes charged when hit by wind moves", async () => { it("becomes charged when hit by wind moves", async () => {
@ -44,7 +44,7 @@ describe("Abilities - Wind Power", () => {
}); });
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(Abilities.WIND_POWER).enemySpecies(Species.MAGIKARP); game.override.ability(AbilityId.WIND_POWER).enemySpecies(Species.MAGIKARP);
await game.classicMode.startBattle([SpeciesId.SHIFTRY]); await game.classicMode.startBattle([SpeciesId.SHIFTRY]);
const shiftry = game.scene.getPlayerPokemon()!; const shiftry = game.scene.getPlayerPokemon()!;
@ -58,7 +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(Species.MAGIKARP).ability(Abilities.WIND_POWER); game.override.enemySpecies(Species.MAGIKARP).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

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

View File

@ -86,7 +86,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).starterForms({ game.override.startingWave(4).starterForms({
[Species.DARMANITAN]: zenForm, [SpeciesId.DARMANITAN]: zenForm,
}); });
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.DARMANITAN]); await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.DARMANITAN]);

View File

@ -35,7 +35,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).starterForms({ game.override.startingWave(4).starterForms({
[Species.PALAFIN]: heroForm, [SpeciesId.PALAFIN]: heroForm,
}); });
await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.PALAFIN, SpeciesId.PALAFIN]); await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.PALAFIN, SpeciesId.PALAFIN]);

View File

@ -27,11 +27,11 @@ describe("Weather - Fog", () => {
game.override game.override
.weather(WeatherType.FOG) .weather(WeatherType.FOG)
.battleStyle("single") .battleStyle("single")
.moveset([Moves.TACKLE]) .moveset([MoveId.TACKLE])
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyMoveset([Moves.SPLASH]); .enemyMoveset([MoveId.SPLASH]);
}); });
it("move accuracy is multiplied by 90%", async () => { it("move accuracy is multiplied by 90%", async () => {

View File

@ -28,8 +28,8 @@ describe("Weather - Strong Winds", () => {
.battleStyle("single") .battleStyle("single")
.startingLevel(10) .startingLevel(10)
.enemySpecies(Species.TAILLOW) .enemySpecies(Species.TAILLOW)
.enemyAbility(Abilities.DELTA_STREAM) .enemyAbility(AbilityId.DELTA_STREAM)
.moveset([Moves.THUNDERBOLT, Moves.ICE_BEAM, Moves.ROCK_SLIDE]); .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

@ -27,9 +27,9 @@ describe("Battle order", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.MEWTWO) .enemySpecies(Species.MEWTWO)
.enemyAbility(Abilities.INSOMNIA) .enemyAbility(AbilityId.INSOMNIA)
.ability(Abilities.INSOMNIA) .ability(AbilityId.INSOMNIA)
.moveset([Moves.TACKLE]); .moveset([MoveId.TACKLE]);
}); });
it("opponent faster than player 50 vs 150", async () => { it("opponent faster than player 50 vs 150", async () => {

View File

@ -23,7 +23,6 @@ import { PlayerGender } from "#enums/player-gender";
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 { BiomeId } from "#enums/biome-id";
describe("Test Battle Phase", () => { describe("Test Battle Phase", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -91,7 +90,7 @@ describe("Test Battle Phase", () => {
it("do attack wave 3 - single battle - regular - OHKO", async () => { it("do attack wave 3 - single battle - regular - OHKO", async () => {
game.override.enemySpecies(Species.RATTATA).startingLevel(2000).battleStyle("single"); game.override.enemySpecies(Species.RATTATA).startingLevel(2000).battleStyle("single");
await game.classicMode.startBattle([Species.MEWTWO]); await game.classicMode.startBattle([Species.MEWTWO]);
game.move.use(Moves.TACKLE); game.move.use(MoveId.TACKLE);
await game.phaseInterceptor.to("SelectModifierPhase"); await game.phaseInterceptor.to("SelectModifierPhase");
}, 20000); }, 20000);
@ -100,12 +99,12 @@ describe("Test Battle Phase", () => {
.enemySpecies(Species.RATTATA) .enemySpecies(Species.RATTATA)
.startingLevel(5) .startingLevel(5)
.startingWave(3) .startingWave(3)
.moveset([Moves.TACKLE]) .moveset([MoveId.TACKLE])
.enemyAbility(Abilities.HYDRATION) .enemyAbility(AbilityId.HYDRATION)
.enemyMoveset([Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP, Moves.TAIL_WHIP]) .enemyMoveset([MoveId.TAIL_WHIP, MoveId.TAIL_WHIP, MoveId.TAIL_WHIP, MoveId.TAIL_WHIP])
.battleStyle("single"); .battleStyle("single");
await game.classicMode.startBattle([Species.MEWTWO]); await game.classicMode.startBattle([Species.MEWTWO]);
game.move.select(Moves.TACKLE); game.move.select(MoveId.TACKLE);
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnInitPhase, false); await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnInitPhase, false);
}, 20000); }, 20000);
@ -237,17 +236,17 @@ describe("Test Battle Phase", () => {
}, 20000); }, 20000);
it("kill opponent pokemon", async () => { it("kill opponent pokemon", async () => {
const moveToUse = Moves.SPLASH; const moveToUse = MoveId.SPLASH;
game.override game.override
.battleStyle("single") .battleStyle("single")
.starterSpecies(Species.MEWTWO) .starterSpecies(Species.MEWTWO)
.enemySpecies(Species.RATTATA) .enemySpecies(Species.RATTATA)
.enemyAbility(Abilities.HYDRATION) .enemyAbility(AbilityId.HYDRATION)
.ability(Abilities.ZEN_MODE) .ability(AbilityId.ZEN_MODE)
.startingLevel(2000) .startingLevel(2000)
.startingWave(3) .startingWave(3)
.moveset([moveToUse]) .moveset([moveToUse])
.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); .enemyMoveset([MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE]);
await game.classicMode.startBattle([Species.DARMANITAN, Species.CHARIZARD]); await game.classicMode.startBattle([Species.DARMANITAN, Species.CHARIZARD]);
game.move.select(moveToUse); game.move.select(moveToUse);
@ -258,16 +257,16 @@ describe("Test Battle Phase", () => {
}); });
it("to next turn", async () => { it("to next turn", async () => {
const moveToUse = Moves.SPLASH; const moveToUse = MoveId.SPLASH;
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.RATTATA) .enemySpecies(Species.RATTATA)
.enemyAbility(Abilities.HYDRATION) .enemyAbility(AbilityId.HYDRATION)
.ability(Abilities.ZEN_MODE) .ability(AbilityId.ZEN_MODE)
.startingLevel(2000) .startingLevel(2000)
.startingWave(3) .startingWave(3)
.moveset([moveToUse]) .moveset([moveToUse])
.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]); .enemyMoveset([MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE, MoveId.TACKLE]);
await game.classicMode.startBattle([Species.MEWTWO]); await game.classicMode.startBattle([Species.MEWTWO]);
const turn = game.scene.currentBattle.turn; const turn = game.scene.currentBattle.turn;
game.move.select(moveToUse); game.move.select(moveToUse);
@ -287,7 +286,7 @@ describe("Test Battle Phase", () => {
.startingWave(3) .startingWave(3)
.startingBiome(Biome.LAKE) .startingBiome(Biome.LAKE)
.moveset([moveToUse]) .moveset([moveToUse])
.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.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

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

View File

@ -31,7 +31,7 @@ describe("Evolution", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.startingLevel(60); .startingLevel(60);
}); });

View File

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

View File

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

View File

@ -26,10 +26,10 @@ describe("Moves - Baneful Bunker", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.moveset(Moves.SLASH) .moveset(MoveId.SLASH)
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyAbility(Abilities.INSOMNIA) .enemyAbility(AbilityId.INSOMNIA)
.enemyMoveset(Moves.BANEFUL_BUNKER) .enemyMoveset(MoveId.BANEFUL_BUNKER)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100); .enemyLevel(100);
}); });

View File

@ -59,17 +59,17 @@ 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([Moves.NASTY_PLOT, Moves.BATON_PASS]); game.override.startingWave(5).enemyMoveset([MoveId.NASTY_PLOT, MoveId.BATON_PASS]);
await game.classicMode.startBattle([Species.RAICHU, Species.SHUCKLE]); await game.classicMode.startBattle([Species.RAICHU, Species.SHUCKLE]);
// round 1 - ai buffs // round 1 - ai buffs
game.move.select(Moves.SPLASH); game.move.select(MoveId.SPLASH);
await game.move.forceEnemyMove(Moves.NASTY_PLOT); await game.move.forceEnemyMove(MoveId.NASTY_PLOT);
await game.toNextTurn(); await game.toNextTurn();
// round 2 - baton pass // round 2 - baton pass
game.move.select(Moves.SPLASH); game.move.select(MoveId.SPLASH);
await game.move.forceEnemyMove(Moves.BATON_PASS); await game.move.forceEnemyMove(MoveId.BATON_PASS);
await game.phaseInterceptor.to("PostSummonPhase", false); await game.phaseInterceptor.to("PostSummonPhase", false);
// check buffs are still there // check buffs are still there

View File

@ -129,9 +129,9 @@ 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(Abilities.LONG_REACH).enemyMoveset([Moves.FALSE_SWIPE]).enemyLevel(100); game.override.enemyAbility(AbilityId.LONG_REACH).enemyMoveset([MoveId.FALSE_SWIPE]).enemyLevel(100);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.select(Moves.BEAK_BLAST); game.move.select(MoveId.BEAK_BLAST);
await game.phaseInterceptor.to("BerryPhase", false); await game.phaseInterceptor.to("BerryPhase", false);
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
expect(enemyPokemon.status?.effect).not.toBe(StatusEffect.BURN); expect(enemyPokemon.status?.effect).not.toBe(StatusEffect.BURN);

View File

@ -27,10 +27,10 @@ describe("Moves - Beat Up", () => {
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyLevel(100) .enemyLevel(100)
.enemyMoveset([Moves.SPLASH]) .enemyMoveset([MoveId.SPLASH])
.enemyAbility(Abilities.INSOMNIA) .enemyAbility(AbilityId.INSOMNIA)
.startingLevel(100) .startingLevel(100)
.moveset([Moves.BEAT_UP]); .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

@ -29,13 +29,13 @@ describe("Moves - Ceaseless Edge", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.RATTATA) .enemySpecies(Species.RATTATA)
.enemyAbility(Abilities.RUN_AWAY) .enemyAbility(AbilityId.RUN_AWAY)
.enemyPassiveAbility(Abilities.RUN_AWAY) .enemyPassiveAbility(AbilityId.RUN_AWAY)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100) .enemyLevel(100)
.moveset([Moves.CEASELESS_EDGE, Moves.SPLASH, Moves.ROAR]) .moveset([MoveId.CEASELESS_EDGE, MoveId.SPLASH, MoveId.ROAR])
.enemyMoveset(Moves.SPLASH); .enemyMoveset(MoveId.SPLASH);
vi.spyOn(allMoves[Moves.CEASELESS_EDGE], "accuracy", "get").mockReturnValue(100); vi.spyOn(allMoves[MoveId.CEASELESS_EDGE], "accuracy", "get").mockReturnValue(100);
}); });
test("move should hit and apply spikes", async () => { test("move should hit and apply spikes", async () => {

View File

@ -32,8 +32,8 @@ describe("Moves - Clangorous Soul", () => {
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100) .enemyLevel(100)
.moveset([Moves.CLANGOROUS_SOUL]) .moveset([MoveId.CLANGOROUS_SOUL])
.enemyMoveset(Moves.SPLASH); .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

@ -28,10 +28,10 @@ describe("Moves - Crafty Shield", () => {
game.override game.override
.battleStyle("double") .battleStyle("double")
.moveset([Moves.CRAFTY_SHIELD, Moves.SPLASH, Moves.SWORDS_DANCE]) .moveset([MoveId.CRAFTY_SHIELD, MoveId.SPLASH, MoveId.SWORDS_DANCE])
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyMoveset([Moves.GROWL]) .enemyMoveset([MoveId.GROWL])
.enemyAbility(Abilities.INSOMNIA) .enemyAbility(AbilityId.INSOMNIA)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100); .enemyLevel(100);
}); });
@ -71,7 +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(Species.DUSCLOPS).enemyMoveset([Moves.CURSE]); game.override.enemySpecies(Species.DUSCLOPS).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";
@ -34,14 +33,14 @@ describe("Moves - Dragon Rage", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.starterSpecies(Species.SNORLAX) .starterSpecies(Species.SNORLAX)
.moveset([Moves.DRAGON_RAGE]) .moveset([MoveId.DRAGON_RAGE])
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.passiveAbility(Abilities.BALL_FETCH) .passiveAbility(AbilityId.BALL_FETCH)
.startingLevel(100) .startingLevel(100)
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(MoveId.SPLASH)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyPassiveAbility(Abilities.BALL_FETCH) .enemyPassiveAbility(AbilityId.BALL_FETCH)
.enemyLevel(100); .enemyLevel(100);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
@ -100,7 +99,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().enemyAbility(Abilities.ICE_SCALES); game.override.disableCrits().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,7 +38,7 @@ describe("Moves - Dynamax Cannon", () => {
.enemySpecies(SpeciesId.MAGIKARP) .enemySpecies(SpeciesId.MAGIKARP)
.enemyMoveset(MoveId.SPLASH); .enemyMoveset(MoveId.SPLASH);
vi.spyOn(allMoves[Moves.DYNAMAX_CANNON], "calculateBattlePower"); vi.spyOn(allMoves[MoveId.DYNAMAX_CANNON], "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

@ -33,8 +33,8 @@ describe("Moves - FILLET AWAY", () => {
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100) .enemyLevel(100)
.moveset([Moves.FILLET_AWAY]) .moveset([MoveId.FILLET_AWAY])
.enemyMoveset(Moves.SPLASH); .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";
@ -32,12 +31,12 @@ describe("Moves - Fissure", () => {
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.starterSpecies(Species.SNORLAX) .starterSpecies(Species.SNORLAX)
.moveset([Moves.FISSURE]) .moveset([MoveId.FISSURE])
.passiveAbility(Abilities.BALL_FETCH) .passiveAbility(AbilityId.BALL_FETCH)
.startingLevel(100) .startingLevel(100)
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(MoveId.SPLASH)
.enemyPassiveAbility(Abilities.BALL_FETCH) .enemyPassiveAbility(AbilityId.BALL_FETCH)
.enemyLevel(100); .enemyLevel(100);
await game.classicMode.startBattle(); await game.classicMode.startBattle();
@ -47,7 +46,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(Abilities.NO_GUARD).enemyAbility(Abilities.FUR_COAT); game.override.ability(AbilityId.NO_GUARD).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

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

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

@ -27,12 +27,12 @@ describe("Moves - Follow Me", () => {
game.override game.override
.battleStyle("double") .battleStyle("double")
.starterSpecies(Species.AMOONGUSS) .starterSpecies(Species.AMOONGUSS)
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100) .enemyLevel(100)
.moveset([Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK]) .moveset([MoveId.FOLLOW_ME, MoveId.RAGE_POWDER, MoveId.SPOTLIGHT, MoveId.QUICK_ATTACK])
.enemyMoveset([Moves.TACKLE, Moves.FOLLOW_ME, Moves.SPLASH]); .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 () => {
@ -74,7 +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(Abilities.STALWART).moveset([Moves.QUICK_ATTACK]); game.override.ability(AbilityId.STALWART).moveset([MoveId.QUICK_ATTACK]);
await game.classicMode.startBattle([SpeciesId.AMOONGUSS, SpeciesId.CHARIZARD]); await game.classicMode.startBattle([SpeciesId.AMOONGUSS, SpeciesId.CHARIZARD]);

View File

@ -26,11 +26,11 @@ describe("Moves - Gastro Acid", () => {
.battleStyle("double") .battleStyle("double")
.startingLevel(1) .startingLevel(1)
.enemyLevel(100) .enemyLevel(100)
.ability(Abilities.NONE) .ability(AbilityId.NONE)
.moveset([Moves.GASTRO_ACID, Moves.WATER_GUN, Moves.SPLASH, Moves.CORE_ENFORCER]) .moveset([MoveId.GASTRO_ACID, MoveId.WATER_GUN, MoveId.SPLASH, MoveId.CORE_ENFORCER])
.enemySpecies(Species.BIDOOF) .enemySpecies(Species.BIDOOF)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(MoveId.SPLASH)
.enemyAbility(Abilities.WATER_ABSORB); .enemyAbility(AbilityId.WATER_ABSORB);
}); });
it("suppresses effect of ability", async () => { it("suppresses effect of ability", async () => {

View File

@ -1,7 +1,6 @@
import { allMoves } from "#app/data/data-lists"; import { allMoves } from "#app/data/data-lists";
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";
@ -26,10 +25,10 @@ describe("Moves - Glaive Rush", () => {
.battleStyle("single") .battleStyle("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset([Moves.GLAIVE_RUSH]) .enemyMoveset([MoveId.GLAIVE_RUSH])
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.moveset([Moves.SHADOW_SNEAK, Moves.AVALANCHE, Moves.SPLASH, Moves.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 () => {
@ -60,7 +59,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([Moves.AVALANCHE]); game.override.startingHeldItems([{ name: "MULTI_LENS", count: 2 }]).enemyMoveset([MoveId.AVALANCHE]);
await game.classicMode.startBattle([Species.KLINK]); await game.classicMode.startBattle([Species.KLINK]);
const player = game.scene.getPlayerPokemon()!; const player = game.scene.getPlayerPokemon()!;
@ -80,7 +79,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([Moves.SHADOW_SNEAK]); game.override.enemyMoveset([MoveId.SHADOW_SNEAK]);
await game.classicMode.startBattle([Species.KLINK]); await game.classicMode.startBattle([Species.KLINK]);
const player = game.scene.getPlayerPokemon()!; const player = game.scene.getPlayerPokemon()!;
@ -105,7 +104,7 @@ describe("Moves - Glaive Rush", () => {
}); });
it("secondary effects are removed upon switching", async () => { it("secondary effects are removed upon switching", async () => {
game.override.enemyMoveset([Moves.SHADOW_SNEAK]); game.override.enemyMoveset([MoveId.SHADOW_SNEAK]);
await game.classicMode.startBattle([Species.KLINK, Species.FEEBAS]); await game.classicMode.startBattle([Species.KLINK, Species.FEEBAS]);
const player = game.scene.getPlayerPokemon()!; const player = game.scene.getPlayerPokemon()!;
@ -127,8 +126,8 @@ 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 game.override
.moveset([Moves.SHADOW_SNEAK, Moves.PROTECT, Moves.SPLASH, Moves.GLAIVE_RUSH]) .moveset([MoveId.SHADOW_SNEAK, MoveId.PROTECT, MoveId.SPLASH, MoveId.GLAIVE_RUSH])
.enemyMoveset([Moves.GLAIVE_RUSH, Moves.SPLASH]); .enemyMoveset([MoveId.GLAIVE_RUSH, MoveId.SPLASH]);
await game.classicMode.startBattle([Species.KLINK]); await game.classicMode.startBattle([Species.KLINK]);
const player = game.scene.getPlayerPokemon()!; const player = game.scene.getPlayerPokemon()!;
@ -137,18 +136,18 @@ describe("Moves - Glaive Rush", () => {
enemy.hp = 1000; enemy.hp = 1000;
player.hp = 1000; player.hp = 1000;
game.move.select(Moves.PROTECT); game.move.select(MoveId.PROTECT);
await game.move.forceEnemyMove(Moves.GLAIVE_RUSH); await game.move.forceEnemyMove(MoveId.GLAIVE_RUSH);
await game.phaseInterceptor.to("TurnEndPhase"); await game.phaseInterceptor.to("TurnEndPhase");
game.move.select(Moves.SHADOW_SNEAK); game.move.select(MoveId.SHADOW_SNEAK);
await game.move.forceEnemyMove(Moves.GLAIVE_RUSH); await game.move.forceEnemyMove(MoveId.GLAIVE_RUSH);
await game.phaseInterceptor.to("TurnEndPhase"); await game.phaseInterceptor.to("TurnEndPhase");
const damagedHP1 = 1000 - enemy.hp; const damagedHP1 = 1000 - enemy.hp;
enemy.hp = 1000; enemy.hp = 1000;
game.move.select(Moves.SHADOW_SNEAK); game.move.select(MoveId.SHADOW_SNEAK);
await game.move.forceEnemyMove(Moves.SPLASH); 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

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

View File

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

View File

@ -27,11 +27,11 @@ describe("Moves - Haze", () => {
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.RATTATA) .enemySpecies(Species.RATTATA)
.enemyLevel(100) .enemyLevel(100)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(MoveId.SPLASH)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.startingLevel(100) .startingLevel(100)
.moveset([Moves.HAZE, Moves.SWORDS_DANCE, Moves.CHARM, Moves.SPLASH]) .moveset([MoveId.HAZE, MoveId.SWORDS_DANCE, MoveId.CHARM, MoveId.SPLASH])
.ability(Abilities.BALL_FETCH); .ability(AbilityId.BALL_FETCH);
}); });
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

@ -28,13 +28,13 @@ describe("Moves - Hyper Beam", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset([Moves.SPLASH]) .enemyMoveset([MoveId.SPLASH])
.enemyLevel(100) .enemyLevel(100)
.moveset([Moves.HYPER_BEAM, Moves.TACKLE]); .moveset([MoveId.HYPER_BEAM, MoveId.TACKLE]);
vi.spyOn(allMoves[Moves.HYPER_BEAM], "accuracy", "get").mockReturnValue(100); vi.spyOn(allMoves[MoveId.HYPER_BEAM], "accuracy", "get").mockReturnValue(100);
}); });
it("should force the user to recharge on the next turn (and only that turn)", async () => { it("should force the user to recharge on the next turn (and only that turn)", async () => {

View File

@ -25,10 +25,10 @@ describe("Moves - Lunar Blessing", () => {
game.override game.override
.battleStyle("double") .battleStyle("double")
.enemySpecies(Species.SHUCKLE) .enemySpecies(Species.SHUCKLE)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(MoveId.SPLASH)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.moveset([Moves.LUNAR_BLESSING, Moves.SPLASH]) .moveset([MoveId.LUNAR_BLESSING, MoveId.SPLASH])
.ability(Abilities.BALL_FETCH); .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,7 +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([Moves.GROWL, Moves.SPLASH]).enemyMoveset([Moves.MAGIC_COAT, Moves.SPLASH]); game.override.moveset([MoveId.GROWL, MoveId.SPLASH]).enemyMoveset([MoveId.MAGIC_COAT, MoveId.SPLASH]);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
// turn 1 // turn 1
@ -81,7 +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").moveset([Moves.GROWL, Moves.SPLASH]); game.override.battleStyle("double").moveset([MoveId.GROWL, MoveId.SPLASH]);
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
game.move.select(MoveId.GROWL, 0); game.move.select(MoveId.GROWL, 0);
@ -95,8 +95,8 @@ 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 game.override
.battleStyle("double") .battleStyle("double")
.moveset([Moves.GROWL, Moves.SPLASH]) .moveset([MoveId.GROWL, MoveId.SPLASH])
.enemyMoveset([Moves.SPLASH, Moves.MAGIC_COAT]); .enemyMoveset([MoveId.SPLASH, MoveId.MAGIC_COAT]);
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
game.move.select(MoveId.GROWL, 0); game.move.select(MoveId.GROWL, 0);
@ -122,9 +122,9 @@ 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 game.override
.battleStyle("double") .battleStyle("double")
.ability(Abilities.MAGIC_BOUNCE) .ability(AbilityId.MAGIC_BOUNCE)
.moveset([Moves.GROWL, Moves.MAGIC_COAT]) .moveset([MoveId.GROWL, MoveId.MAGIC_COAT])
.enemyMoveset([Moves.SPLASH, Moves.MAGIC_COAT]); .enemyMoveset([MoveId.SPLASH, MoveId.MAGIC_COAT]);
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
game.move.select(MoveId.MAGIC_COAT, 0); game.move.select(MoveId.MAGIC_COAT, 0);
@ -147,7 +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(Abilities.MOLD_BREAKER).moveset([Moves.GROWL]); game.override.ability(AbilityId.MOLD_BREAKER).moveset([MoveId.GROWL]);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.select(MoveId.GROWL); game.move.select(MoveId.GROWL);
@ -158,7 +158,7 @@ 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").moveset([Moves.SPIKES]); game.override.battleStyle("double").moveset([MoveId.SPIKES]);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.select(MoveId.SPIKES); game.move.select(MoveId.SPIKES);
@ -169,7 +169,7 @@ describe("Moves - Magic Coat", () => {
}); });
it("should not bounce back curse", async () => { it("should not bounce back curse", async () => {
game.override.moveset([Moves.CURSE]); game.override.moveset([MoveId.CURSE]);
await game.classicMode.startBattle([Species.GASTLY]); await game.classicMode.startBattle([Species.GASTLY]);
game.move.select(MoveId.CURSE); game.move.select(MoveId.CURSE);
@ -181,9 +181,9 @@ 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 game.override
.moveset([Moves.GROWL, Moves.ENCORE]) .moveset([MoveId.GROWL, MoveId.ENCORE])
.enemyMoveset([Moves.MAGIC_COAT, Moves.TACKLE]) .enemyMoveset([MoveId.MAGIC_COAT, MoveId.TACKLE])
.enemyAbility(Abilities.MAGIC_BOUNCE); .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()!;
@ -204,7 +204,7 @@ 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").moveset([Moves.STOMPING_TANTRUM, Moves.CHARM]); game.override.battleStyle("single").moveset([MoveId.STOMPING_TANTRUM, MoveId.CHARM]);
await game.classicMode.startBattle([Species.MAGIKARP]); await game.classicMode.startBattle([Species.MAGIKARP]);
const stomping_tantrum = allMoves[MoveId.STOMPING_TANTRUM]; const stomping_tantrum = allMoves[MoveId.STOMPING_TANTRUM];
@ -245,8 +245,8 @@ 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[Moves.THUNDER_WAVE], "accuracy", "get").mockReturnValue(100); vi.spyOn(allMoves[MoveId.THUNDER_WAVE], "accuracy", "get").mockReturnValue(100);
game.override.moveset([Moves.THUNDER_WAVE, Moves.GROWL]).ability(Abilities.SOUNDPROOF); game.override.moveset([MoveId.THUNDER_WAVE, MoveId.GROWL]).ability(AbilityId.SOUNDPROOF);
await game.classicMode.startBattle([Species.PHANPY]); await game.classicMode.startBattle([Species.PHANPY]);
// Turn 1 - thunder wave immunity test // Turn 1 - thunder wave immunity test

View File

@ -26,10 +26,10 @@ describe("Moves - Make It Rain", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.battleStyle("double") .battleStyle("double")
.moveset([Moves.MAKE_IT_RAIN, Moves.SPLASH]) .moveset([MoveId.MAKE_IT_RAIN, MoveId.SPLASH])
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyAbility(Abilities.INSOMNIA) .enemyAbility(AbilityId.INSOMNIA)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(MoveId.SPLASH)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100); .enemyLevel(100);
}); });

View File

@ -28,10 +28,10 @@ describe("Moves - Mat Block", () => {
game.override game.override
.battleStyle("double") .battleStyle("double")
.moveset([Moves.MAT_BLOCK, Moves.SPLASH]) .moveset([MoveId.MAT_BLOCK, MoveId.SPLASH])
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyMoveset([Moves.TACKLE]) .enemyMoveset([MoveId.TACKLE])
.enemyAbility(Abilities.INSOMNIA) .enemyAbility(AbilityId.INSOMNIA)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100); .enemyLevel(100);
}); });

View File

@ -28,8 +28,8 @@ describe("Moves - Parting Shot", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.battleStyle("single") .battleStyle("single")
.moveset([Moves.PARTING_SHOT, Moves.SPLASH]) .moveset([MoveId.PARTING_SHOT, MoveId.SPLASH])
.enemyMoveset(Moves.SPLASH) .enemyMoveset(MoveId.SPLASH)
.startingLevel(5) .startingLevel(5)
.enemyLevel(5); .enemyLevel(5);
}); });

View File

@ -29,7 +29,7 @@ describe("Moves - Powder", () => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.SNORLAX) .enemySpecies(SpeciesId.SNORLAX)
.enemyLevel(100) .enemyLevel(100)
.enemyMoveset(MoveId.EMBER) .enemyMoveset(MoveId.EMBER)
.enemyAbility(AbilityId.INSOMNIA) .enemyAbility(AbilityId.INSOMNIA)

View File

@ -29,10 +29,10 @@ describe("Moves - Protect", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.moveset([Moves.PROTECT]) .moveset([MoveId.PROTECT])
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyAbility(Abilities.INSOMNIA) .enemyAbility(AbilityId.INSOMNIA)
.enemyMoveset([Moves.TACKLE]) .enemyMoveset([MoveId.TACKLE])
.startingLevel(100) .startingLevel(100)
.enemyLevel(100); .enemyLevel(100);
}); });

View File

@ -3,7 +3,6 @@ import { Status } from "#app/data/status-effect";
import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon"; import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon";
import { MoveEndPhase } from "#app/phases/move-end-phase"; import { MoveEndPhase } from "#app/phases/move-end-phase";
import { MoveId } from "#enums/move-id"; import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
import GameManager from "#test/testUtils/gameManager"; import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser"; import Phaser from "phaser";
@ -29,10 +28,10 @@ describe("Moves - Purify", () => {
.battleStyle("single") .battleStyle("single")
.starterSpecies(Species.PYUKUMUKU) .starterSpecies(Species.PYUKUMUKU)
.startingLevel(10) .startingLevel(10)
.moveset([Moves.PURIFY, Moves.SIZZLY_SLIDE]) .moveset([MoveId.PURIFY, MoveId.SIZZLY_SLIDE])
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyLevel(10) .enemyLevel(10)
.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]); .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

@ -27,10 +27,10 @@ describe("Moves - Quick Guard", () => {
game.override game.override
.battleStyle("double") .battleStyle("double")
.moveset([Moves.QUICK_GUARD, Moves.SPLASH, Moves.FOLLOW_ME]) .moveset([MoveId.QUICK_GUARD, MoveId.SPLASH, MoveId.FOLLOW_ME])
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyMoveset([Moves.QUICK_ATTACK]) .enemyMoveset([MoveId.QUICK_ATTACK])
.enemyAbility(Abilities.INSOMNIA) .enemyAbility(AbilityId.INSOMNIA)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100); .enemyLevel(100);
}); });
@ -49,7 +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(Abilities.PRANKSTER).enemyMoveset([Moves.GROWL]); game.override.enemyAbility(AbilityId.PRANKSTER).enemyMoveset([MoveId.GROWL]);
await game.classicMode.startBattle([SpeciesId.CHARIZARD, SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.CHARIZARD, SpeciesId.BLASTOISE]);
@ -81,7 +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").enemyMoveset([Moves.QUICK_GUARD]); game.override.battleStyle("single").enemyMoveset([MoveId.QUICK_GUARD]);
await game.classicMode.startBattle([SpeciesId.CHARIZARD]); await game.classicMode.startBattle([SpeciesId.CHARIZARD]);

View File

@ -27,8 +27,8 @@ describe("Moves - Rage Powder", () => {
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100) .enemyLevel(100)
.moveset([Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK]) .moveset([MoveId.FOLLOW_ME, MoveId.RAGE_POWDER, MoveId.SPOTLIGHT, MoveId.QUICK_ATTACK])
.enemyMoveset([Moves.RAGE_POWDER, Moves.TACKLE, Moves.SPLASH]); .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

@ -2,7 +2,6 @@ import { allMoves } from "#app/data/data-lists";
import { CommandPhase } from "#app/phases/command-phase"; import { CommandPhase } from "#app/phases/command-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, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
@ -27,17 +26,17 @@ describe("Moves - Rollout", () => {
.disableCrits() .disableCrits()
.battleStyle("single") .battleStyle("single")
.starterSpecies(Species.RATTATA) .starterSpecies(Species.RATTATA)
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.enemySpecies(Species.BIDOOF) .enemySpecies(Species.BIDOOF)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100) .enemyLevel(100)
.enemyMoveset(Moves.SPLASH); .enemyMoveset(MoveId.SPLASH);
}); });
it("should double its 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([Moves.ROLLOUT]); game.override.moveset([MoveId.ROLLOUT]);
vi.spyOn(allMoves[Moves.ROLLOUT], "accuracy", "get").mockReturnValue(100); //always hit vi.spyOn(allMoves[MoveId.ROLLOUT], "accuracy", "get").mockReturnValue(100); //always hit
const variance = 5; const variance = 5;
const turns = 6; const turns = 6;

View File

@ -30,8 +30,8 @@ describe("Moves - Roost", () => {
.enemySpecies(Species.RELICANTH) .enemySpecies(Species.RELICANTH)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100) .enemyLevel(100)
.enemyMoveset(Moves.EARTHQUAKE) .enemyMoveset(MoveId.EARTHQUAKE)
.moveset([Moves.ROOST, Moves.BURN_UP, Moves.DOUBLE_SHOCK]); .moveset([MoveId.ROOST, MoveId.BURN_UP, MoveId.DOUBLE_SHOCK]);
}); });
/** /**

View File

@ -1,6 +1,5 @@
import { BattlerIndex } from "#app/battle"; import { BattlerIndex } from "#app/battle";
import { PostDefendContactApplyStatusEffectAbAttr } from "#app/data/abilities/ability"; import { PostDefendContactApplyStatusEffectAbAttr } from "#app/data/abilities/ability";
import { Abilities } from "#app/enums/abilities";
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";
@ -118,16 +117,16 @@ describe("Moves - Safeguard", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
enemyPokemon.hp = 1; enemyPokemon.hp = 1;
game.move.select(Moves.SPLASH); game.move.select(MoveId.SPLASH);
await game.move.forceEnemyMove(Moves.SAFEGUARD); await game.move.forceEnemyMove(MoveId.SAFEGUARD);
await game.toNextTurn(); await game.toNextTurn();
expect(enemyPokemon.status?.effect).toBe(StatusEffect.BURN); expect(enemyPokemon.status?.effect).toBe(StatusEffect.BURN);
enemyPokemon.resetStatus(); enemyPokemon.resetStatus();
game.move.select(Moves.SPLASH); game.move.select(MoveId.SPLASH);
await game.move.forceEnemyMove(Moves.REST); await game.move.forceEnemyMove(MoveId.REST);
await game.toNextTurn(); await game.toNextTurn();
expect(enemyPokemon.status?.effect).toBe(StatusEffect.SLEEP); expect(enemyPokemon.status?.effect).toBe(StatusEffect.SLEEP);
@ -137,19 +136,19 @@ describe("Moves - Safeguard", () => {
await game.classicMode.startBattle(); await game.classicMode.startBattle();
const player = game.field.getPlayerPokemon(); const player = game.field.getPlayerPokemon();
game.field.mockAbility(player, Abilities.STATIC); game.field.mockAbility(player, AbilityId.STATIC);
vi.spyOn( vi.spyOn(
player.getAbility().getAttrs(PostDefendContactApplyStatusEffectAbAttr)[0], player.getAbility().getAttrs(PostDefendContactApplyStatusEffectAbAttr)[0],
"chance", "chance",
"get", "get",
).mockReturnValue(100); ).mockReturnValue(100);
game.move.select(Moves.SPLASH); game.move.select(MoveId.SPLASH);
await game.move.forceEnemyMove(Moves.SAFEGUARD); await game.move.forceEnemyMove(MoveId.SAFEGUARD);
await game.toNextTurn(); await game.toNextTurn();
game.move.select(Moves.SPLASH); game.move.select(MoveId.SPLASH);
await game.move.forceEnemyMove(Moves.TACKLE); await game.move.forceEnemyMove(MoveId.TACKLE);
await game.toNextTurn(); await game.toNextTurn();
const enemyPokemon = game.field.getEnemyPokemon(); const enemyPokemon = game.field.getEnemyPokemon();

View File

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

View File

@ -35,11 +35,11 @@ describe("Moves - Spit Up", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.RATTATA) .enemySpecies(Species.RATTATA)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(MoveId.SPLASH)
.enemyAbility(Abilities.NONE) .enemyAbility(AbilityId.NONE)
.enemyLevel(2000) .enemyLevel(2000)
.moveset(Moves.SPIT_UP) .moveset(MoveId.SPIT_UP)
.ability(Abilities.NONE); .ability(AbilityId.NONE);
vi.spyOn(spitUp, "calculateBattlePower"); vi.spyOn(spitUp, "calculateBattlePower");
}); });

View File

@ -28,8 +28,8 @@ describe("Moves - Spotlight", () => {
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100) .enemyLevel(100)
.moveset([Moves.FOLLOW_ME, Moves.RAGE_POWDER, Moves.SPOTLIGHT, Moves.QUICK_ATTACK]) .moveset([MoveId.FOLLOW_ME, MoveId.RAGE_POWDER, MoveId.SPOTLIGHT, MoveId.QUICK_ATTACK])
.enemyMoveset([Moves.FOLLOW_ME, Moves.SPLASH]); .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

@ -30,11 +30,11 @@ describe("Moves - Stockpile", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.RATTATA) .enemySpecies(Species.RATTATA)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(MoveId.SPLASH)
.enemyAbility(Abilities.NONE) .enemyAbility(AbilityId.NONE)
.startingLevel(2000) .startingLevel(2000)
.moveset([Moves.STOCKPILE, Moves.SPLASH]) .moveset([MoveId.STOCKPILE, MoveId.SPLASH])
.ability(Abilities.NONE); .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,7 +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(Moves.TACKLE).enemyAbility(Abilities.INFILTRATOR); game.override.enemyMoveset(MoveId.TACKLE).enemyAbility(AbilityId.INFILTRATOR);
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -229,7 +229,7 @@ describe("Moves - Substitute", () => {
}); });
it("should protect the user from flinching", async () => { it("should protect the user from flinching", async () => {
game.override.enemyMoveset(Moves.FAKE_OUT).startingLevel(1); // Ensures the Substitute will break game.override.enemyMoveset(MoveId.FAKE_OUT).startingLevel(1); // Ensures the Substitute will break
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -296,8 +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(Moves.THIEF).startingHeldItems([{ name: "BERRY", type: BerryType.SITRUS }]); game.override.enemyMoveset(MoveId.THIEF).startingHeldItems([{ name: "BERRY", type: BerryType.SITRUS }]);
vi.spyOn(allMoves[Moves.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
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -313,7 +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([Moves.KNOCK_OFF]).enemyHeldItems([{ name: "BERRY", type: BerryType.SITRUS }]); game.override.moveset([MoveId.KNOCK_OFF]).enemyHeldItems([{ name: "BERRY", type: BerryType.SITRUS }]);
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -330,7 +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(Moves.BUG_BITE).startingHeldItems([{ name: "BERRY", type: BerryType.SITRUS }]); game.override.enemyMoveset(MoveId.BUG_BITE).startingHeldItems([{ name: "BERRY", type: BerryType.SITRUS }]);
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -407,7 +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(Moves.TACKLE).ability(Abilities.ROUGH_SKIN); game.override.enemyMoveset(MoveId.TACKLE).ability(AbilityId.ROUGH_SKIN);
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -421,7 +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(Moves.TACKLE).moveset([Moves.FOCUS_PUNCH]); game.override.enemyMoveset(MoveId.TACKLE).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);
@ -442,7 +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(Moves.TACKLE).moveset([Moves.SHELL_TRAP]); game.override.enemyMoveset(MoveId.TACKLE).moveset([MoveId.SHELL_TRAP]);
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -458,7 +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(Moves.TACKLE).moveset([Moves.BEAK_BLAST]); game.override.enemyMoveset(MoveId.TACKLE).moveset([MoveId.BEAK_BLAST]);
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
@ -475,7 +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(Moves.TACKLE).moveset([Moves.COUNTER]); game.override.enemyMoveset(MoveId.TACKLE).moveset([MoveId.COUNTER]);
await game.classicMode.startBattle([SpeciesId.BLASTOISE]); await game.classicMode.startBattle([SpeciesId.BLASTOISE]);

View File

@ -35,7 +35,7 @@ describe("Moves - Tackle", () => {
}); });
it("TACKLE against ghost", async () => { it("TACKLE against ghost", async () => {
const moveToUse = Moves.TACKLE; const moveToUse = MoveId.TACKLE;
game.override.enemySpecies(Species.GENGAR); game.override.enemySpecies(Species.GENGAR);
await game.classicMode.startBattle([Species.MIGHTYENA]); await game.classicMode.startBattle([Species.MIGHTYENA]);

View File

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

View File

@ -29,8 +29,8 @@ describe("Moves - Thousand Arrows", () => {
.enemySpecies(Species.TOGETIC) .enemySpecies(Species.TOGETIC)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100) .enemyLevel(100)
.moveset([Moves.THOUSAND_ARROWS]) .moveset([MoveId.THOUSAND_ARROWS])
.enemyMoveset(Moves.SPLASH); .enemyMoveset(MoveId.SPLASH);
}); });
it("move should hit and ground Flying-type targets", async () => { it("move should hit and ground Flying-type targets", async () => {
@ -51,7 +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(Species.SNORLAX).enemyAbility(Abilities.LEVITATE); game.override.enemySpecies(Species.SNORLAX).enemyAbility(AbilityId.LEVITATE);
await game.classicMode.startBattle([SpeciesId.ILLUMISE]); await game.classicMode.startBattle([SpeciesId.ILLUMISE]);

View File

@ -4,7 +4,6 @@ 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";
@ -29,11 +28,11 @@ describe("Moves - Tidy Up", () => {
game.override game.override
.battleStyle("single") .battleStyle("single")
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(Moves.SPLASH) .enemyMoveset(MoveId.SPLASH)
.starterSpecies(Species.FEEBAS) .starterSpecies(Species.FEEBAS)
.ability(Abilities.BALL_FETCH) .ability(AbilityId.BALL_FETCH)
.moveset([Moves.TIDY_UP]) .moveset([MoveId.TIDY_UP])
.startingLevel(50); .startingLevel(50);
}); });

View File

@ -75,7 +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(Moves.SWIFT).enemyMoveset(Moves.FLY); game.override.moveset(MoveId.SWIFT).enemyMoveset(MoveId.FLY);
await game.classicMode.startBattle([Species.TOXAPEX]); await game.classicMode.startBattle([Species.TOXAPEX]);
game.move.select(MoveId.SWIFT); game.move.select(MoveId.SWIFT);

View File

@ -154,7 +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([]).enemySpecies(Species.DARMANITAN); game.override.enemyMoveset([]).moveset([]).enemySpecies(SpeciesId.DARMANITAN);
await game.classicMode.startBattle([SpeciesId.DITTO]); await game.classicMode.startBattle([SpeciesId.DITTO]);

View File

@ -27,10 +27,10 @@ describe("Moves - Wide Guard", () => {
game.override game.override
.battleStyle("double") .battleStyle("double")
.moveset([Moves.WIDE_GUARD, Moves.SPLASH, Moves.SURF]) .moveset([MoveId.WIDE_GUARD, MoveId.SPLASH, MoveId.SURF])
.enemySpecies(Species.SNORLAX) .enemySpecies(Species.SNORLAX)
.enemyMoveset(Moves.SWIFT) .enemyMoveset(MoveId.SWIFT)
.enemyAbility(Abilities.INSOMNIA) .enemyAbility(AbilityId.INSOMNIA)
.startingLevel(100) .startingLevel(100)
.enemyLevel(100); .enemyLevel(100);
}); });

View File

@ -138,7 +138,7 @@ 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).toEqual([Moves.THRASH, Moves.CRUNCH, Moves.BODY_PRESS, Moves.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]);
expect(movePhases.length).toBe(1); expect(movePhases.length).toBe(1);

View File

@ -116,25 +116,31 @@ const POOL_3_POKEMON: { species: SpeciesId; formIndex?: number }[] = [
const POOL_4_POKEMON = [SpeciesId.GENESECT, SpeciesId.SLITHER_WING, SpeciesId.BUZZWOLE, SpeciesId.PHEROMOSA]; const POOL_4_POKEMON = [SpeciesId.GENESECT, SpeciesId.SLITHER_WING, SpeciesId.BUZZWOLE, SpeciesId.PHEROMOSA];
const PHYSICAL_TUTOR_MOVES = [Moves.MEGAHORN, Moves.ATTACK_ORDER, Moves.BUG_BITE, Moves.FIRST_IMPRESSION, Moves.LUNGE]; const PHYSICAL_TUTOR_MOVES = [
MoveId.MEGAHORN,
MoveId.ATTACK_ORDER,
MoveId.BUG_BITE,
MoveId.FIRST_IMPRESSION,
MoveId.LUNGE,
];
const SPECIAL_TUTOR_MOVES = [ const SPECIAL_TUTOR_MOVES = [
Moves.SILVER_WIND, MoveId.SILVER_WIND,
Moves.SIGNAL_BEAM, MoveId.SIGNAL_BEAM,
Moves.BUG_BUZZ, MoveId.BUG_BUZZ,
Moves.POLLEN_PUFF, MoveId.POLLEN_PUFF,
Moves.STRUGGLE_BUG, MoveId.STRUGGLE_BUG,
]; ];
const STATUS_TUTOR_MOVES = [ const STATUS_TUTOR_MOVES = [
Moves.STRING_SHOT, MoveId.STRING_SHOT,
Moves.DEFEND_ORDER, MoveId.DEFEND_ORDER,
Moves.RAGE_POWDER, MoveId.RAGE_POWDER,
Moves.STICKY_WEB, MoveId.STICKY_WEB,
Moves.SILK_TRAP, MoveId.SILK_TRAP,
]; ];
const MISC_TUTOR_MOVES = [Moves.LEECH_LIFE, Moves.U_TURN, Moves.HEAL_ORDER, Moves.QUIVER_DANCE, Moves.INFESTATION]; const MISC_TUTOR_MOVES = [MoveId.LEECH_LIFE, MoveId.U_TURN, MoveId.HEAL_ORDER, MoveId.QUIVER_DANCE, MoveId.INFESTATION];
describe("Bug-Type Superfan - Mystery Encounter", () => { describe("Bug-Type Superfan - Mystery Encounter", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;

View File

@ -38,7 +38,7 @@ describe("Field Trip - Mystery Encounter", () => {
.startingWave(defaultWave) .startingWave(defaultWave)
.startingBiome(defaultBiome) .startingBiome(defaultBiome)
.disableTrainerWaves() .disableTrainerWaves()
.moveset([Moves.TACKLE, Moves.UPROAR, Moves.SWORDS_DANCE]); .moveset([MoveId.TACKLE, MoveId.UPROAR, MoveId.SWORDS_DANCE]);
vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue( vi.spyOn(MysteryEncounters, "mysteryEncountersByBiome", "get").mockReturnValue(
new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.FIELD_TRIP]]]), new Map<BiomeId, MysteryEncounterType[]>([[BiomeId.CAVE, [MysteryEncounterType.FIELD_TRIP]]]),

View File

@ -68,7 +68,7 @@ describe("Lost at Sea - Mystery Encounter", () => {
}); });
it("should not spawn outside of sea biome", async () => { it("should not spawn outside of sea biome", async () => {
game.override.mysteryEncounterTier(MysteryEncounterTier.COMMON).startingBiome(Biome.MOUNTAIN); game.override.mysteryEncounterTier(MysteryEncounterTier.COMMON).startingBiome(BiomeId.MOUNTAIN);
await game.runToMysteryEncounter(); await game.runToMysteryEncounter();
expect(game.scene.currentBattle.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.LOST_AT_SEA); expect(game.scene.currentBattle.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.LOST_AT_SEA);

View File

@ -502,13 +502,13 @@ describe("UI - Pokedex", () => {
// Nab the pokemon that is selected for comparison later. // Nab the pokemon that is selected for comparison later.
// @ts-expect-error - `lastSpecies` is private // @ts-expect-error - `lastSpecies` is private
const selectedPokemon = pokedexHandler.lastSpecies.speciesId; const selectedPokemon = pokedexHandler.lastSpeciesId.speciesId;
for (let i = 0; i < 11; i++) { for (let i = 0; i < 11; i++) {
pokedexHandler.processInput(Button.DOWN); pokedexHandler.processInput(Button.DOWN);
} }
// @ts-expect-error `lastSpecies` is private // @ts-expect-error `lastSpecies` is private
expect(selectedPokemon).toEqual(pokedexHandler.lastSpecies.speciesId); expect(selectedPokemon).toEqual(pokedexHandler.lastSpeciesId.speciesId);
}, },
); );

View File

@ -579,7 +579,7 @@ describe("UI - Starter select", () => {
}); });
}); });
expect(starterSelectUiHandler?.starterSpecies.length).toBe(1); expect(starterSelectUiHandler?.starterSpeciesId.length).toBe(1);
expect(starterSelectUiHandler?.starterSpecies[0].generation).toBe(1); expect(starterSelectUiHandler?.starterSpecies[0].generation).toBe(1);
expect(starterSelectUiHandler?.starterSpecies[0].speciesId).toBe(32); expect(starterSelectUiHandler?.starterSpecies[0].speciesId).toBe(32);
expect(starterSelectUiHandler?.cursorObj.x).toBe(53); expect(starterSelectUiHandler?.cursorObj.x).toBe(53);

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