Fix Moody Test

This commit is contained in:
xsn34kzx 2024-09-01 20:32:19 -04:00
parent c0c8851a23
commit b3abd0d98e

View File

@ -1,4 +1,4 @@
import { BATTLE_STATS } from "#enums/stat";
import { BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
@ -28,7 +28,6 @@ describe("Abilities - Moody", () => {
.battleType("single")
.enemySpecies(Species.RATTATA)
.enemyAbility(Abilities.BALL_FETCH)
.enemyPassiveAbility(Abilities.HYDRATION)
.ability(Abilities.MOODY)
.enemyMoveset(SPLASH_ONLY)
.moveset(SPLASH_ONLY);
@ -36,14 +35,14 @@ describe("Abilities - Moody", () => {
it("should increase one stat stage by 2 and decrease a different stat stage by 1",
async () => {
await game.startBattle();
await game.classicMode.startBattle();
const playerPokemon = game.scene.getPlayerPokemon()!;
game.move.select(Moves.SPLASH);
await game.toNextTurn();
// Find the increased and decreased stats, make sure they are different.
const changedStats = BATTLE_STATS.filter(s => playerPokemon.getStatStage(s) === 2 || playerPokemon.getStatStage(s) === -1);
const changedStats = EFFECTIVE_STATS.filter(s => playerPokemon.getStatStage(s) === 2 || playerPokemon.getStatStage(s) === -1);
expect(changedStats).toBeTruthy();
expect(changedStats.length).toBe(2);
@ -52,7 +51,7 @@ describe("Abilities - Moody", () => {
it("should only increase one stat stage by 2 if all stat stages are at -6",
async () => {
await game.startBattle();
await game.classicMode.startBattle();
const playerPokemon = game.scene.getPlayerPokemon()!;
@ -62,8 +61,8 @@ describe("Abilities - Moody", () => {
game.move.select(Moves.SPLASH);
await game.toNextTurn();
// Should increase one BattleStat by 2 (from -6, meaning it will be -4)
const increasedStat = BATTLE_STATS.filter(s => playerPokemon.getStatStage(s) === -4);
// Should increase one stat stage by 2 (from -6, meaning it will be -4)
const increasedStat = EFFECTIVE_STATS.filter(s => playerPokemon.getStatStage(s) === -4);
expect(increasedStat).toBeTruthy();
expect(increasedStat.length).toBe(1);
@ -71,7 +70,7 @@ describe("Abilities - Moody", () => {
it("should only decrease one stat stage by 1 stage if all stat stages are at 6",
async () => {
await game.startBattle();
await game.classicMode.startBattle();
const playerPokemon = game.scene.getPlayerPokemon()!;
@ -81,8 +80,8 @@ describe("Abilities - Moody", () => {
game.move.select(Moves.SPLASH);
await game.toNextTurn();
// Should decrease one BattleStat by 1 (from 6, meaning it will be 5)
const decreasedStat = BATTLE_STATS.filter(s => playerPokemon.getStatStage(s) === 5);
// Should decrease one stat stage by 1 (from 6, meaning it will be 5)
const decreasedStat = EFFECTIVE_STATS.filter(s => playerPokemon.getStatStage(s) === 5);
expect(decreasedStat).toBeTruthy();
expect(decreasedStat.length).toBe(1);