Fixed test 0.5

This commit is contained in:
Bertie690 2025-06-17 16:55:55 -04:00
parent 79121a8d01
commit dc9d7a3e17
3 changed files with 28 additions and 29 deletions

View File

@ -75,23 +75,31 @@ describe("Abilities - Imposter", () => {
});
it("should copy in-battle overridden stats", async () => {
await game.classicMode.startBattle([SpeciesId.DITTO]);
game.override.ability(AbilityId.BALL_FETCH);
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.DITTO]);
const player = game.scene.getPlayerPokemon()!;
const enemy = game.scene.getEnemyPokemon()!;
const [karp, ditto] = game.scene.getPlayerField();
const enemy = game.field.getEnemyPokemon();
game.field.mockAbility(ditto, AbilityId.IMPOSTER);
const avgAtk = Math.floor((player.getStat(Stat.ATK, false) + enemy.getStat(Stat.ATK, false)) / 2);
const avgSpAtk = Math.floor((player.getStat(Stat.SPATK, false) + enemy.getStat(Stat.SPATK, false)) / 2);
// Turn 1: Use power split
const avgAtk = Math.floor((karp.getStat(Stat.ATK, false) + enemy.getStat(Stat.ATK, false)) / 2);
const avgSpAtk = Math.floor((karp.getStat(Stat.SPATK, false) + enemy.getStat(Stat.SPATK, false)) / 2);
game.move.use(MoveId.TACKLE);
game.move.use(MoveId.SPLASH);
await game.move.forceEnemyMove(MoveId.POWER_SPLIT);
await game.phaseInterceptor.to(TurnEndPhase);
await game.toNextTurn();
expect(player.getStat(Stat.ATK, false)).toBe(avgAtk);
expect(enemy.getStat(Stat.ATK, false)).toBe(avgAtk);
expect(player.getStat(Stat.SPATK, false)).toBe(avgSpAtk);
expect(enemy.getStat(Stat.SPATK, false)).toBe(avgSpAtk);
// Turn 2: Switch in ditto, should copy enemy ability
game.doSwitchPokemon(1);
await game.move.forceEnemyMove(MoveId.SPLASH);
await game.toNextTurn();
expect(ditto.getStat(Stat.ATK, false)).toBe(avgAtk);
expect(ditto.getStat(Stat.SPATK, false)).toBe(avgSpAtk);
});
it("should set each move's pp to a maximum of 5", async () => {

View File

@ -36,10 +36,8 @@ describe("Abilities - Lightningrod", () => {
it("should redirect electric type moves", async () => {
await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.MAGIKARP]);
const enemy1 = game.scene.getEnemyField()[0];
const enemy2 = game.scene.getEnemyField()[1];
enemy2.summonData.ability = AbilityId.LIGHTNING_ROD;
const [enemy1, enemy2] = game.scene.getEnemyField();
game.field.mockAbility(enemy2, AbilityId.LIGHTNING_ROD);
game.move.select(MoveId.SHOCK_WAVE, BattlerIndex.PLAYER, BattlerIndex.ENEMY);
game.move.select(MoveId.SPLASH, BattlerIndex.PLAYER_2);
@ -52,10 +50,8 @@ describe("Abilities - Lightningrod", () => {
game.override.moveset([MoveId.SPLASH, MoveId.AERIAL_ACE]);
await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.MAGIKARP]);
const enemy1 = game.scene.getEnemyField()[0];
const enemy2 = game.scene.getEnemyField()[1];
enemy2.summonData.ability = AbilityId.LIGHTNING_ROD;
const [enemy1, enemy2] = game.scene.getEnemyField();
game.field.mockAbility(enemy2, AbilityId.LIGHTNING_ROD);
game.move.select(MoveId.AERIAL_ACE, BattlerIndex.PLAYER, BattlerIndex.ENEMY);
game.move.select(MoveId.SPLASH, BattlerIndex.PLAYER_2);
@ -68,8 +64,7 @@ describe("Abilities - Lightningrod", () => {
await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.MAGIKARP]);
const enemy2 = game.scene.getEnemyField()[1];
enemy2.summonData.ability = AbilityId.LIGHTNING_ROD;
game.field.mockAbility(enemy2, AbilityId.LIGHTNING_ROD);
game.move.select(MoveId.SHOCK_WAVE, BattlerIndex.PLAYER, BattlerIndex.ENEMY);
game.move.select(MoveId.SPLASH, BattlerIndex.PLAYER_2);
@ -83,10 +78,8 @@ describe("Abilities - Lightningrod", () => {
game.override.ability(AbilityId.NORMALIZE);
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
const enemy1 = game.scene.getEnemyField()[0];
const enemy2 = game.scene.getEnemyField()[1];
enemy2.summonData.ability = AbilityId.LIGHTNING_ROD;
const [enemy1, enemy2] = game.scene.getEnemyField();
game.field.mockAbility(enemy2, AbilityId.LIGHTNING_ROD);
game.move.select(MoveId.SHOCK_WAVE, BattlerIndex.PLAYER, BattlerIndex.ENEMY);
await game.phaseInterceptor.to("BerryPhase");
@ -98,10 +91,8 @@ describe("Abilities - Lightningrod", () => {
game.override.ability(AbilityId.GALVANIZE);
await game.classicMode.startBattle([SpeciesId.FEEBAS, SpeciesId.MAGIKARP]);
const enemy1 = game.scene.getEnemyField()[0];
const enemy2 = game.scene.getEnemyField()[1];
enemy2.summonData.ability = AbilityId.LIGHTNING_ROD;
const [enemy1, enemy2] = game.scene.getEnemyField();
game.field.mockAbility(enemy2, AbilityId.LIGHTNING_ROD);
game.move.use(MoveId.TACKLE, BattlerIndex.PLAYER, BattlerIndex.ENEMY);
await game.phaseInterceptor.to("BerryPhase");

View File

@ -104,7 +104,7 @@ describe("Abilities - Storm Drain", () => {
enemy2.summonData.ability = AbilityId.STORM_DRAIN;
game.move.use(MoveId.HYPER_VOICE, BattlerIndex.PLAYER, BattlerIndex.ENEMY);
game.move.use(MoveId.HYPER_VOICE, BattlerIndex.PLAYER);
await game.phaseInterceptor.to("BerryPhase");
expect(enemy1.isFullHp()).toBe(true);