[Dev] Make `OPP_MOVESET_OVERRIDE` fully override the enemy's moveset (#4062)
* Make `OPP_MOVESET_OVERRIDE` fully override the enemy's moveset * Update tests with new override behavior * Fix tests * Fix another test * Move overrides no longer required to be arrays * Remove `SPLASH_ONLY` test utility variable * Update moveset override helper functions * Missed some tests
This commit is contained in:
parent
c59f6edf36
commit
11d912bad8
|
@ -984,10 +984,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
: this.moveset;
|
: this.moveset;
|
||||||
|
|
||||||
// Overrides moveset based on arrays specified in overrides.ts
|
// Overrides moveset based on arrays specified in overrides.ts
|
||||||
const overrideArray: Array<Moves> = this.isPlayer() ? Overrides.MOVESET_OVERRIDE : Overrides.OPP_MOVESET_OVERRIDE;
|
let overrideArray: Moves | Array<Moves> = this.isPlayer() ? Overrides.MOVESET_OVERRIDE : Overrides.OPP_MOVESET_OVERRIDE;
|
||||||
|
if (!Array.isArray(overrideArray)) {
|
||||||
|
overrideArray = [overrideArray];
|
||||||
|
}
|
||||||
if (overrideArray.length > 0) {
|
if (overrideArray.length > 0) {
|
||||||
|
if (!this.isPlayer()) {
|
||||||
|
this.moveset = [];
|
||||||
|
}
|
||||||
overrideArray.forEach((move: Moves, index: number) => {
|
overrideArray.forEach((move: Moves, index: number) => {
|
||||||
const ppUsed = this.moveset[index]?.ppUsed || 0;
|
const ppUsed = this.moveset[index]?.ppUsed ?? 0;
|
||||||
this.moveset[index] = new PokemonMove(move, Math.min(ppUsed, allMoves[move].pp));
|
this.moveset[index] = new PokemonMove(move, Math.min(ppUsed, allMoves[move].pp));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ class DefaultOverrides {
|
||||||
readonly PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
|
readonly PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
|
||||||
readonly STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
|
readonly STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
|
||||||
readonly GENDER_OVERRIDE: Gender | null = null;
|
readonly GENDER_OVERRIDE: Gender | null = null;
|
||||||
readonly MOVESET_OVERRIDE: Array<Moves> = [];
|
readonly MOVESET_OVERRIDE: Moves | Array<Moves> = [];
|
||||||
readonly SHINY_OVERRIDE: boolean = false;
|
readonly SHINY_OVERRIDE: boolean = false;
|
||||||
readonly VARIANT_OVERRIDE: Variant = 0;
|
readonly VARIANT_OVERRIDE: Variant = 0;
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ class DefaultOverrides {
|
||||||
readonly OPP_PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
|
readonly OPP_PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
|
||||||
readonly OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
|
readonly OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
|
||||||
readonly OPP_GENDER_OVERRIDE: Gender | null = null;
|
readonly OPP_GENDER_OVERRIDE: Gender | null = null;
|
||||||
readonly OPP_MOVESET_OVERRIDE: Array<Moves> = [];
|
readonly OPP_MOVESET_OVERRIDE: Moves | Array<Moves> = [];
|
||||||
readonly OPP_SHINY_OVERRIDE: boolean = false;
|
readonly OPP_SHINY_OVERRIDE: boolean = false;
|
||||||
readonly OPP_VARIANT_OVERRIDE: Variant = 0;
|
readonly OPP_VARIANT_OVERRIDE: Variant = 0;
|
||||||
readonly OPP_IVS_OVERRIDE: number | number[] = [];
|
readonly OPP_IVS_OVERRIDE: number | number[] = [];
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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,7 +26,7 @@ describe("Abilities - Aura Break", () => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("single");
|
game.override.battleType("single");
|
||||||
game.override.moveset([Moves.MOONBLAST, Moves.DARK_PULSE, Moves.MOONBLAST, Moves.DARK_PULSE]);
|
game.override.moveset([Moves.MOONBLAST, Moves.DARK_PULSE, Moves.MOONBLAST, Moves.DARK_PULSE]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.enemyAbility(Abilities.AURA_BREAK);
|
game.override.enemyAbility(Abilities.AURA_BREAK);
|
||||||
game.override.enemySpecies(Species.SHUCKLE);
|
game.override.enemySpecies(Species.SHUCKLE);
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -31,7 +30,7 @@ describe("Abilities - Battery", () => {
|
||||||
game.override.enemySpecies(Species.SHUCKLE);
|
game.override.enemySpecies(Species.SHUCKLE);
|
||||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||||
game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
|
game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("raises the power of allies' special moves by 30%", async () => {
|
it("raises the power of allies' special moves by 30%", async () => {
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -31,7 +30,7 @@ describe("Abilities - Beast Boost", () => {
|
||||||
.ability(Abilities.BEAST_BOOST)
|
.ability(Abilities.BEAST_BOOST)
|
||||||
.startingLevel(2000)
|
.startingLevel(2000)
|
||||||
.moveset([ Moves.FLAMETHROWER ])
|
.moveset([ Moves.FLAMETHROWER ])
|
||||||
.enemyMoveset(SPLASH_ONLY);
|
.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should prefer highest stat to boost its corresponding stat stage by 1 when winning a battle", async() => {
|
it("should prefer highest stat to boost its corresponding stat stage by 1 when winning a battle", async() => {
|
||||||
|
@ -51,7 +50,7 @@ describe("Abilities - Beast Boost", () => {
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("should use in-battle overriden stats when determining the stat stage to raise by 1", async() => {
|
it("should use in-battle overriden stats when determining the stat stage to raise by 1", async() => {
|
||||||
game.override.enemyMoveset(new Array(4).fill(Moves.GUARD_SPLIT));
|
game.override.enemyMoveset([Moves.GUARD_SPLIT]);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.SLOWBRO]);
|
await game.classicMode.startBattle([Species.SLOWBRO]);
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { Stat } from "#enums/stat";
|
import { Moves } from "#app/enums/moves";
|
||||||
import GameManager from "#test/utils/gameManager";
|
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
|
import { Stat } from "#enums/stat";
|
||||||
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
describe("Abilities - Contrary", () => {
|
describe("Abilities - Contrary", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -27,7 +27,7 @@ describe("Abilities - Contrary", () => {
|
||||||
.enemySpecies(Species.BULBASAUR)
|
.enemySpecies(Species.BULBASAUR)
|
||||||
.enemyAbility(Abilities.CONTRARY)
|
.enemyAbility(Abilities.CONTRARY)
|
||||||
.ability(Abilities.INTIMIDATE)
|
.ability(Abilities.INTIMIDATE)
|
||||||
.enemyMoveset(SPLASH_ONLY);
|
.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should invert stat changes when applied", async() => {
|
it("should invert stat changes when applied", async() => {
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { Species } from "#app/enums/species";
|
||||||
import { CommandPhase } from "#app/phases/command-phase";
|
import { CommandPhase } from "#app/phases/command-phase";
|
||||||
import { MessagePhase } from "#app/phases/message-phase";
|
import { MessagePhase } from "#app/phases/message-phase";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ describe("Abilities - COSTAR", () => {
|
||||||
game.override.battleType("double");
|
game.override.battleType("double");
|
||||||
game.override.ability(Abilities.COSTAR);
|
game.override.ability(Abilities.COSTAR);
|
||||||
game.override.moveset([Moves.SPLASH, Moves.NASTY_PLOT]);
|
game.override.moveset([Moves.SPLASH, Moves.NASTY_PLOT]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ describe("Abilities - Dancer", () => {
|
||||||
.moveset([Moves.SWORDS_DANCE, Moves.SPLASH])
|
.moveset([Moves.SWORDS_DANCE, Moves.SPLASH])
|
||||||
.enemySpecies(Species.MAGIKARP)
|
.enemySpecies(Species.MAGIKARP)
|
||||||
.enemyAbility(Abilities.DANCER)
|
.enemyAbility(Abilities.DANCER)
|
||||||
.enemyMoveset(Array(4).fill(Moves.VICTORY_DANCE));
|
.enemyMoveset([Moves.VICTORY_DANCE]);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Reference Link: https://bulbapedia.bulbagarden.net/wiki/Dancer_(Ability)
|
// Reference Link: https://bulbapedia.bulbagarden.net/wiki/Dancer_(Ability)
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { StatusEffect } from "#app/data/status-effect";
|
||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
const TIMEOUT = 20 * 1000;
|
const TIMEOUT = 20 * 1000;
|
||||||
|
|
||||||
|
@ -31,7 +30,7 @@ describe("Abilities - Disguise", () => {
|
||||||
game.override
|
game.override
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
.enemySpecies(Species.MIMIKYU)
|
.enemySpecies(Species.MIMIKYU)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.starterSpecies(Species.REGIELEKI)
|
.starterSpecies(Species.REGIELEKI)
|
||||||
.moveset([Moves.SHADOW_SNEAK, Moves.VACUUM_WAVE, Moves.TOXIC_THREAD, Moves.SPLASH]);
|
.moveset([Moves.SHADOW_SNEAK, Moves.VACUUM_WAVE, Moves.TOXIC_THREAD, Moves.SPLASH]);
|
||||||
}, TIMEOUT);
|
}, TIMEOUT);
|
||||||
|
@ -108,7 +107,7 @@ describe("Abilities - Disguise", () => {
|
||||||
}, TIMEOUT);
|
}, TIMEOUT);
|
||||||
|
|
||||||
it("persists form change when switched out", async () => {
|
it("persists form change when switched out", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK));
|
game.override.enemyMoveset([Moves.SHADOW_SNEAK]);
|
||||||
game.override.starterSpecies(0);
|
game.override.starterSpecies(0);
|
||||||
|
|
||||||
await game.classicMode.startBattle([ Species.MIMIKYU, Species.FURRET ]);
|
await game.classicMode.startBattle([ Species.MIMIKYU, Species.FURRET ]);
|
||||||
|
@ -194,7 +193,7 @@ describe("Abilities - Disguise", () => {
|
||||||
}, TIMEOUT);
|
}, TIMEOUT);
|
||||||
|
|
||||||
it("doesn't faint twice when fainting due to Disguise break damage, nor prevent faint from Disguise break damage if using Endure", async () => {
|
it("doesn't faint twice when fainting due to Disguise break damage, nor prevent faint from Disguise break damage if using Endure", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.ENDURE));
|
game.override.enemyMoveset([Moves.ENDURE]);
|
||||||
await game.classicMode.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const mimikyu = game.scene.getEnemyPokemon()!;
|
const mimikyu = game.scene.getEnemyPokemon()!;
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
import { Species } from "#app/enums/species";
|
import { Species } from "#app/enums/species";
|
||||||
import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -23,63 +21,56 @@ describe("Abilities - Dry Skin", () => {
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("single");
|
game.override
|
||||||
game.override.disableCrits();
|
.battleType("single")
|
||||||
game.override.enemyAbility(Abilities.DRY_SKIN);
|
.disableCrits()
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
.enemyAbility(Abilities.DRY_SKIN)
|
||||||
game.override.enemySpecies(Species.CHARMANDER);
|
.enemyMoveset(Moves.SPLASH)
|
||||||
game.override.ability(Abilities.UNNERVE);
|
.enemySpecies(Species.CHARMANDER)
|
||||||
game.override.starterSpecies(Species.CHANDELURE);
|
.ability(Abilities.BALL_FETCH)
|
||||||
|
.moveset([Moves.SUNNY_DAY, Moves.RAIN_DANCE, Moves.SPLASH, Moves.WATER_GUN])
|
||||||
|
.starterSpecies(Species.CHANDELURE);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("during sunlight, lose 1/8 of maximum health at the end of each turn", async () => {
|
it("during sunlight, lose 1/8 of maximum health at the end of each turn", async () => {
|
||||||
game.override.moveset([Moves.SUNNY_DAY, Moves.SPLASH]);
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
await game.startBattle();
|
|
||||||
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
expect(enemy).not.toBe(undefined);
|
|
||||||
|
|
||||||
// first turn
|
// first turn
|
||||||
let previousEnemyHp = enemy.hp;
|
|
||||||
game.move.select(Moves.SUNNY_DAY);
|
game.move.select(Moves.SUNNY_DAY);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
expect(enemy.hp).toBeLessThan(previousEnemyHp);
|
expect(enemy.hp).toBeLessThan(enemy.getMaxHp());
|
||||||
|
|
||||||
// second turn
|
// second turn
|
||||||
previousEnemyHp = enemy.hp;
|
enemy.hp = enemy.getMaxHp();
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
expect(enemy.hp).toBeLessThan(previousEnemyHp);
|
expect(enemy.hp).toBeLessThan(enemy.getMaxHp());
|
||||||
});
|
});
|
||||||
|
|
||||||
it("during rain, gain 1/8 of maximum health at the end of each turn", async () => {
|
it("during rain, gain 1/8 of maximum health at the end of each turn", async () => {
|
||||||
game.override.moveset([Moves.RAIN_DANCE, Moves.SPLASH]);
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
await game.startBattle();
|
|
||||||
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
expect(enemy).not.toBe(undefined);
|
|
||||||
|
|
||||||
enemy.hp = 1;
|
enemy.hp = 1;
|
||||||
|
|
||||||
// first turn
|
// first turn
|
||||||
let previousEnemyHp = enemy.hp;
|
|
||||||
game.move.select(Moves.RAIN_DANCE);
|
game.move.select(Moves.RAIN_DANCE);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
expect(enemy.hp).toBeGreaterThan(previousEnemyHp);
|
expect(enemy.hp).toBeGreaterThan(1);
|
||||||
|
|
||||||
// second turn
|
// second turn
|
||||||
previousEnemyHp = enemy.hp;
|
enemy.hp = 1;
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
expect(enemy.hp).toBeGreaterThan(previousEnemyHp);
|
expect(enemy.hp).toBeGreaterThan(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("opposing fire attacks do 25% more damage", async () => {
|
it("opposing fire attacks do 25% more damage", async () => {
|
||||||
game.override.moveset([Moves.FLAMETHROWER]);
|
game.override.moveset([Moves.FLAMETHROWER]);
|
||||||
|
await game.classicMode.startBattle();
|
||||||
await game.startBattle();
|
|
||||||
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
const initialHP = 1000;
|
const initialHP = 1000;
|
||||||
|
@ -87,72 +78,65 @@ describe("Abilities - Dry Skin", () => {
|
||||||
|
|
||||||
// first turn
|
// first turn
|
||||||
game.move.select(Moves.FLAMETHROWER);
|
game.move.select(Moves.FLAMETHROWER);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
const fireDamageTakenWithDrySkin = initialHP - enemy.hp;
|
const fireDamageTakenWithDrySkin = initialHP - enemy.hp;
|
||||||
|
|
||||||
expect(enemy.hp > 0);
|
|
||||||
enemy.hp = initialHP;
|
enemy.hp = initialHP;
|
||||||
game.override.enemyAbility(Abilities.NONE);
|
game.override.enemyAbility(Abilities.NONE);
|
||||||
|
|
||||||
// second turn
|
// second turn
|
||||||
game.move.select(Moves.FLAMETHROWER);
|
game.move.select(Moves.FLAMETHROWER);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
const fireDamageTakenWithoutDrySkin = initialHP - enemy.hp;
|
const fireDamageTakenWithoutDrySkin = initialHP - enemy.hp;
|
||||||
|
|
||||||
expect(fireDamageTakenWithDrySkin).toBeGreaterThan(fireDamageTakenWithoutDrySkin);
|
expect(fireDamageTakenWithDrySkin).toBeGreaterThan(fireDamageTakenWithoutDrySkin);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("opposing water attacks heal 1/4 of maximum health and deal no damage", async () => {
|
it("opposing water attacks heal 1/4 of maximum health and deal no damage", async () => {
|
||||||
game.override.moveset([Moves.WATER_GUN]);
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
await game.startBattle();
|
|
||||||
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
expect(enemy).not.toBe(undefined);
|
|
||||||
|
|
||||||
enemy.hp = 1;
|
enemy.hp = 1;
|
||||||
|
|
||||||
game.move.select(Moves.WATER_GUN);
|
game.move.select(Moves.WATER_GUN);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
expect(enemy.hp).toBeGreaterThan(1);
|
expect(enemy.hp).toBeGreaterThan(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("opposing water attacks do not heal if they were protected from", async () => {
|
it("opposing water attacks do not heal if they were protected from", async () => {
|
||||||
game.override.moveset([Moves.WATER_GUN]);
|
game.override.enemyMoveset([Moves.PROTECT]);
|
||||||
|
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
expect(enemy).not.toBe(undefined);
|
|
||||||
|
|
||||||
enemy.hp = 1;
|
enemy.hp = 1;
|
||||||
game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]);
|
|
||||||
|
|
||||||
game.move.select(Moves.WATER_GUN);
|
game.move.select(Moves.WATER_GUN);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
expect(enemy.hp).toBe(1);
|
expect(enemy.hp).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("multi-strike water attacks only heal once", async () => {
|
it("multi-strike water attacks only heal once", async () => {
|
||||||
game.override.moveset([Moves.WATER_GUN, Moves.WATER_SHURIKEN]);
|
game.override.moveset([Moves.WATER_GUN, Moves.WATER_SHURIKEN]);
|
||||||
|
|
||||||
await game.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
expect(enemy).not.toBe(undefined);
|
|
||||||
|
|
||||||
enemy.hp = 1;
|
enemy.hp = 1;
|
||||||
|
|
||||||
// first turn
|
// first turn
|
||||||
game.move.select(Moves.WATER_SHURIKEN);
|
game.move.select(Moves.WATER_SHURIKEN);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
const healthGainedFromWaterShuriken = enemy.hp - 1;
|
const healthGainedFromWaterShuriken = enemy.hp - 1;
|
||||||
|
|
||||||
enemy.hp = 1;
|
enemy.hp = 1;
|
||||||
|
|
||||||
// second turn
|
// second turn
|
||||||
game.move.select(Moves.WATER_GUN);
|
game.move.select(Moves.WATER_GUN);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
const healthGainedFromWaterGun = enemy.hp - 1;
|
const healthGainedFromWaterGun = enemy.hp - 1;
|
||||||
|
|
||||||
expect(healthGainedFromWaterShuriken).toBe(healthGainedFromWaterGun);
|
expect(healthGainedFromWaterShuriken).toBe(healthGainedFromWaterGun);
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -38,7 +37,7 @@ describe("Abilities - Flash Fire", () => {
|
||||||
|
|
||||||
|
|
||||||
it("immune to Fire-type moves", async () => {
|
it("immune to Fire-type moves", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset(SPLASH_ONLY);
|
game.override.enemyMoveset([Moves.EMBER]).moveset(Moves.SPLASH);
|
||||||
await game.startBattle([Species.BLISSEY]);
|
await game.startBattle([Species.BLISSEY]);
|
||||||
|
|
||||||
const blissey = game.scene.getPlayerPokemon()!;
|
const blissey = game.scene.getPlayerPokemon()!;
|
||||||
|
@ -49,7 +48,7 @@ describe("Abilities - Flash Fire", () => {
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("not activate if the Pokémon is protected from the Fire-type move", async () => {
|
it("not activate if the Pokémon is protected from the Fire-type move", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset([Moves.PROTECT]);
|
game.override.enemyMoveset([Moves.EMBER]).moveset([Moves.PROTECT]);
|
||||||
await game.startBattle([Species.BLISSEY]);
|
await game.startBattle([Species.BLISSEY]);
|
||||||
|
|
||||||
const blissey = game.scene.getPlayerPokemon()!;
|
const blissey = game.scene.getPlayerPokemon()!;
|
||||||
|
@ -60,7 +59,7 @@ describe("Abilities - Flash Fire", () => {
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("activated by Will-O-Wisp", async () => {
|
it("activated by Will-O-Wisp", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.WILL_O_WISP)).moveset(SPLASH_ONLY);
|
game.override.enemyMoveset([Moves.WILL_O_WISP]).moveset(Moves.SPLASH);
|
||||||
await game.startBattle([Species.BLISSEY]);
|
await game.startBattle([Species.BLISSEY]);
|
||||||
|
|
||||||
const blissey = game.scene.getPlayerPokemon()!;
|
const blissey = game.scene.getPlayerPokemon()!;
|
||||||
|
@ -75,7 +74,7 @@ describe("Abilities - Flash Fire", () => {
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("activated after being frozen", async () => {
|
it("activated after being frozen", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset(SPLASH_ONLY);
|
game.override.enemyMoveset([Moves.EMBER]).moveset(Moves.SPLASH);
|
||||||
game.override.statusEffect(StatusEffect.FREEZE);
|
game.override.statusEffect(StatusEffect.FREEZE);
|
||||||
await game.startBattle([Species.BLISSEY]);
|
await game.startBattle([Species.BLISSEY]);
|
||||||
|
|
||||||
|
@ -88,7 +87,7 @@ describe("Abilities - Flash Fire", () => {
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("not passing with baton pass", async () => {
|
it("not passing with baton pass", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset([Moves.BATON_PASS]);
|
game.override.enemyMoveset([Moves.EMBER]).moveset([Moves.BATON_PASS]);
|
||||||
await game.startBattle([Species.BLISSEY, Species.CHANSEY]);
|
await game.startBattle([Species.BLISSEY, Species.CHANSEY]);
|
||||||
|
|
||||||
// ensure use baton pass after enemy moved
|
// ensure use baton pass after enemy moved
|
||||||
|
@ -104,7 +103,7 @@ describe("Abilities - Flash Fire", () => {
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("boosts Fire-type move when the ability is activated", async () => {
|
it("boosts Fire-type move when the ability is activated", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.FIRE_PLEDGE)).moveset([Moves.EMBER, Moves.SPLASH]);
|
game.override.enemyMoveset([Moves.FIRE_PLEDGE]).moveset([Moves.EMBER, Moves.SPLASH]);
|
||||||
game.override.enemyAbility(Abilities.FLASH_FIRE).ability(Abilities.NONE);
|
game.override.enemyAbility(Abilities.FLASH_FIRE).ability(Abilities.NONE);
|
||||||
await game.startBattle([Species.BLISSEY]);
|
await game.startBattle([Species.BLISSEY]);
|
||||||
const blissey = game.scene.getPlayerPokemon()!;
|
const blissey = game.scene.getPlayerPokemon()!;
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { WeatherType } from "#app/enums/weather-type";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -44,7 +43,7 @@ describe("Abilities - Flower Gift", () => {
|
||||||
game.override
|
game.override
|
||||||
.moveset([Moves.SPLASH, Moves.RAIN_DANCE, Moves.SUNNY_DAY, Moves.SKILL_SWAP])
|
.moveset([Moves.SPLASH, Moves.RAIN_DANCE, Moves.SUNNY_DAY, Moves.SKILL_SWAP])
|
||||||
.enemySpecies(Species.MAGIKARP)
|
.enemySpecies(Species.MAGIKARP)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemyAbility(Abilities.BALL_FETCH);
|
.enemyAbility(Abilities.BALL_FETCH);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -92,7 +91,7 @@ describe("Abilities - Flower Gift", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("reverts to Overcast Form when the Pokémon loses Flower Gift, changes form under Harsh Sunlight/Sunny when it regains it", async () => {
|
it("reverts to Overcast Form when the Pokémon loses Flower Gift, changes form under Harsh Sunlight/Sunny when it regains it", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.SKILL_SWAP)).weather(WeatherType.HARSH_SUN);
|
game.override.enemyMoveset([Moves.SKILL_SWAP]).weather(WeatherType.HARSH_SUN);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.CHERRIM]);
|
await game.classicMode.startBattle([Species.CHERRIM]);
|
||||||
|
|
||||||
|
@ -111,7 +110,7 @@ describe("Abilities - Flower Gift", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("reverts to Overcast Form when the Flower Gift is suppressed, changes form under Harsh Sunlight/Sunny when it regains it", async () => {
|
it("reverts to Overcast Form when the Flower Gift is suppressed, changes form under Harsh Sunlight/Sunny when it regains it", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.GASTRO_ACID)).weather(WeatherType.HARSH_SUN);
|
game.override.enemyMoveset([Moves.GASTRO_ACID]).weather(WeatherType.HARSH_SUN);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.CHERRIM, Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.CHERRIM, Species.MAGIKARP]);
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -67,7 +66,7 @@ describe("Abilities - Forecast", () => {
|
||||||
game.override
|
game.override
|
||||||
.moveset([Moves.SPLASH, Moves.RAIN_DANCE, Moves.SUNNY_DAY, Moves.TACKLE])
|
.moveset([Moves.SPLASH, Moves.RAIN_DANCE, Moves.SUNNY_DAY, Moves.TACKLE])
|
||||||
.enemySpecies(Species.MAGIKARP)
|
.enemySpecies(Species.MAGIKARP)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemyAbility(Abilities.BALL_FETCH);
|
.enemyAbility(Abilities.BALL_FETCH);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -229,7 +228,7 @@ describe("Abilities - Forecast", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("reverts to Normal Form when Forecast is suppressed, changes form to match the weather when it regains it", async () => {
|
it("reverts to Normal Form when Forecast is suppressed, changes form to match the weather when it regains it", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.GASTRO_ACID)).weather(WeatherType.RAIN);
|
game.override.enemyMoveset([Moves.GASTRO_ACID]).weather(WeatherType.RAIN);
|
||||||
await game.startBattle([Species.CASTFORM, Species.PIKACHU]);
|
await game.startBattle([Species.CASTFORM, Species.PIKACHU]);
|
||||||
const castform = game.scene.getPlayerPokemon()!;
|
const castform = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
|
@ -260,7 +259,7 @@ describe("Abilities - Forecast", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("does not change Castform's form until after Stealth Rock deals damage", async () => {
|
it("does not change Castform's form until after Stealth Rock deals damage", async () => {
|
||||||
game.override.weather(WeatherType.RAIN).enemyMoveset(Array(4).fill(Moves.STEALTH_ROCK));
|
game.override.weather(WeatherType.RAIN).enemyMoveset([Moves.STEALTH_ROCK]);
|
||||||
await game.startBattle([Species.PIKACHU, Species.CASTFORM]);
|
await game.startBattle([Species.PIKACHU, Species.CASTFORM]);
|
||||||
|
|
||||||
// First turn - set up stealth rock
|
// First turn - set up stealth rock
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { Moves } from "#app/enums/moves";
|
||||||
import { Species } from "#app/enums/species";
|
import { Species } from "#app/enums/species";
|
||||||
import { HitResult } from "#app/field/pokemon";
|
import { HitResult } from "#app/field/pokemon";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -36,7 +35,7 @@ describe("Abilities - Galvanize", () => {
|
||||||
.moveset([Moves.TACKLE, Moves.REVELATION_DANCE, Moves.FURY_SWIPES])
|
.moveset([Moves.TACKLE, Moves.REVELATION_DANCE, Moves.FURY_SWIPES])
|
||||||
.enemySpecies(Species.DUSCLOPS)
|
.enemySpecies(Species.DUSCLOPS)
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemyLevel(100);
|
.enemyLevel(100);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
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 { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
|
|
||||||
describe("Abilities - Gulp Missile", () => {
|
describe("Abilities - Gulp Missile", () => {
|
||||||
|
@ -49,7 +48,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||||
.moveset([Moves.SURF, Moves.DIVE, Moves.SPLASH])
|
.moveset([Moves.SURF, Moves.DIVE, Moves.SPLASH])
|
||||||
.enemySpecies(Species.SNORLAX)
|
.enemySpecies(Species.SNORLAX)
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemyLevel(5);
|
.enemyLevel(5);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -108,7 +107,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("deals 1/4 of the attacker's maximum HP when hit by a damaging attack", async () => {
|
it("deals 1/4 of the attacker's maximum HP when hit by a damaging attack", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
game.override.enemyMoveset([Moves.TACKLE]);
|
||||||
await game.startBattle([Species.CRAMORANT]);
|
await game.startBattle([Species.CRAMORANT]);
|
||||||
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
@ -121,7 +120,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("does not have any effect when hit by non-damaging attack", async () => {
|
it("does not have any effect when hit by non-damaging attack", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.TAIL_WHIP));
|
game.override.enemyMoveset([Moves.TAIL_WHIP]);
|
||||||
await game.startBattle([Species.CRAMORANT]);
|
await game.startBattle([Species.CRAMORANT]);
|
||||||
|
|
||||||
const cramorant = game.scene.getPlayerPokemon()!;
|
const cramorant = game.scene.getPlayerPokemon()!;
|
||||||
|
@ -140,7 +139,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("lowers attacker's DEF stat stage by 1 when hit in Gulping form", async () => {
|
it("lowers attacker's DEF stat stage by 1 when hit in Gulping form", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
game.override.enemyMoveset([Moves.TACKLE]);
|
||||||
await game.startBattle([Species.CRAMORANT]);
|
await game.startBattle([Species.CRAMORANT]);
|
||||||
|
|
||||||
const cramorant = game.scene.getPlayerPokemon()!;
|
const cramorant = game.scene.getPlayerPokemon()!;
|
||||||
|
@ -164,7 +163,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("paralyzes the enemy when hit in Gorging form", async () => {
|
it("paralyzes the enemy when hit in Gorging form", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
game.override.enemyMoveset([Moves.TACKLE]);
|
||||||
await game.startBattle([Species.CRAMORANT]);
|
await game.startBattle([Species.CRAMORANT]);
|
||||||
|
|
||||||
const cramorant = game.scene.getPlayerPokemon()!;
|
const cramorant = game.scene.getPlayerPokemon()!;
|
||||||
|
@ -188,7 +187,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("does not activate the ability when underwater", async () => {
|
it("does not activate the ability when underwater", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.SURF));
|
game.override.enemyMoveset([Moves.SURF]);
|
||||||
await game.startBattle([Species.CRAMORANT]);
|
await game.startBattle([Species.CRAMORANT]);
|
||||||
|
|
||||||
const cramorant = game.scene.getPlayerPokemon()!;
|
const cramorant = game.scene.getPlayerPokemon()!;
|
||||||
|
@ -201,7 +200,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("prevents effect damage but inflicts secondary effect on attacker with Magic Guard", async () => {
|
it("prevents effect damage but inflicts secondary effect on attacker with Magic Guard", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)).enemyAbility(Abilities.MAGIC_GUARD);
|
game.override.enemyMoveset([Moves.TACKLE]).enemyAbility(Abilities.MAGIC_GUARD);
|
||||||
await game.startBattle([Species.CRAMORANT]);
|
await game.startBattle([Species.CRAMORANT]);
|
||||||
|
|
||||||
const cramorant = game.scene.getPlayerPokemon()!;
|
const cramorant = game.scene.getPlayerPokemon()!;
|
||||||
|
@ -225,7 +224,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("cannot be suppressed", async () => {
|
it("cannot be suppressed", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.GASTRO_ACID));
|
game.override.enemyMoveset([Moves.GASTRO_ACID]);
|
||||||
await game.startBattle([Species.CRAMORANT]);
|
await game.startBattle([Species.CRAMORANT]);
|
||||||
|
|
||||||
const cramorant = game.scene.getPlayerPokemon()!;
|
const cramorant = game.scene.getPlayerPokemon()!;
|
||||||
|
@ -245,7 +244,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("cannot be swapped with another ability", async () => {
|
it("cannot be swapped with another ability", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.SKILL_SWAP));
|
game.override.enemyMoveset([Moves.SKILL_SWAP]);
|
||||||
await game.startBattle([Species.CRAMORANT]);
|
await game.startBattle([Species.CRAMORANT]);
|
||||||
|
|
||||||
const cramorant = game.scene.getPlayerPokemon()!;
|
const cramorant = game.scene.getPlayerPokemon()!;
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { toDmgValue } from "#app/utils";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ describe("Abilities - Heatproof", () => {
|
||||||
.disableCrits()
|
.disableCrits()
|
||||||
.enemySpecies(Species.CHARMANDER)
|
.enemySpecies(Species.CHARMANDER)
|
||||||
.enemyAbility(Abilities.HEATPROOF)
|
.enemyAbility(Abilities.HEATPROOF)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemyLevel(100)
|
.enemyLevel(100)
|
||||||
.starterSpecies(Species.CHANDELURE)
|
.starterSpecies(Species.CHANDELURE)
|
||||||
.ability(Abilities.BALL_FETCH)
|
.ability(Abilities.BALL_FETCH)
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Stat } from "#app/enums/stat";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -29,7 +28,7 @@ describe("Abilities - Hustle", () => {
|
||||||
.moveset([ Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE ])
|
.moveset([ Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE ])
|
||||||
.disableCrits()
|
.disableCrits()
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemySpecies(Species.SHUCKLE)
|
.enemySpecies(Species.SHUCKLE)
|
||||||
.enemyAbility(Abilities.BALL_FETCH);
|
.enemyAbility(Abilities.BALL_FETCH);
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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,7 +28,7 @@ describe("Abilities - Hyper Cutter", () => {
|
||||||
.ability(Abilities.BALL_FETCH)
|
.ability(Abilities.BALL_FETCH)
|
||||||
.enemySpecies(Species.SHUCKLE)
|
.enemySpecies(Species.SHUCKLE)
|
||||||
.enemyAbility(Abilities.HYPER_CUTTER)
|
.enemyAbility(Abilities.HYPER_CUTTER)
|
||||||
.enemyMoveset(SPLASH_ONLY);
|
.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Reference Link: https://bulbapedia.bulbagarden.net/wiki/Hyper_Cutter_(Ability)
|
// Reference Link: https://bulbapedia.bulbagarden.net/wiki/Hyper_Cutter_(Ability)
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Stat, BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat";
|
import { Stat, BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
// TODO: Add more tests once Imposter is fully implemented
|
// TODO: Add more tests once Imposter is fully implemented
|
||||||
describe("Abilities - Imposter", () => {
|
describe("Abilities - Imposter", () => {
|
||||||
|
@ -31,9 +30,9 @@ describe("Abilities - Imposter", () => {
|
||||||
.enemyLevel(200)
|
.enemyLevel(200)
|
||||||
.enemyAbility(Abilities.BEAST_BOOST)
|
.enemyAbility(Abilities.BEAST_BOOST)
|
||||||
.enemyPassiveAbility(Abilities.BALL_FETCH)
|
.enemyPassiveAbility(Abilities.BALL_FETCH)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.ability(Abilities.IMPOSTER)
|
.ability(Abilities.IMPOSTER)
|
||||||
.moveset(SPLASH_ONLY);
|
.moveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should copy species, ability, gender, all stats except HP, all stat stages, moveset, and types of target", async () => {
|
it("should copy species, ability, gender, all stats except HP, all stat stages, moveset, and types of target", async () => {
|
||||||
|
@ -77,7 +76,7 @@ describe("Abilities - Imposter", () => {
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("should copy in-battle overridden stats", async () => {
|
it("should copy in-battle overridden stats", async () => {
|
||||||
game.override.enemyMoveset(new Array(4).fill(Moves.POWER_SPLIT));
|
game.override.enemyMoveset([Moves.POWER_SPLIT]);
|
||||||
|
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
Species.DITTO
|
Species.DITTO
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
|
|
||||||
describe("Abilities - Intimidate", () => {
|
describe("Abilities - Intimidate", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -31,7 +30,7 @@ describe("Abilities - Intimidate", () => {
|
||||||
.enemyPassiveAbility(Abilities.HYDRATION)
|
.enemyPassiveAbility(Abilities.HYDRATION)
|
||||||
.ability(Abilities.INTIMIDATE)
|
.ability(Abilities.INTIMIDATE)
|
||||||
.startingWave(3)
|
.startingWave(3)
|
||||||
.enemyMoveset(SPLASH_ONLY);
|
.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should lower ATK stat stage by 1 of enemy Pokemon on entry and player switch", async () => {
|
it("should lower ATK stat stage by 1 of enemy Pokemon on entry and player switch", async () => {
|
||||||
|
@ -108,7 +107,7 @@ describe("Abilities - Intimidate", () => {
|
||||||
|
|
||||||
it("should lower ATK stat stage by 1 for every switch", async () => {
|
it("should lower ATK stat stage by 1 for every switch", async () => {
|
||||||
game.override.moveset([Moves.SPLASH])
|
game.override.moveset([Moves.SPLASH])
|
||||||
.enemyMoveset(new Array(4).fill(Moves.VOLT_SWITCH))
|
.enemyMoveset([Moves.VOLT_SWITCH])
|
||||||
.startingWave(5);
|
.startingWave(5);
|
||||||
await game.classicMode.startBattle([ Species.MIGHTYENA, Species.POOCHYENA ]);
|
await game.classicMode.startBattle([ Species.MIGHTYENA, Species.POOCHYENA ]);
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ import { Biome } from "#enums/biome";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -183,7 +182,7 @@ describe("Abilities - Libero", () => {
|
||||||
"ability applies correctly even if the pokemon's move misses",
|
"ability applies correctly even if the pokemon's move misses",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.moveset([Moves.TACKLE]);
|
game.override.moveset([Moves.TACKLE]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -39,7 +38,7 @@ describe("Abilities - Magic Guard", () => {
|
||||||
/** Enemy Pokemon overrides */
|
/** Enemy Pokemon overrides */
|
||||||
game.override.enemySpecies(Species.SNORLAX);
|
game.override.enemySpecies(Species.SNORLAX);
|
||||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -29,8 +28,8 @@ describe("Abilities - Moody", () => {
|
||||||
.enemySpecies(Species.RATTATA)
|
.enemySpecies(Species.RATTATA)
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.ability(Abilities.MOODY)
|
.ability(Abilities.MOODY)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.moveset(SPLASH_ONLY);
|
.moveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should increase one stat stage by 2 and decrease a different stat stage by 1",
|
it("should increase one stat stage by 2 and decrease a different stat stage by 1",
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
import { BattlerIndex } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
import { EnemyCommandPhase } from "#app/phases/enemy-command-phase";
|
import { EnemyCommandPhase } from "#app/phases/enemy-command-phase";
|
||||||
import { VictoryPhase } from "#app/phases/victory-phase";
|
import { VictoryPhase } from "#app/phases/victory-phase";
|
||||||
|
@ -34,7 +33,7 @@ describe("Abilities - Moxie", () => {
|
||||||
game.override.ability(Abilities.MOXIE);
|
game.override.ability(Abilities.MOXIE);
|
||||||
game.override.startingLevel(2000);
|
game.override.startingLevel(2000);
|
||||||
game.override.moveset([ moveToUse ]);
|
game.override.moveset([ moveToUse ]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.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() => {
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -34,7 +33,7 @@ describe("Abilities - Parental Bond", () => {
|
||||||
game.override.ability(Abilities.PARENTAL_BOND);
|
game.override.ability(Abilities.PARENTAL_BOND);
|
||||||
game.override.enemySpecies(Species.SNORLAX);
|
game.override.enemySpecies(Species.SNORLAX);
|
||||||
game.override.enemyAbility(Abilities.FUR_COAT);
|
game.override.enemyAbility(Abilities.FUR_COAT);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.startingLevel(100);
|
game.override.startingLevel(100);
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
});
|
});
|
||||||
|
@ -175,7 +174,7 @@ describe("Abilities - Parental Bond", () => {
|
||||||
"should not apply multiplier to counter moves",
|
"should not apply multiplier to counter moves",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.moveset([Moves.COUNTER]);
|
game.override.moveset([Moves.COUNTER]);
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
game.override.enemyMoveset([Moves.TACKLE]);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.SHUCKLE]);
|
await game.classicMode.startBattle([Species.SHUCKLE]);
|
||||||
|
|
||||||
|
@ -465,7 +464,7 @@ describe("Abilities - Parental Bond", () => {
|
||||||
"should not cause user to hit into King's Shield more than once",
|
"should not cause user to hit into King's Shield more than once",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.moveset([Moves.TACKLE]);
|
game.override.moveset([Moves.TACKLE]);
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.KINGS_SHIELD));
|
game.override.enemyMoveset([Moves.KINGS_SHIELD]);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
describe("Abilities - Pastel Veil", () => {
|
describe("Abilities - Pastel Veil", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -31,7 +30,7 @@ describe("Abilities - Pastel Veil", () => {
|
||||||
.moveset([Moves.TOXIC_THREAD, Moves.SPLASH])
|
.moveset([Moves.TOXIC_THREAD, Moves.SPLASH])
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.enemySpecies(Species.SUNKERN)
|
.enemySpecies(Species.SUNKERN)
|
||||||
.enemyMoveset(SPLASH_ONLY);
|
.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("prevents the user and its allies from being afflicted by poison", async () => {
|
it("prevents the user and its allies from being afflicted by poison", async () => {
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -29,7 +28,7 @@ describe("Abilities - Power Spot", () => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("double");
|
game.override.battleType("double");
|
||||||
game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
|
game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.enemySpecies(Species.SHUCKLE);
|
game.override.enemySpecies(Species.SHUCKLE);
|
||||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||||
});
|
});
|
||||||
|
|
|
@ -9,7 +9,6 @@ import { Biome } from "#enums/biome";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -183,7 +182,7 @@ describe("Abilities - Protean", () => {
|
||||||
"ability applies correctly even if the pokemon's move misses",
|
"ability applies correctly even if the pokemon's move misses",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.moveset([Moves.TACKLE]);
|
game.override.moveset([Moves.TACKLE]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP]);
|
await game.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ describe("Abilities - Quick Draw", () => {
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
game.override.enemySpecies(Species.MAGIKARP);
|
game.override.enemySpecies(Species.MAGIKARP);
|
||||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
game.override.enemyMoveset([Moves.TACKLE]);
|
||||||
|
|
||||||
vi.spyOn(allAbilities[Abilities.QUICK_DRAW].getAttrs(BypassSpeedChanceAbAttr)[0], "chance", "get").mockReturnValue(100);
|
vi.spyOn(allAbilities[Abilities.QUICK_DRAW].getAttrs(BypassSpeedChanceAbAttr)[0], "chance", "get").mockReturnValue(100);
|
||||||
});
|
});
|
||||||
|
@ -76,7 +76,7 @@ describe("Abilities - Quick Draw", () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
test("does not increase priority", async () => {
|
test("does not increase priority", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.EXTREME_SPEED));
|
game.override.enemyMoveset([Moves.EXTREME_SPEED]);
|
||||||
|
|
||||||
await game.startBattle();
|
await game.startBattle();
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ describe("Abilities - Sand Spit", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should trigger when hit with damaging move", async () => {
|
it("should trigger when hit with damaging move", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
game.override.enemyMoveset([Moves.TACKLE]);
|
||||||
await game.startBattle();
|
await game.startBattle();
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
|
@ -45,7 +45,7 @@ describe("Abilities - Sand Spit", () => {
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("should not trigger when targetted with status moves", async () => {
|
it("should not trigger when targetted with status moves", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.GROWL));
|
game.override.enemyMoveset([Moves.GROWL]);
|
||||||
await game.startBattle();
|
await game.startBattle();
|
||||||
|
|
||||||
game.move.select(Moves.COIL);
|
game.move.select(Moves.COIL);
|
||||||
|
|
|
@ -9,7 +9,6 @@ import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
// See also: TypeImmunityAbAttr
|
// See also: TypeImmunityAbAttr
|
||||||
describe("Abilities - Sap Sipper", () => {
|
describe("Abilities - Sap Sipper", () => {
|
||||||
|
@ -37,7 +36,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||||
const enemyAbility = Abilities.SAP_SIPPER;
|
const enemyAbility = Abilities.SAP_SIPPER;
|
||||||
|
|
||||||
game.override.moveset([ moveToUse ]);
|
game.override.moveset([ moveToUse ]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.enemySpecies(Species.DUSKULL);
|
game.override.enemySpecies(Species.DUSKULL);
|
||||||
game.override.enemyAbility(enemyAbility);
|
game.override.enemyAbility(enemyAbility);
|
||||||
|
|
||||||
|
@ -59,7 +58,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||||
const enemyAbility = Abilities.SAP_SIPPER;
|
const enemyAbility = Abilities.SAP_SIPPER;
|
||||||
|
|
||||||
game.override.moveset([ moveToUse ]);
|
game.override.moveset([ moveToUse ]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.enemySpecies(Species.RATTATA);
|
game.override.enemySpecies(Species.RATTATA);
|
||||||
game.override.enemyAbility(enemyAbility);
|
game.override.enemyAbility(enemyAbility);
|
||||||
|
|
||||||
|
@ -80,7 +79,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||||
const enemyAbility = Abilities.SAP_SIPPER;
|
const enemyAbility = Abilities.SAP_SIPPER;
|
||||||
|
|
||||||
game.override.moveset([ moveToUse ]);
|
game.override.moveset([ moveToUse ]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.enemySpecies(Species.RATTATA);
|
game.override.enemySpecies(Species.RATTATA);
|
||||||
game.override.enemyAbility(enemyAbility);
|
game.override.enemyAbility(enemyAbility);
|
||||||
|
|
||||||
|
@ -100,7 +99,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||||
const enemyAbility = Abilities.SAP_SIPPER;
|
const enemyAbility = Abilities.SAP_SIPPER;
|
||||||
|
|
||||||
game.override.moveset([ moveToUse ]);
|
game.override.moveset([ moveToUse ]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.enemySpecies(Species.RATTATA);
|
game.override.enemySpecies(Species.RATTATA);
|
||||||
game.override.enemyAbility(enemyAbility);
|
game.override.enemyAbility(enemyAbility);
|
||||||
|
|
||||||
|
@ -123,7 +122,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||||
|
|
||||||
game.override.moveset([ moveToUse ]);
|
game.override.moveset([ moveToUse ]);
|
||||||
game.override.ability(ability);
|
game.override.ability(ability);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.enemySpecies(Species.RATTATA);
|
game.override.enemySpecies(Species.RATTATA);
|
||||||
game.override.enemyAbility(Abilities.NONE);
|
game.override.enemyAbility(Abilities.NONE);
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { Stat } from "#enums/stat";
|
import { Moves } from "#app/enums/moves";
|
||||||
import GameManager from "#test/utils/gameManager";
|
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
|
import { Stat } from "#enums/stat";
|
||||||
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
describe("Abilities - Simple", () => {
|
describe("Abilities - Simple", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -27,7 +27,7 @@ describe("Abilities - Simple", () => {
|
||||||
.enemySpecies(Species.BULBASAUR)
|
.enemySpecies(Species.BULBASAUR)
|
||||||
.enemyAbility(Abilities.SIMPLE)
|
.enemyAbility(Abilities.SIMPLE)
|
||||||
.ability(Abilities.INTIMIDATE)
|
.ability(Abilities.INTIMIDATE)
|
||||||
.enemyMoveset(SPLASH_ONLY);
|
.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should double stat changes when applied", async() => {
|
it("should double stat changes when applied", async() => {
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Abilities } from "#app/enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -31,7 +30,7 @@ describe("Abilities - Steely Spirit", () => {
|
||||||
game.override.enemySpecies(Species.SHUCKLE);
|
game.override.enemySpecies(Species.SHUCKLE);
|
||||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||||
game.override.moveset([Moves.IRON_HEAD, Moves.SPLASH]);
|
game.override.moveset([Moves.IRON_HEAD, Moves.SPLASH]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
vi.spyOn(allMoves[moveToCheck], "calculateBattlePower");
|
vi.spyOn(allMoves[moveToCheck], "calculateBattlePower");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -45,7 +44,7 @@ describe("Abilities - Sweet Veil", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("causes Rest to fail when used by the user or its allies", async () => {
|
it("causes Rest to fail when used by the user or its allies", async () => {
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
await game.startBattle([Species.SWIRLIX, Species.MAGIKARP]);
|
await game.startBattle([Species.SWIRLIX, Species.MAGIKARP]);
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
|
@ -72,7 +71,7 @@ describe("Abilities - Sweet Veil", () => {
|
||||||
game.override.enemySpecies(Species.PIKACHU);
|
game.override.enemySpecies(Species.PIKACHU);
|
||||||
game.override.enemyLevel(5);
|
game.override.enemyLevel(5);
|
||||||
game.override.startingLevel(5);
|
game.override.startingLevel(5);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
|
|
||||||
await game.startBattle([Species.SHUCKLE, Species.SHUCKLE, Species.SWIRLIX]);
|
await game.startBattle([Species.SHUCKLE, Species.SHUCKLE, Species.SWIRLIX]);
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ describe("Abilities - Tera Shell", () => {
|
||||||
.moveset([Moves.SPLASH])
|
.moveset([Moves.SPLASH])
|
||||||
.enemySpecies(Species.SNORLAX)
|
.enemySpecies(Species.SNORLAX)
|
||||||
.enemyAbility(Abilities.INSOMNIA)
|
.enemyAbility(Abilities.INSOMNIA)
|
||||||
.enemyMoveset(Array(4).fill(Moves.MACH_PUNCH))
|
.enemyMoveset([Moves.MACH_PUNCH])
|
||||||
.startingLevel(100)
|
.startingLevel(100)
|
||||||
.enemyLevel(100);
|
.enemyLevel(100);
|
||||||
});
|
});
|
||||||
|
@ -60,7 +60,7 @@ describe("Abilities - Tera Shell", () => {
|
||||||
it(
|
it(
|
||||||
"should not override type immunities",
|
"should not override type immunities",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK));
|
game.override.enemyMoveset([Moves.SHADOW_SNEAK]);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.SNORLAX]);
|
await game.classicMode.startBattle([Species.SNORLAX]);
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ describe("Abilities - Tera Shell", () => {
|
||||||
it(
|
it(
|
||||||
"should not override type multipliers less than 0.5x",
|
"should not override type multipliers less than 0.5x",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.QUICK_ATTACK));
|
game.override.enemyMoveset([Moves.QUICK_ATTACK]);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.AGGRON]);
|
await game.classicMode.startBattle([Species.AGGRON]);
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ describe("Abilities - Tera Shell", () => {
|
||||||
it(
|
it(
|
||||||
"should not affect the effectiveness of fixed-damage moves",
|
"should not affect the effectiveness of fixed-damage moves",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.DRAGON_RAGE));
|
game.override.enemyMoveset([Moves.DRAGON_RAGE]);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.CHARIZARD]);
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -28,7 +27,7 @@ describe("Abilities - Wind Power", () => {
|
||||||
game.override.enemySpecies(Species.SHIFTRY);
|
game.override.enemySpecies(Species.SHIFTRY);
|
||||||
game.override.enemyAbility(Abilities.WIND_POWER);
|
game.override.enemyAbility(Abilities.WIND_POWER);
|
||||||
game.override.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]);
|
game.override.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("it becomes charged when hit by wind moves", async () => {
|
it("it becomes charged when hit by wind moves", async () => {
|
||||||
|
|
|
@ -3,7 +3,6 @@ import GameManager from "#test/utils/gameManager";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -28,7 +27,7 @@ describe("Abilities - Wind Rider", () => {
|
||||||
.enemySpecies(Species.SHIFTRY)
|
.enemySpecies(Species.SHIFTRY)
|
||||||
.enemyAbility(Abilities.WIND_RIDER)
|
.enemyAbility(Abilities.WIND_RIDER)
|
||||||
.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM])
|
.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM])
|
||||||
.enemyMoveset(SPLASH_ONLY);
|
.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("takes no damage from wind moves and its ATK stat stage is raised by 1 when hit by one", async () => {
|
it("takes no damage from wind moves and its ATK stat stage is raised by 1 when hit by one", async () => {
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ describe("Abilities - Wonder Skin", () => {
|
||||||
game.override.ability(Abilities.BALL_FETCH);
|
game.override.ability(Abilities.BALL_FETCH);
|
||||||
game.override.enemySpecies(Species.SHUCKLE);
|
game.override.enemySpecies(Species.SHUCKLE);
|
||||||
game.override.enemyAbility(Abilities.WONDER_SKIN);
|
game.override.enemyAbility(Abilities.WONDER_SKIN);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("lowers accuracy of status moves to 50%", async () => {
|
it("lowers accuracy of status moves to 50%", async () => {
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
const TIMEOUT = 20 * 1000;
|
const TIMEOUT = 20 * 1000;
|
||||||
|
|
||||||
|
@ -30,8 +29,8 @@ describe("Abilities - ZERO TO HERO", () => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override
|
game.override
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
.moveset(SPLASH_ONLY)
|
.moveset(Moves.SPLASH)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemyAbility(Abilities.BALL_FETCH);
|
.enemyAbility(Abilities.BALL_FETCH);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
describe("Arena - Gravity", () => {
|
describe("Arena - Gravity", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -32,7 +31,7 @@ describe("Arena - Gravity", () => {
|
||||||
.ability(Abilities.UNNERVE)
|
.ability(Abilities.UNNERVE)
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.enemySpecies(Species.SHUCKLE)
|
.enemySpecies(Species.SHUCKLE)
|
||||||
.enemyMoveset(SPLASH_ONLY);
|
.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Reference: https://bulbapedia.bulbagarden.net/wiki/Gravity_(move)
|
// Reference: https://bulbapedia.bulbagarden.net/wiki/Gravity_(move)
|
||||||
|
|
|
@ -31,7 +31,7 @@ describe("Weather - Fog", () => {
|
||||||
game.override.ability(Abilities.BALL_FETCH);
|
game.override.ability(Abilities.BALL_FETCH);
|
||||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||||
game.override.enemySpecies(Species.MAGIKARP);
|
game.override.enemySpecies(Species.MAGIKARP);
|
||||||
game.override.enemyMoveset(new Array(4).fill(Moves.SPLASH));
|
game.override.enemyMoveset([Moves.SPLASH]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("move accuracy is multiplied by 90%", async () => {
|
it("move accuracy is multiplied by 90%", async () => {
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
import { BattlerIndex } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
|
|
||||||
describe("Weather - Hail", () => {
|
describe("Weather - Hail", () => {
|
||||||
|
@ -26,8 +25,8 @@ describe("Weather - Hail", () => {
|
||||||
game.override
|
game.override
|
||||||
.weather(WeatherType.HAIL)
|
.weather(WeatherType.HAIL)
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
.moveset(SPLASH_ONLY)
|
.moveset(Moves.SPLASH)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemySpecies(Species.MAGIKARP);
|
.enemySpecies(Species.MAGIKARP);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
describe("Weather - Sandstorm", () => {
|
describe("Weather - Sandstorm", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -25,8 +24,8 @@ describe("Weather - Sandstorm", () => {
|
||||||
game.override
|
game.override
|
||||||
.weather(WeatherType.SANDSTORM)
|
.weather(WeatherType.SANDSTORM)
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
.moveset(SPLASH_ONLY)
|
.moveset(Moves.SPLASH)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemySpecies(Species.MAGIKARP);
|
.enemySpecies(Species.MAGIKARP);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ import { PlayerGender } from "#enums/player-gender";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
describe("Test Battle Phase", () => {
|
describe("Test Battle Phase", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -319,7 +318,7 @@ describe("Test Battle Phase", () => {
|
||||||
.startingWave(1)
|
.startingWave(1)
|
||||||
.startingLevel(100)
|
.startingLevel(100)
|
||||||
.moveset([moveToUse])
|
.moveset([moveToUse])
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.startingHeldItems([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ACC }]);
|
.startingHeldItems([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ACC }]);
|
||||||
|
|
||||||
await game.startBattle();
|
await game.startBattle();
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { ArenaTagType } from "#enums/arena-tag-type";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -31,7 +30,7 @@ describe("Round Down and Minimun 1 test in Damage Calculation", () => {
|
||||||
|
|
||||||
it("When the user fails to use Jump Kick with Wonder Guard ability, the damage should be 1.", async () => {
|
it("When the user fails to use Jump Kick with Wonder Guard ability, the damage should be 1.", async () => {
|
||||||
game.override.enemySpecies(Species.GASTLY);
|
game.override.enemySpecies(Species.GASTLY);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.starterSpecies(Species.SHEDINJA);
|
game.override.starterSpecies(Species.SHEDINJA);
|
||||||
game.override.moveset([Moves.JUMP_KICK]);
|
game.override.moveset([Moves.JUMP_KICK]);
|
||||||
game.override.ability(Abilities.WONDER_GUARD);
|
game.override.ability(Abilities.WONDER_GUARD);
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { TurnInitPhase } from "#app/phases/turn-init-phase";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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,7 +28,7 @@ describe("Double Battles", () => {
|
||||||
// double-battle player's pokemon both fainted in same round, then revive one, and next double battle summons two player's pokemon successfully.
|
// double-battle player's pokemon both fainted in same round, then revive one, and next double battle summons two player's pokemon successfully.
|
||||||
// (There were bugs that either only summon one when can summon two, player stuck in switchPhase etc)
|
// (There were bugs that either only summon one when can summon two, player stuck in switchPhase etc)
|
||||||
it("3v2 edge case: player summons 2 pokemon on the next battle after being fainted and revived", async () => {
|
it("3v2 edge case: player summons 2 pokemon on the next battle after being fainted and revived", async () => {
|
||||||
game.override.battleType("double").enemyMoveset(SPLASH_ONLY).moveset(SPLASH_ONLY);
|
game.override.battleType("double").enemyMoveset(Moves.SPLASH).moveset(Moves.SPLASH);
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
Species.BULBASAUR,
|
Species.BULBASAUR,
|
||||||
Species.CHARIZARD,
|
Species.CHARIZARD,
|
||||||
|
|
|
@ -8,7 +8,6 @@ import { Species } from "#enums/species";
|
||||||
import { StatusEffect } from "#enums/status-effect";
|
import { StatusEffect } from "#enums/status-effect";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
const TIMEOUT = 20 * 1000;
|
const TIMEOUT = 20 * 1000;
|
||||||
|
@ -38,7 +37,7 @@ describe("Inverse Battle", () => {
|
||||||
.ability(Abilities.BALL_FETCH)
|
.ability(Abilities.BALL_FETCH)
|
||||||
.enemySpecies(Species.MAGIKARP)
|
.enemySpecies(Species.MAGIKARP)
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.enemyMoveset(SPLASH_ONLY);
|
.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Immune types are 2x effective - Thunderbolt against Ground Type", async () => {
|
it("Immune types are 2x effective - Thunderbolt against Ground Type", async () => {
|
||||||
|
|
|
@ -2,7 +2,6 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import GameManager from "./utils/gameManager";
|
import GameManager from "./utils/gameManager";
|
||||||
import { Species } from "#app/enums/species";
|
import { Species } from "#app/enums/species";
|
||||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||||
import { SPLASH_ONLY } from "./utils/testUtils";
|
|
||||||
import { Abilities } from "#app/enums/abilities";
|
import { Abilities } from "#app/enums/abilities";
|
||||||
import { Moves } from "#app/enums/moves";
|
import { Moves } from "#app/enums/moves";
|
||||||
import { EFFECTIVE_STATS } from "#app/enums/stat";
|
import { EFFECTIVE_STATS } from "#app/enums/stat";
|
||||||
|
@ -33,7 +32,7 @@ describe("Boss Pokemon / Shields", () => {
|
||||||
.disableTrainerWaves()
|
.disableTrainerWaves()
|
||||||
.disableCrits()
|
.disableCrits()
|
||||||
.enemySpecies(Species.RATTATA)
|
.enemySpecies(Species.RATTATA)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemyHeldItems([])
|
.enemyHeldItems([])
|
||||||
.startingLevel(1000)
|
.startingLevel(1000)
|
||||||
.moveset([Moves.FALSE_SWIPE, Moves.SUPER_FANG, Moves.SPLASH])
|
.moveset([Moves.FALSE_SWIPE, Moves.SUPER_FANG, Moves.SPLASH])
|
||||||
|
|
|
@ -6,7 +6,6 @@ import * as Utils from "#app/utils";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import { SPLASH_ONLY } from "./utils/testUtils";
|
|
||||||
|
|
||||||
describe("Evolution", () => {
|
describe("Evolution", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -99,7 +98,7 @@ describe("Evolution", () => {
|
||||||
it("should increase both HP and max HP when evolving", async () => {
|
it("should increase both HP and max HP when evolving", async () => {
|
||||||
game.override.moveset([Moves.SURF])
|
game.override.moveset([Moves.SURF])
|
||||||
.enemySpecies(Species.GOLEM)
|
.enemySpecies(Species.GOLEM)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.startingWave(21)
|
.startingWave(21)
|
||||||
.startingLevel(16)
|
.startingLevel(16)
|
||||||
.enemyLevel(50);
|
.enemyLevel(50);
|
||||||
|
@ -126,7 +125,7 @@ describe("Evolution", () => {
|
||||||
it("should not fully heal HP when evolving", async () => {
|
it("should not fully heal HP when evolving", async () => {
|
||||||
game.override.moveset([Moves.SURF])
|
game.override.moveset([Moves.SURF])
|
||||||
.enemySpecies(Species.GOLEM)
|
.enemySpecies(Species.GOLEM)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.startingWave(21)
|
.startingWave(21)
|
||||||
.startingLevel(13)
|
.startingLevel(13)
|
||||||
.enemyLevel(30);
|
.enemyLevel(30);
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { GameModes } from "#app/game-mode";
|
||||||
import { TurnHeldItemTransferModifier } from "#app/modifier/modifier";
|
import { TurnHeldItemTransferModifier } from "#app/modifier/modifier";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import GameManager from "./utils/gameManager";
|
import GameManager from "./utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "./utils/testUtils";
|
|
||||||
|
|
||||||
const FinalWave = {
|
const FinalWave = {
|
||||||
Classic: 200,
|
Classic: 200,
|
||||||
|
@ -29,7 +28,7 @@ describe("Final Boss", () => {
|
||||||
.startingWave(FinalWave.Classic)
|
.startingWave(FinalWave.Classic)
|
||||||
.startingBiome(Biome.END)
|
.startingBiome(Biome.END)
|
||||||
.disableCrits()
|
.disableCrits()
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.moveset([ Moves.SPLASH, Moves.WILL_O_WISP, Moves.DRAGON_PULSE ])
|
.moveset([ Moves.SPLASH, Moves.WILL_O_WISP, Moves.DRAGON_PULSE ])
|
||||||
.startingLevel(10000);
|
.startingLevel(10000);
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phase from "phaser";
|
import Phase from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
import { BattleEndPhase } from "#app/phases/battle-end-phase";
|
import { BattleEndPhase } from "#app/phases/battle-end-phase";
|
||||||
import { TempCritBoosterModifier } from "#app/modifier/modifier";
|
import { TempCritBoosterModifier } from "#app/modifier/modifier";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { Mode } from "#app/ui/ui";
|
||||||
|
@ -34,7 +33,7 @@ describe("Items - Dire Hit", () => {
|
||||||
|
|
||||||
game.override
|
game.override
|
||||||
.enemySpecies(Species.MAGIKARP)
|
.enemySpecies(Species.MAGIKARP)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.moveset([ Moves.POUND ])
|
.moveset([ Moves.POUND ])
|
||||||
.startingHeldItems([{ name: "DIRE_HIT" }])
|
.startingHeldItems([{ name: "DIRE_HIT" }])
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { DoubleBattleChanceBoosterModifier } from "#app/modifier/modifier";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
import { ShopCursorTarget } from "#app/enums/shop-cursor-target.js";
|
import { ShopCursorTarget } from "#app/enums/shop-cursor-target.js";
|
||||||
import { Mode } from "#app/ui/ui.js";
|
import { Mode } from "#app/ui/ui.js";
|
||||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler.js";
|
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler.js";
|
||||||
|
@ -64,7 +63,7 @@ describe("Items - Double Battle Chance Boosters", () => {
|
||||||
game.override
|
game.override
|
||||||
.startingModifier([{ name: "LURE" }])
|
.startingModifier([{ name: "LURE" }])
|
||||||
.itemRewards([{ name: "LURE" }])
|
.itemRewards([{ name: "LURE" }])
|
||||||
.moveset(SPLASH_ONLY)
|
.moveset(Moves.SPLASH)
|
||||||
.startingLevel(200);
|
.startingLevel(200);
|
||||||
|
|
||||||
await game.classicMode.startBattle([
|
await game.classicMode.startBattle([
|
||||||
|
|
|
@ -8,7 +8,6 @@ import { MoveEndPhase } from "#app/phases/move-end-phase";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phase from "phaser";
|
import Phase from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
const TIMEOUT = 20 * 1000; // 20 seconds
|
const TIMEOUT = 20 * 1000; // 20 seconds
|
||||||
|
|
||||||
|
@ -38,7 +37,7 @@ describe("Items - Grip Claw", () => {
|
||||||
])
|
])
|
||||||
.enemySpecies(Species.SNORLAX)
|
.enemySpecies(Species.SNORLAX)
|
||||||
.ability(Abilities.KLUTZ)
|
.ability(Abilities.KLUTZ)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemyHeldItems([
|
.enemyHeldItems([
|
||||||
{ name: "BERRY", type: BerryType.SITRUS, count: 2 },
|
{ name: "BERRY", type: BerryType.SITRUS, count: 2 },
|
||||||
{ name: "BERRY", type: BerryType.LUM, count: 2 },
|
{ name: "BERRY", type: BerryType.LUM, count: 2 },
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phase from "phaser";
|
import Phase from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
describe("Items - Scope Lens", () => {
|
describe("Items - Scope Lens", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -25,7 +24,7 @@ describe("Items - Scope Lens", () => {
|
||||||
|
|
||||||
game.override
|
game.override
|
||||||
.enemySpecies(Species.MAGIKARP)
|
.enemySpecies(Species.MAGIKARP)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.moveset([ Moves.POUND ])
|
.moveset([ Moves.POUND ])
|
||||||
.startingHeldItems([{ name: "SCOPE_LENS" }])
|
.startingHeldItems([{ name: "SCOPE_LENS" }])
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
|
|
|
@ -5,7 +5,6 @@ import Phase from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import { Moves } from "#app/enums/moves";
|
import { Moves } from "#app/enums/moves";
|
||||||
import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
import { Abilities } from "#app/enums/abilities";
|
import { Abilities } from "#app/enums/abilities";
|
||||||
import { TempStatStageBoosterModifier } from "#app/modifier/modifier";
|
import { TempStatStageBoosterModifier } from "#app/modifier/modifier";
|
||||||
import { Mode } from "#app/ui/ui";
|
import { Mode } from "#app/ui/ui";
|
||||||
|
@ -34,7 +33,7 @@ describe("Items - Temporary Stat Stage Boosters", () => {
|
||||||
game.override
|
game.override
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
.enemySpecies(Species.SHUCKLE)
|
.enemySpecies(Species.SHUCKLE)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.moveset([ Moves.TACKLE, Moves.SPLASH, Moves.HONE_CLAWS, Moves.BELLY_DRUM ])
|
.moveset([ Moves.TACKLE, Moves.SPLASH, Moves.HONE_CLAWS, Moves.BELLY_DRUM ])
|
||||||
.startingModifier([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ATK }]);
|
.startingModifier([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ATK }]);
|
||||||
|
|
|
@ -31,7 +31,7 @@ describe("Moves - Alluring Voice", () => {
|
||||||
.disableCrits()
|
.disableCrits()
|
||||||
.enemySpecies(Species.MAGIKARP)
|
.enemySpecies(Species.MAGIKARP)
|
||||||
.enemyAbility(Abilities.ICE_SCALES)
|
.enemyAbility(Abilities.ICE_SCALES)
|
||||||
.enemyMoveset(Array(4).fill(Moves.HOWL))
|
.enemyMoveset([Moves.HOWL])
|
||||||
.startingLevel(10)
|
.startingLevel(10)
|
||||||
.enemyLevel(10)
|
.enemyLevel(10)
|
||||||
.starterSpecies(Species.FEEBAS)
|
.starterSpecies(Species.FEEBAS)
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -31,7 +30,7 @@ describe("Moves - Baton Pass", () => {
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.moveset([Moves.BATON_PASS, Moves.NASTY_PLOT, Moves.SPLASH])
|
.moveset([Moves.BATON_PASS, Moves.NASTY_PLOT, Moves.SPLASH])
|
||||||
.ability(Abilities.BALL_FETCH)
|
.ability(Abilities.BALL_FETCH)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.disableCrits();
|
.disableCrits();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -71,7 +70,10 @@ describe("Moves - Baton Pass", () => {
|
||||||
|
|
||||||
// round 2 - baton pass
|
// round 2 - baton pass
|
||||||
game.scene.getEnemyPokemon()!.hp = 100;
|
game.scene.getEnemyPokemon()!.hp = 100;
|
||||||
game.override.enemyMoveset(new Array(4).fill(Moves.BATON_PASS));
|
game.override.enemyMoveset([Moves.BATON_PASS]);
|
||||||
|
// Force moveset to update mid-battle
|
||||||
|
// TODO: replace with enemy ai control function when it's added
|
||||||
|
game.scene.getEnemyParty()[0].getMoveset();
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
await game.phaseInterceptor.to("PostSummonPhase", false);
|
await game.phaseInterceptor.to("PostSummonPhase", false);
|
||||||
|
|
||||||
|
@ -90,7 +92,7 @@ describe("Moves - Baton Pass", () => {
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("doesn't transfer effects that aren't transferrable", async() => {
|
it("doesn't transfer effects that aren't transferrable", async() => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.SALT_CURE));
|
game.override.enemyMoveset([Moves.SALT_CURE]);
|
||||||
await game.classicMode.startBattle([Species.PIKACHU, Species.FEEBAS]);
|
await game.classicMode.startBattle([Species.PIKACHU, Species.FEEBAS]);
|
||||||
|
|
||||||
const [player1, player2] = game.scene.getParty();
|
const [player1, player2] = game.scene.getParty();
|
||||||
|
|
|
@ -34,7 +34,7 @@ describe("Moves - Beak Blast", () => {
|
||||||
.moveset([Moves.BEAK_BLAST])
|
.moveset([Moves.BEAK_BLAST])
|
||||||
.enemySpecies(Species.SNORLAX)
|
.enemySpecies(Species.SNORLAX)
|
||||||
.enemyAbility(Abilities.INSOMNIA)
|
.enemyAbility(Abilities.INSOMNIA)
|
||||||
.enemyMoveset(Array(4).fill(Moves.TACKLE))
|
.enemyMoveset([Moves.TACKLE])
|
||||||
.startingLevel(100)
|
.startingLevel(100)
|
||||||
.enemyLevel(100);
|
.enemyLevel(100);
|
||||||
});
|
});
|
||||||
|
@ -80,7 +80,7 @@ describe("Moves - Beak Blast", () => {
|
||||||
it(
|
it(
|
||||||
"should not burn attackers that don't make contact",
|
"should not burn attackers that don't make contact",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.WATER_GUN));
|
game.override.enemyMoveset([Moves.WATER_GUN]);
|
||||||
|
|
||||||
await game.startBattle([Species.BLASTOISE]);
|
await game.startBattle([Species.BLASTOISE]);
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ describe("Moves - Beak Blast", () => {
|
||||||
it(
|
it(
|
||||||
"should be blocked by Protect",
|
"should be blocked by Protect",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.PROTECT));
|
game.override.enemyMoveset([Moves.PROTECT]);
|
||||||
|
|
||||||
await game.startBattle([Species.BLASTOISE]);
|
await game.startBattle([Species.BLASTOISE]);
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ describe("Moves - Beat Up", () => {
|
||||||
|
|
||||||
game.override.enemySpecies(Species.SNORLAX);
|
game.override.enemySpecies(Species.SNORLAX);
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.SPLASH));
|
game.override.enemyMoveset([Moves.SPLASH]);
|
||||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||||
|
|
||||||
game.override.startingLevel(100);
|
game.override.startingLevel(100);
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { Stat } from "#enums/stat";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/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";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
import { Abilities } from "#app/enums/abilities";
|
import { Abilities } from "#app/enums/abilities";
|
||||||
|
|
||||||
const TIMEOUT = 20 * 1000;
|
const TIMEOUT = 20 * 1000;
|
||||||
|
@ -37,7 +36,7 @@ describe("Moves - BELLY DRUM", () => {
|
||||||
.startingLevel(100)
|
.startingLevel(100)
|
||||||
.enemyLevel(100)
|
.enemyLevel(100)
|
||||||
.moveset([Moves.BELLY_DRUM])
|
.moveset([Moves.BELLY_DRUM])
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemyAbility(Abilities.BALL_FETCH);
|
.enemyAbility(Abilities.BALL_FETCH);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
const TIMEOUT = 20 * 1000;
|
const TIMEOUT = 20 * 1000;
|
||||||
|
|
||||||
|
@ -32,7 +31,7 @@ describe("Moves - Burning Jealousy", () => {
|
||||||
.disableCrits()
|
.disableCrits()
|
||||||
.enemySpecies(Species.MAGIKARP)
|
.enemySpecies(Species.MAGIKARP)
|
||||||
.enemyAbility(Abilities.ICE_SCALES)
|
.enemyAbility(Abilities.ICE_SCALES)
|
||||||
.enemyMoveset(Array(4).fill(Moves.HOWL))
|
.enemyMoveset([Moves.HOWL])
|
||||||
.startingLevel(10)
|
.startingLevel(10)
|
||||||
.enemyLevel(10)
|
.enemyLevel(10)
|
||||||
.starterSpecies(Species.FEEBAS)
|
.starterSpecies(Species.FEEBAS)
|
||||||
|
@ -73,7 +72,7 @@ describe("Moves - Burning Jealousy", () => {
|
||||||
game.override
|
game.override
|
||||||
.enemySpecies(Species.DITTO)
|
.enemySpecies(Species.DITTO)
|
||||||
.enemyAbility(Abilities.IMPOSTER)
|
.enemyAbility(Abilities.IMPOSTER)
|
||||||
.enemyMoveset(SPLASH_ONLY);
|
.enemyMoveset(Moves.SPLASH);
|
||||||
await game.classicMode.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
@ -91,7 +90,7 @@ describe("Moves - Burning Jealousy", () => {
|
||||||
it("should be boosted by Sheer Force even if opponent didn't raise stat stages", async () => {
|
it("should be boosted by Sheer Force even if opponent didn't raise stat stages", async () => {
|
||||||
game.override
|
game.override
|
||||||
.ability(Abilities.SHEER_FORCE)
|
.ability(Abilities.SHEER_FORCE)
|
||||||
.enemyMoveset(SPLASH_ONLY);
|
.enemyMoveset(Moves.SPLASH);
|
||||||
vi.spyOn(allMoves[Moves.BURNING_JEALOUSY], "calculateBattlePower");
|
vi.spyOn(allMoves[Moves.BURNING_JEALOUSY], "calculateBattlePower");
|
||||||
await game.classicMode.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
|
|
||||||
const TIMEOUT = 20 * 1000;
|
const TIMEOUT = 20 * 1000;
|
||||||
/** HP Cost of Move */
|
/** HP Cost of Move */
|
||||||
|
@ -34,7 +33,7 @@ describe("Moves - Clangorous Soul", () => {
|
||||||
game.override.startingLevel(100);
|
game.override.startingLevel(100);
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
game.override.moveset([Moves.CLANGOROUS_SOUL]);
|
game.override.moveset([Moves.CLANGOROUS_SOUL]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Clangorous_Soul_(move)
|
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Clangorous_Soul_(move)
|
||||||
|
|
|
@ -33,7 +33,7 @@ describe("Moves - Crafty Shield", () => {
|
||||||
game.override.moveset([Moves.CRAFTY_SHIELD, Moves.SPLASH, Moves.SWORDS_DANCE]);
|
game.override.moveset([Moves.CRAFTY_SHIELD, Moves.SPLASH, Moves.SWORDS_DANCE]);
|
||||||
|
|
||||||
game.override.enemySpecies(Species.SNORLAX);
|
game.override.enemySpecies(Species.SNORLAX);
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.GROWL));
|
game.override.enemyMoveset([Moves.GROWL]);
|
||||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||||
|
|
||||||
game.override.startingLevel(100);
|
game.override.startingLevel(100);
|
||||||
|
@ -62,7 +62,7 @@ describe("Moves - Crafty Shield", () => {
|
||||||
test(
|
test(
|
||||||
"should not protect the user and allies from attack moves",
|
"should not protect the user and allies from attack moves",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
game.override.enemyMoveset([Moves.TACKLE]);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ describe("Moves - Crafty Shield", () => {
|
||||||
"should protect the user and allies from moves that ignore other protection",
|
"should protect the user and allies from moves that ignore other protection",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemySpecies(Species.DUSCLOPS);
|
game.override.enemySpecies(Species.DUSCLOPS);
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.CURSE));
|
game.override.enemyMoveset([Moves.CURSE]);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
describe("Moves - Disable", () => {
|
describe("Moves - Disable", () => {
|
||||||
|
@ -28,7 +27,7 @@ describe("Moves - Disable", () => {
|
||||||
.ability(Abilities.BALL_FETCH)
|
.ability(Abilities.BALL_FETCH)
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.moveset([Moves.DISABLE, Moves.SPLASH])
|
.moveset([Moves.DISABLE, Moves.SPLASH])
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.starterSpecies(Species.PIKACHU)
|
.starterSpecies(Species.PIKACHU)
|
||||||
.enemySpecies(Species.SHUCKLE);
|
.enemySpecies(Species.SHUCKLE);
|
||||||
});
|
});
|
||||||
|
@ -79,7 +78,7 @@ describe("Moves - Disable", () => {
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("cannot disable STRUGGLE", async() => {
|
it("cannot disable STRUGGLE", async() => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.STRUGGLE));
|
game.override.enemyMoveset([Moves.STRUGGLE]);
|
||||||
await game.classicMode.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const playerMon = game.scene.getPlayerPokemon()!;
|
const playerMon = game.scene.getPlayerPokemon()!;
|
||||||
|
@ -114,7 +113,7 @@ describe("Moves - Disable", () => {
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("disables NATURE POWER, not the move invoked by it", async() => {
|
it("disables NATURE POWER, not the move invoked by it", async() => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.NATURE_POWER));
|
game.override.enemyMoveset([Moves.NATURE_POWER]);
|
||||||
await game.classicMode.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemyMon = game.scene.getEnemyPokemon()!;
|
const enemyMon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Moves } from "#app/enums/moves";
|
||||||
import { Species } from "#app/enums/species";
|
import { Species } from "#app/enums/species";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -28,7 +27,7 @@ describe("Moves - Dragon Cheer", () => {
|
||||||
game.override
|
game.override
|
||||||
.battleType("double")
|
.battleType("double")
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemyLevel(20)
|
.enemyLevel(20)
|
||||||
.moveset([Moves.DRAGON_CHEER, Moves.TACKLE, Moves.SPLASH]);
|
.moveset([Moves.DRAGON_CHEER, Moves.TACKLE, Moves.SPLASH]);
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,7 +8,6 @@ import { Abilities } from "#enums/abilities";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -42,7 +41,7 @@ describe("Moves - Dragon Rage", () => {
|
||||||
game.override.startingLevel(100);
|
game.override.startingLevel(100);
|
||||||
|
|
||||||
game.override.enemySpecies(Species.SNORLAX);
|
game.override.enemySpecies(Species.SNORLAX);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||||
game.override.enemyPassiveAbility(Abilities.BALL_FETCH);
|
game.override.enemyPassiveAbility(Abilities.BALL_FETCH);
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
|
|
|
@ -9,7 +9,6 @@ import { Species } from "#enums/species";
|
||||||
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";
|
||||||
import GameManager from "../utils/gameManager";
|
import GameManager from "../utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
const TIMEOUT = 20 * 1000;
|
const TIMEOUT = 20 * 1000;
|
||||||
|
|
||||||
|
@ -32,7 +31,7 @@ describe("Moves - Dragon Tail", () => {
|
||||||
game.override.battleType("single")
|
game.override.battleType("single")
|
||||||
.moveset([Moves.DRAGON_TAIL, Moves.SPLASH])
|
.moveset([Moves.DRAGON_TAIL, Moves.SPLASH])
|
||||||
.enemySpecies(Species.WAILORD)
|
.enemySpecies(Species.WAILORD)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.startingLevel(5)
|
.startingLevel(5)
|
||||||
.enemyLevel(5);
|
.enemyLevel(5);
|
||||||
|
|
||||||
|
@ -82,7 +81,7 @@ describe("Moves - Dragon Tail", () => {
|
||||||
test(
|
test(
|
||||||
"Double battles should proceed without crashing",
|
"Double battles should proceed without crashing",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.battleType("double").enemyMoveset(SPLASH_ONLY);
|
game.override.battleType("double").enemyMoveset(Moves.SPLASH);
|
||||||
game.override.moveset([Moves.DRAGON_TAIL, Moves.SPLASH, Moves.FLAMETHROWER])
|
game.override.moveset([Moves.DRAGON_TAIL, Moves.SPLASH, Moves.FLAMETHROWER])
|
||||||
.enemyAbility(Abilities.ROUGH_SKIN);
|
.enemyAbility(Abilities.ROUGH_SKIN);
|
||||||
await game.startBattle([Species.DRATINI, Species.DRATINI, Species.WAILORD, Species.WAILORD]);
|
await game.startBattle([Species.DRATINI, Species.DRATINI, Species.WAILORD, Species.WAILORD]);
|
||||||
|
@ -116,7 +115,7 @@ describe("Moves - Dragon Tail", () => {
|
||||||
test(
|
test(
|
||||||
"Flee move redirection works",
|
"Flee move redirection works",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.battleType("double").enemyMoveset(SPLASH_ONLY);
|
game.override.battleType("double").enemyMoveset(Moves.SPLASH);
|
||||||
game.override.moveset([Moves.DRAGON_TAIL, Moves.SPLASH, Moves.FLAMETHROWER]);
|
game.override.moveset([Moves.DRAGON_TAIL, Moves.SPLASH, Moves.FLAMETHROWER]);
|
||||||
game.override.enemyAbility(Abilities.ROUGH_SKIN);
|
game.override.enemyAbility(Abilities.ROUGH_SKIN);
|
||||||
await game.startBattle([Species.DRATINI, Species.DRATINI, Species.WAILORD, Species.WAILORD]);
|
await game.startBattle([Species.DRATINI, Species.DRATINI, Species.WAILORD, Species.WAILORD]);
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
describe("Moves - Fake Out", () => {
|
describe("Moves - Fake Out", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -26,7 +25,7 @@ describe("Moves - Fake Out", () => {
|
||||||
.enemySpecies(Species.CORVIKNIGHT)
|
.enemySpecies(Species.CORVIKNIGHT)
|
||||||
.starterSpecies(Species.FEEBAS)
|
.starterSpecies(Species.FEEBAS)
|
||||||
.moveset([Moves.FAKE_OUT, Moves.SPLASH])
|
.moveset([Moves.FAKE_OUT, Moves.SPLASH])
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.disableCrits();
|
.disableCrits();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -35,7 +34,7 @@ describe("Moves - FILLET AWAY", () => {
|
||||||
game.override.startingLevel(100);
|
game.override.startingLevel(100);
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
game.override.moveset([Moves.FILLET_AWAY]);
|
game.override.moveset([Moves.FILLET_AWAY]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/fillet_away_(move)
|
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/fillet_away_(move)
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -38,7 +37,7 @@ describe("Moves - Fissure", () => {
|
||||||
game.override.startingLevel(100);
|
game.override.startingLevel(100);
|
||||||
|
|
||||||
game.override.enemySpecies(Species.SNORLAX);
|
game.override.enemySpecies(Species.SNORLAX);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.enemyPassiveAbility(Abilities.BALL_FETCH);
|
game.override.enemyPassiveAbility(Abilities.BALL_FETCH);
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ describe("Moves - Flame Burst", () => {
|
||||||
game.override.startingWave(4);
|
game.override.startingWave(4);
|
||||||
game.override.enemySpecies(Species.SHUCKLE);
|
game.override.enemySpecies(Species.SHUCKLE);
|
||||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||||
game.override.enemyMoveset(new Array(4).fill(Moves.SPLASH));
|
game.override.enemyMoveset([Moves.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 () => {
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -31,7 +30,7 @@ describe("Moves - Flower Shield", () => {
|
||||||
game.override.enemyAbility(Abilities.NONE);
|
game.override.enemyAbility(Abilities.NONE);
|
||||||
game.override.battleType("single");
|
game.override.battleType("single");
|
||||||
game.override.moveset([Moves.FLOWER_SHIELD, Moves.SPLASH]);
|
game.override.moveset([Moves.FLOWER_SHIELD, Moves.SPLASH]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.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 () => {
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -35,7 +34,7 @@ describe("Moves - Focus Punch", () => {
|
||||||
.moveset([Moves.FOCUS_PUNCH])
|
.moveset([Moves.FOCUS_PUNCH])
|
||||||
.enemySpecies(Species.GROUDON)
|
.enemySpecies(Species.GROUDON)
|
||||||
.enemyAbility(Abilities.INSOMNIA)
|
.enemyAbility(Abilities.INSOMNIA)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.startingLevel(100)
|
.startingLevel(100)
|
||||||
.enemyLevel(100);
|
.enemyLevel(100);
|
||||||
});
|
});
|
||||||
|
@ -68,7 +67,7 @@ describe("Moves - Focus Punch", () => {
|
||||||
it(
|
it(
|
||||||
"should fail if the user is hit",
|
"should fail if the user is hit",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
game.override.enemyMoveset([Moves.TACKLE]);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD]);
|
await game.startBattle([Species.CHARIZARD]);
|
||||||
|
|
||||||
|
@ -95,7 +94,7 @@ describe("Moves - Focus Punch", () => {
|
||||||
it(
|
it(
|
||||||
"should be cancelled if the user falls asleep mid-turn",
|
"should be cancelled if the user falls asleep mid-turn",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.SPORE));
|
game.override.enemyMoveset([Moves.SPORE]);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD]);
|
await game.startBattle([Species.CHARIZARD]);
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { MoveEffectPhase } from "#app/phases/move-effect-phase";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
describe("Moves - Foresight", () => {
|
describe("Moves - Foresight", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -25,7 +24,7 @@ describe("Moves - Foresight", () => {
|
||||||
game.override
|
game.override
|
||||||
.disableCrits()
|
.disableCrits()
|
||||||
.enemySpecies(Species.GASTLY)
|
.enemySpecies(Species.GASTLY)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemyLevel(5)
|
.enemyLevel(5)
|
||||||
.starterSpecies(Species.MAGIKARP)
|
.starterSpecies(Species.MAGIKARP)
|
||||||
.moveset([Moves.FORESIGHT, Moves.QUICK_ATTACK, Moves.MACH_PUNCH]);
|
.moveset([Moves.FORESIGHT, Moves.QUICK_ATTACK, Moves.MACH_PUNCH]);
|
||||||
|
@ -55,7 +54,7 @@ describe("Moves - Foresight", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should ignore target's evasiveness boosts", async () => {
|
it("should ignore target's evasiveness boosts", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.MINIMIZE));
|
game.override.enemyMoveset([Moves.MINIMIZE]);
|
||||||
await game.startBattle();
|
await game.startBattle();
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon()!;
|
const pokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { Abilities } from "#app/enums/abilities";
|
||||||
import { Moves } from "#app/enums/moves";
|
import { Moves } from "#app/enums/moves";
|
||||||
import { Species } from "#app/enums/species";
|
import { Species } from "#app/enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -28,7 +27,7 @@ describe("Moves - Freeze-Dry", () => {
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
.enemySpecies(Species.MAGIKARP)
|
.enemySpecies(Species.MAGIKARP)
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.starterSpecies(Species.FEEBAS)
|
.starterSpecies(Species.FEEBAS)
|
||||||
.ability(Abilities.BALL_FETCH)
|
.ability(Abilities.BALL_FETCH)
|
||||||
.moveset([Moves.FREEZE_DRY]);
|
.moveset([Moves.FREEZE_DRY]);
|
||||||
|
@ -92,7 +91,7 @@ describe("Moves - Freeze-Dry", () => {
|
||||||
|
|
||||||
// enable once Electrify is implemented (and the interaction is fixed, as above)
|
// enable once Electrify is implemented (and the interaction is fixed, as above)
|
||||||
it.todo("should deal 2x damage to water types under Electrify", async () => {
|
it.todo("should deal 2x damage to water types under Electrify", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.ELECTRIFY));
|
game.override.enemyMoveset([Moves.ELECTRIFY]);
|
||||||
await game.classicMode.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
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 { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
import { allMoves } from "#app/data/move";
|
import { allMoves } from "#app/data/move";
|
||||||
import { TurnInitPhase } from "#app/phases/turn-init-phase";
|
import { TurnInitPhase } from "#app/phases/turn-init-phase";
|
||||||
|
|
||||||
|
@ -28,7 +27,7 @@ describe("Moves - Freezy Frost", () => {
|
||||||
|
|
||||||
game.override.enemySpecies(Species.RATTATA);
|
game.override.enemySpecies(Species.RATTATA);
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.enemyAbility(Abilities.NONE);
|
game.override.enemyAbility(Abilities.NONE);
|
||||||
|
|
||||||
game.override.startingLevel(100);
|
game.override.startingLevel(100);
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Moves } from "#app/enums/moves";
|
||||||
import { Species } from "#app/enums/species";
|
import { Species } from "#app/enums/species";
|
||||||
import { MoveResult } from "#app/field/pokemon";
|
import { MoveResult } from "#app/field/pokemon";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
const TIMEOUT = 20 * 1000;
|
const TIMEOUT = 20 * 1000;
|
||||||
|
@ -31,7 +30,7 @@ describe("Moves - Gastro Acid", () => {
|
||||||
game.override.ability(Abilities.NONE);
|
game.override.ability(Abilities.NONE);
|
||||||
game.override.moveset([Moves.GASTRO_ACID, Moves.WATER_GUN, Moves.SPLASH, Moves.CORE_ENFORCER]);
|
game.override.moveset([Moves.GASTRO_ACID, Moves.WATER_GUN, Moves.SPLASH, Moves.CORE_ENFORCER]);
|
||||||
game.override.enemySpecies(Species.BIDOOF);
|
game.override.enemySpecies(Species.BIDOOF);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.enemyAbility(Abilities.WATER_ABSORB);
|
game.override.enemyAbility(Abilities.WATER_ABSORB);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
describe("Moves - Gigaton Hammer", () => {
|
describe("Moves - Gigaton Hammer", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -29,7 +28,7 @@ describe("Moves - Gigaton Hammer", () => {
|
||||||
.moveset([Moves.GIGATON_HAMMER])
|
.moveset([Moves.GIGATON_HAMMER])
|
||||||
.startingLevel(10)
|
.startingLevel(10)
|
||||||
.enemyLevel(100)
|
.enemyLevel(100)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.disableCrits();
|
.disableCrits();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ describe("Moves - Glaive Rush", () => {
|
||||||
.disableCrits()
|
.disableCrits()
|
||||||
.enemySpecies(Species.MAGIKARP)
|
.enemySpecies(Species.MAGIKARP)
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.enemyMoveset(Array(4).fill(Moves.GLAIVE_RUSH))
|
.enemyMoveset([Moves.GLAIVE_RUSH])
|
||||||
.starterSpecies(Species.KLINK)
|
.starterSpecies(Species.KLINK)
|
||||||
.ability(Abilities.BALL_FETCH)
|
.ability(Abilities.BALL_FETCH)
|
||||||
.moveset([Moves.SHADOW_SNEAK, Moves.AVALANCHE, Moves.SPLASH, Moves.GLAIVE_RUSH]);
|
.moveset([Moves.SHADOW_SNEAK, Moves.AVALANCHE, Moves.SPLASH, Moves.GLAIVE_RUSH]);
|
||||||
|
@ -67,7 +67,7 @@ describe("Moves - Glaive Rush", () => {
|
||||||
it("interacts properly with multi-lens", async () => {
|
it("interacts properly with multi-lens", async () => {
|
||||||
game.override
|
game.override
|
||||||
.startingHeldItems([{ name: "MULTI_LENS", count: 2 }])
|
.startingHeldItems([{ name: "MULTI_LENS", count: 2 }])
|
||||||
.enemyMoveset(Array(4).fill(Moves.AVALANCHE));
|
.enemyMoveset([Moves.AVALANCHE]);
|
||||||
await game.classicMode.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const player = game.scene.getPlayerPokemon()!;
|
const player = game.scene.getPlayerPokemon()!;
|
||||||
|
@ -88,7 +88,7 @@ describe("Moves - Glaive Rush", () => {
|
||||||
}, TIMEOUT);
|
}, TIMEOUT);
|
||||||
|
|
||||||
it("secondary effects only last until next move", async () => {
|
it("secondary effects only last until next move", async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK));
|
game.override.enemyMoveset([Moves.SHADOW_SNEAK]);
|
||||||
await game.classicMode.startBattle();
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
const player = game.scene.getPlayerPokemon()!;
|
const player = game.scene.getPlayerPokemon()!;
|
||||||
|
@ -115,7 +115,7 @@ describe("Moves - Glaive Rush", () => {
|
||||||
|
|
||||||
it("secondary effects are removed upon switching", async () => {
|
it("secondary effects are removed upon switching", async () => {
|
||||||
game.override
|
game.override
|
||||||
.enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK))
|
.enemyMoveset([Moves.SHADOW_SNEAK])
|
||||||
.starterSpecies(0);
|
.starterSpecies(0);
|
||||||
await game.classicMode.startBattle([Species.KLINK, Species.FEEBAS]);
|
await game.classicMode.startBattle([Species.KLINK, Species.FEEBAS]);
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ describe("Moves - Glaive Rush", () => {
|
||||||
|
|
||||||
game.move.select(Moves.SHADOW_SNEAK);
|
game.move.select(Moves.SHADOW_SNEAK);
|
||||||
await game.phaseInterceptor.to("TurnEndPhase");
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.SPLASH));
|
game.override.enemyMoveset([Moves.SPLASH]);
|
||||||
const damagedHP1 = 1000 - enemy.hp;
|
const damagedHP1 = 1000 - enemy.hp;
|
||||||
enemy.hp = 1000;
|
enemy.hp = 1000;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
import { EnemyCommandPhase } from "#app/phases/enemy-command-phase";
|
import { EnemyCommandPhase } from "#app/phases/enemy-command-phase";
|
||||||
import { TurnInitPhase } from "#app/phases/turn-init-phase";
|
import { TurnInitPhase } from "#app/phases/turn-init-phase";
|
||||||
|
|
||||||
|
@ -29,7 +28,7 @@ describe("Moves - Growth", () => {
|
||||||
game.override.enemyAbility(Abilities.MOXIE);
|
game.override.enemyAbility(Abilities.MOXIE);
|
||||||
game.override.ability(Abilities.INSOMNIA);
|
game.override.ability(Abilities.INSOMNIA);
|
||||||
game.override.moveset([ Moves.GROWTH ]);
|
game.override.moveset([ Moves.GROWTH ]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should raise SPATK stat stage by 1", async() => {
|
it("should raise SPATK stat stage by 1", async() => {
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
describe("Moves - Guard Split", () => {
|
describe("Moves - Guard Split", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -34,7 +33,7 @@ describe("Moves - Guard Split", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should average the user's DEF and SPDEF stats with those of the target", async () => {
|
it("should average the user's DEF and SPDEF stats with those of the target", async () => {
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
Species.INDEEDEE
|
Species.INDEEDEE
|
||||||
]);
|
]);
|
||||||
|
@ -56,7 +55,7 @@ describe("Moves - Guard Split", () => {
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("should be idempotent", async () => {
|
it("should be idempotent", async () => {
|
||||||
game.override.enemyMoveset(new Array(4).fill(Moves.GUARD_SPLIT));
|
game.override.enemyMoveset([Moves.GUARD_SPLIT]);
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
Species.INDEEDEE
|
Species.INDEEDEE
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -27,7 +27,7 @@ describe("Moves - Guard Swap", () => {
|
||||||
game.override
|
game.override
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.enemyMoveset(new Array(4).fill(Moves.SHELL_SMASH))
|
.enemyMoveset([Moves.SHELL_SMASH])
|
||||||
.enemySpecies(Species.MEW)
|
.enemySpecies(Species.MEW)
|
||||||
.enemyLevel(200)
|
.enemyLevel(200)
|
||||||
.moveset([ Moves.GUARD_SWAP ])
|
.moveset([ Moves.GUARD_SWAP ])
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ describe("Moves - Hard Press", () => {
|
||||||
game.override.ability(Abilities.BALL_FETCH);
|
game.override.ability(Abilities.BALL_FETCH);
|
||||||
game.override.enemySpecies(Species.MUNCHLAX);
|
game.override.enemySpecies(Species.MUNCHLAX);
|
||||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.moveset([Moves.HARD_PRESS]);
|
game.override.moveset([Moves.HARD_PRESS]);
|
||||||
vi.spyOn(moveToCheck, "calculateBattlePower");
|
vi.spyOn(moveToCheck, "calculateBattlePower");
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
import { TurnInitPhase } from "#app/phases/turn-init-phase";
|
import { TurnInitPhase } from "#app/phases/turn-init-phase";
|
||||||
|
|
||||||
describe("Moves - Haze", () => {
|
describe("Moves - Haze", () => {
|
||||||
|
@ -28,7 +27,7 @@ describe("Moves - Haze", () => {
|
||||||
|
|
||||||
game.override.enemySpecies(Species.RATTATA);
|
game.override.enemySpecies(Species.RATTATA);
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.enemyAbility(Abilities.NONE);
|
game.override.enemyAbility(Abilities.NONE);
|
||||||
|
|
||||||
game.override.startingLevel(100);
|
game.override.startingLevel(100);
|
||||||
|
|
|
@ -32,7 +32,7 @@ describe("Moves - Hyper Beam", () => {
|
||||||
game.override.ability(Abilities.BALL_FETCH);
|
game.override.ability(Abilities.BALL_FETCH);
|
||||||
game.override.enemySpecies(Species.SNORLAX);
|
game.override.enemySpecies(Species.SNORLAX);
|
||||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.SPLASH));
|
game.override.enemyMoveset([Moves.SPLASH]);
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
|
|
||||||
game.override.moveset([Moves.HYPER_BEAM, Moves.TACKLE]);
|
game.override.moveset([Moves.HYPER_BEAM, Moves.TACKLE]);
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { FaintPhase } from "#app/phases/faint-phase";
|
||||||
import { MoveEffectPhase } from "#app/phases/move-effect-phase";
|
import { MoveEffectPhase } from "#app/phases/move-effect-phase";
|
||||||
import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||||
import GameManager from "#app/test/utils/gameManager";
|
import GameManager from "#app/test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#app/test/utils/testUtils";
|
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
|
@ -35,7 +34,7 @@ describe("Moves - Jaw Lock", () => {
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
.enemySpecies(Species.SNORLAX)
|
.enemySpecies(Species.SNORLAX)
|
||||||
.enemyAbility(Abilities.INSOMNIA)
|
.enemyAbility(Abilities.INSOMNIA)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.moveset([Moves.JAW_LOCK, Moves.SPLASH])
|
.moveset([Moves.JAW_LOCK, Moves.SPLASH])
|
||||||
.startingLevel(100)
|
.startingLevel(100)
|
||||||
.enemyLevel(100)
|
.enemyLevel(100)
|
||||||
|
@ -153,7 +152,7 @@ describe("Moves - Jaw Lock", () => {
|
||||||
it(
|
it(
|
||||||
"should not trap either pokemon if the target is protected",
|
"should not trap either pokemon if the target is protected",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.PROTECT));
|
game.override.enemyMoveset([Moves.PROTECT]);
|
||||||
|
|
||||||
await game.startBattle([Species.BULBASAUR]);
|
await game.startBattle([Species.BULBASAUR]);
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ describe("Moves - Lash Out", () => {
|
||||||
.disableCrits()
|
.disableCrits()
|
||||||
.enemySpecies(Species.MAGIKARP)
|
.enemySpecies(Species.MAGIKARP)
|
||||||
.enemyAbility(Abilities.FUR_COAT)
|
.enemyAbility(Abilities.FUR_COAT)
|
||||||
.enemyMoveset(Array(4).fill(Moves.GROWL))
|
.enemyMoveset([Moves.GROWL])
|
||||||
.startingLevel(10)
|
.startingLevel(10)
|
||||||
.enemyLevel(10)
|
.enemyLevel(10)
|
||||||
.starterSpecies(Species.FEEBAS)
|
.starterSpecies(Species.FEEBAS)
|
||||||
|
|
|
@ -31,7 +31,7 @@ describe("Moves - Lucky Chant", () => {
|
||||||
.moveset([Moves.LUCKY_CHANT, Moves.SPLASH, Moves.FOLLOW_ME])
|
.moveset([Moves.LUCKY_CHANT, Moves.SPLASH, Moves.FOLLOW_ME])
|
||||||
.enemySpecies(Species.SNORLAX)
|
.enemySpecies(Species.SNORLAX)
|
||||||
.enemyAbility(Abilities.INSOMNIA)
|
.enemyAbility(Abilities.INSOMNIA)
|
||||||
.enemyMoveset(Array(4).fill(Moves.FLOWER_TRICK))
|
.enemyMoveset([Moves.FLOWER_TRICK])
|
||||||
.startingLevel(100)
|
.startingLevel(100)
|
||||||
.enemyLevel(100);
|
.enemyLevel(100);
|
||||||
});
|
});
|
||||||
|
@ -87,7 +87,7 @@ describe("Moves - Lucky Chant", () => {
|
||||||
it(
|
it(
|
||||||
"should prevent critical hits from field effects",
|
"should prevent critical hits from field effects",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
game.override.enemyMoveset([Moves.TACKLE]);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD]);
|
await game.startBattle([Species.CHARIZARD]);
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -26,7 +25,7 @@ describe("Moves - Lunar Blessing", () => {
|
||||||
game.override.battleType("double");
|
game.override.battleType("double");
|
||||||
|
|
||||||
game.override.enemySpecies(Species.SHUCKLE);
|
game.override.enemySpecies(Species.SHUCKLE);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||||
|
|
||||||
game.override.moveset([Moves.LUNAR_BLESSING, Moves.SPLASH]);
|
game.override.moveset([Moves.LUNAR_BLESSING, Moves.SPLASH]);
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
import { MoveEndPhase } from "#app/phases/move-end-phase";
|
import { MoveEndPhase } from "#app/phases/move-end-phase";
|
||||||
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
||||||
|
|
||||||
|
@ -31,7 +30,7 @@ describe("Moves - Make It Rain", () => {
|
||||||
game.override.moveset([Moves.MAKE_IT_RAIN, Moves.SPLASH]);
|
game.override.moveset([Moves.MAKE_IT_RAIN, Moves.SPLASH]);
|
||||||
game.override.enemySpecies(Species.SNORLAX);
|
game.override.enemySpecies(Species.SNORLAX);
|
||||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.startingLevel(100);
|
game.override.startingLevel(100);
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
});
|
});
|
||||||
|
|
|
@ -33,7 +33,7 @@ describe("Moves - Mat Block", () => {
|
||||||
game.override.moveset([Moves.MAT_BLOCK, Moves.SPLASH]);
|
game.override.moveset([Moves.MAT_BLOCK, Moves.SPLASH]);
|
||||||
|
|
||||||
game.override.enemySpecies(Species.SNORLAX);
|
game.override.enemySpecies(Species.SNORLAX);
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
game.override.enemyMoveset([Moves.TACKLE]);
|
||||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||||
|
|
||||||
game.override.startingLevel(100);
|
game.override.startingLevel(100);
|
||||||
|
@ -62,7 +62,7 @@ describe("Moves - Mat Block", () => {
|
||||||
test(
|
test(
|
||||||
"should not protect the user and allies from status moves",
|
"should not protect the user and allies from status moves",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.GROWL));
|
game.override.enemyMoveset([Moves.GROWL]);
|
||||||
|
|
||||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { MoveEffectPhase } from "#app/phases/move-effect-phase";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
describe("Moves - Miracle Eye", () => {
|
describe("Moves - Miracle Eye", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -26,7 +25,7 @@ describe("Moves - Miracle Eye", () => {
|
||||||
game.override
|
game.override
|
||||||
.disableCrits()
|
.disableCrits()
|
||||||
.enemySpecies(Species.UMBREON)
|
.enemySpecies(Species.UMBREON)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemyLevel(5)
|
.enemyLevel(5)
|
||||||
.starterSpecies(Species.MAGIKARP)
|
.starterSpecies(Species.MAGIKARP)
|
||||||
.moveset([Moves.MIRACLE_EYE, Moves.CONFUSION]);
|
.moveset([Moves.MIRACLE_EYE, Moves.CONFUSION]);
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Species } from "#app/enums/species";
|
||||||
import * as Utils from "#app/utils";
|
import * as Utils from "#app/utils";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -32,7 +31,7 @@ describe("Multi-target damage reduction", () => {
|
||||||
.enemyLevel(100)
|
.enemyLevel(100)
|
||||||
.startingLevel(100)
|
.startingLevel(100)
|
||||||
.enemySpecies(Species.POLIWAG)
|
.enemySpecies(Species.POLIWAG)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.moveset([Moves.TACKLE, Moves.DAZZLING_GLEAM, Moves.EARTHQUAKE, Moves.SPLASH])
|
.moveset([Moves.TACKLE, Moves.DAZZLING_GLEAM, Moves.EARTHQUAKE, Moves.SPLASH])
|
||||||
.ability(Abilities.BALL_FETCH);
|
.ability(Abilities.BALL_FETCH);
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ describe("Moves - Octolock", () => {
|
||||||
|
|
||||||
game.override.battleType("single")
|
game.override.battleType("single")
|
||||||
.enemySpecies(Species.RATTATA)
|
.enemySpecies(Species.RATTATA)
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.startingLevel(2000)
|
.startingLevel(2000)
|
||||||
.moveset([ Moves.OCTOLOCK, Moves.SPLASH ])
|
.moveset([ Moves.OCTOLOCK, Moves.SPLASH ])
|
||||||
|
|
|
@ -9,7 +9,6 @@ import { BerryPhase } from "#app/phases/berry-phase";
|
||||||
import { FaintPhase } from "#app/phases/faint-phase";
|
import { FaintPhase } from "#app/phases/faint-phase";
|
||||||
import { MessagePhase } from "#app/phases/message-phase";
|
import { MessagePhase } from "#app/phases/message-phase";
|
||||||
import { TurnInitPhase } from "#app/phases/turn-init-phase";
|
import { TurnInitPhase } from "#app/phases/turn-init-phase";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
const TIMEOUT = 20 * 1000;
|
const TIMEOUT = 20 * 1000;
|
||||||
|
|
||||||
|
@ -31,7 +30,7 @@ describe("Moves - Parting Shot", () => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("single");
|
game.override.battleType("single");
|
||||||
game.override.moveset([Moves.PARTING_SHOT, Moves.SPLASH]);
|
game.override.moveset([Moves.PARTING_SHOT, Moves.SPLASH]);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
game.override.startingLevel(5);
|
game.override.startingLevel(5);
|
||||||
game.override.enemyLevel(5);
|
game.override.enemyLevel(5);
|
||||||
|
|
||||||
|
@ -125,7 +124,7 @@ describe("Moves - Parting Shot", () => {
|
||||||
game.override
|
game.override
|
||||||
.enemySpecies(Species.ALTARIA)
|
.enemySpecies(Species.ALTARIA)
|
||||||
.enemyAbility(Abilities.NONE)
|
.enemyAbility(Abilities.NONE)
|
||||||
.enemyMoveset(Array(4).fill(Moves.MIST));
|
.enemyMoveset([Moves.MIST]);
|
||||||
await game.startBattle([Species.SNORLAX, Species.MEOWTH]);
|
await game.startBattle([Species.SNORLAX, Species.MEOWTH]);
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
|
||||||
|
|
||||||
describe("Moves - Power Split", () => {
|
describe("Moves - Power Split", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -34,7 +33,7 @@ describe("Moves - Power Split", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should average the user's ATK and SPATK stats with those of the target", async () => {
|
it("should average the user's ATK and SPATK stats with those of the target", async () => {
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
Species.INDEEDEE
|
Species.INDEEDEE
|
||||||
]);
|
]);
|
||||||
|
@ -56,7 +55,7 @@ describe("Moves - Power Split", () => {
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("should be idempotent", async () => {
|
it("should be idempotent", async () => {
|
||||||
game.override.enemyMoveset(new Array(4).fill(Moves.POWER_SPLIT));
|
game.override.enemyMoveset([Moves.POWER_SPLIT]);
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
Species.INDEEDEE
|
Species.INDEEDEE
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -27,7 +27,7 @@ describe("Moves - Power Swap", () => {
|
||||||
game.override
|
game.override
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.enemyMoveset(new Array(4).fill(Moves.SHELL_SMASH))
|
.enemyMoveset([Moves.SHELL_SMASH])
|
||||||
.enemySpecies(Species.MEW)
|
.enemySpecies(Species.MEW)
|
||||||
.enemyLevel(200)
|
.enemyLevel(200)
|
||||||
.moveset([ Moves.POWER_SWAP ])
|
.moveset([ Moves.POWER_SWAP ])
|
||||||
|
|
|
@ -35,7 +35,7 @@ describe("Moves - Protect", () => {
|
||||||
game.override.enemySpecies(Species.SNORLAX);
|
game.override.enemySpecies(Species.SNORLAX);
|
||||||
|
|
||||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
game.override.enemyMoveset([Moves.TACKLE]);
|
||||||
|
|
||||||
game.override.startingLevel(100);
|
game.override.startingLevel(100);
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
|
@ -59,7 +59,7 @@ describe("Moves - Protect", () => {
|
||||||
test(
|
test(
|
||||||
"should prevent secondary effects from the opponent's attack",
|
"should prevent secondary effects from the opponent's attack",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.CEASELESS_EDGE));
|
game.override.enemyMoveset([Moves.CEASELESS_EDGE]);
|
||||||
vi.spyOn(allMoves[Moves.CEASELESS_EDGE], "accuracy", "get").mockReturnValue(100);
|
vi.spyOn(allMoves[Moves.CEASELESS_EDGE], "accuracy", "get").mockReturnValue(100);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.CHARIZARD]);
|
||||||
|
@ -78,7 +78,7 @@ describe("Moves - Protect", () => {
|
||||||
test(
|
test(
|
||||||
"should protect the user from status moves",
|
"should protect the user from status moves",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.CHARM));
|
game.override.enemyMoveset([Moves.CHARM]);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.CHARIZARD]);
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ describe("Moves - Protect", () => {
|
||||||
test(
|
test(
|
||||||
"should stop subsequent hits of a multi-hit move",
|
"should stop subsequent hits of a multi-hit move",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.TACHYON_CUTTER));
|
game.override.enemyMoveset([Moves.TACHYON_CUTTER]);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.CHARIZARD]);
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ describe("Moves - Protect", () => {
|
||||||
test(
|
test(
|
||||||
"should fail if the user is the last to move in the turn",
|
"should fail if the user is the last to move in the turn",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.PROTECT));
|
game.override.enemyMoveset([Moves.PROTECT]);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.CHARIZARD]);
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ describe("Moves - Quick Guard", () => {
|
||||||
game.override.moveset([Moves.QUICK_GUARD, Moves.SPLASH, Moves.FOLLOW_ME]);
|
game.override.moveset([Moves.QUICK_GUARD, Moves.SPLASH, Moves.FOLLOW_ME]);
|
||||||
|
|
||||||
game.override.enemySpecies(Species.SNORLAX);
|
game.override.enemySpecies(Species.SNORLAX);
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.QUICK_ATTACK));
|
game.override.enemyMoveset([Moves.QUICK_ATTACK]);
|
||||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||||
|
|
||||||
game.override.startingLevel(100);
|
game.override.startingLevel(100);
|
||||||
|
@ -59,7 +59,7 @@ describe("Moves - Quick Guard", () => {
|
||||||
"should protect the user and allies from Prankster-boosted moves",
|
"should protect the user and allies from Prankster-boosted moves",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyAbility(Abilities.PRANKSTER);
|
game.override.enemyAbility(Abilities.PRANKSTER);
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.GROWL));
|
game.override.enemyMoveset([Moves.GROWL]);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ describe("Moves - Quick Guard", () => {
|
||||||
test(
|
test(
|
||||||
"should stop subsequent hits of a multi-hit priority move",
|
"should stop subsequent hits of a multi-hit priority move",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.WATER_SHURIKEN));
|
game.override.enemyMoveset([Moves.WATER_SHURIKEN]);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
await game.classicMode.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ describe("Moves - Quick Guard", () => {
|
||||||
"should fail if the user is the last to move in the turn",
|
"should fail if the user is the last to move in the turn",
|
||||||
async () => {
|
async () => {
|
||||||
game.override.battleType("single");
|
game.override.battleType("single");
|
||||||
game.override.enemyMoveset(Array(4).fill(Moves.QUICK_GUARD));
|
game.override.enemyMoveset([Moves.QUICK_GUARD]);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.CHARIZARD]);
|
await game.classicMode.startBattle([Species.CHARIZARD]);
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
|
||||||
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";
|
||||||
|
|
||||||
|
@ -32,7 +31,7 @@ describe("Moves - Rollout", () => {
|
||||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||||
game.override.startingLevel(100);
|
game.override.startingLevel(100);
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should double it's dmg on sequential uses but reset after 5", async () => {
|
it("should double it's dmg on sequential uses but reset after 5", async () => {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue