apply game.override.ability
This commit is contained in:
parent
7732411c92
commit
c7a3ae24ac
|
@ -33,7 +33,7 @@ describe("Ability Timing", () => {
|
|||
game.override.enemyAbility(Abilities.INTIMIDATE);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.ICE_BEAM]);
|
||||
});
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ describe("Abilities - Aura Break", () => {
|
|||
const moveToCheck = allMoves[Moves.MOONBLAST];
|
||||
const basePower = moveToCheck.power;
|
||||
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.FAIRY_AURA);
|
||||
game.override.ability(Abilities.FAIRY_AURA);
|
||||
vi.spyOn(moveToCheck, "calculateBattlePower");
|
||||
|
||||
await game.startBattle([Species.PIKACHU]);
|
||||
|
@ -53,7 +53,7 @@ describe("Abilities - Aura Break", () => {
|
|||
const moveToCheck = allMoves[Moves.DARK_PULSE];
|
||||
const basePower = moveToCheck.power;
|
||||
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.DARK_AURA);
|
||||
game.override.ability(Abilities.DARK_AURA);
|
||||
vi.spyOn(moveToCheck, "calculateBattlePower");
|
||||
|
||||
await game.startBattle([Species.PIKACHU]);
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("Abilities - BATTLE BOND", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BATTLE_BOND);
|
||||
game.override.ability(Abilities.BATTLE_BOND);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
});
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("Abilities - COSTAR", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("double");
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.COSTAR);
|
||||
game.override.ability(Abilities.COSTAR);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.NASTY_PLOT]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
});
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("Abilities - DISGUISE", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.DISGUISE);
|
||||
game.override.ability(Abilities.DISGUISE);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
});
|
||||
|
|
|
@ -30,7 +30,7 @@ describe("Abilities - Dry Skin", () => {
|
|||
game.override.enemyAbility(Abilities.DRY_SKIN);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemySpecies(Species.CHARMANDER);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE);
|
||||
game.override.ability(Abilities.UNNERVE);
|
||||
game.override.starterSpecies(Species.CHANDELURE);
|
||||
});
|
||||
|
||||
|
|
|
@ -259,7 +259,7 @@ describe("Abilities - Ice Face", () => {
|
|||
});
|
||||
|
||||
it("cannot be copied", async () => {
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.TRACE);
|
||||
game.override.ability(Abilities.TRACE);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ describe("Abilities - Intimidate", () => {
|
|||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(Abilities.INTIMIDATE);
|
||||
vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTIMIDATE);
|
||||
game.override.ability(Abilities.INTIMIDATE);
|
||||
game.override.startingWave(3);
|
||||
game.override.enemyMoveset([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]);
|
||||
});
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
|
||||
import Phaser from "phaser";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import Overrides from "#app/overrides";
|
||||
import {Abilities} from "#enums/abilities";
|
||||
import {Species} from "#enums/species";
|
||||
import { BattleStat } from "#app/data/battle-stat";
|
||||
import {
|
||||
CommandPhase,
|
||||
} from "#app/phases";
|
||||
import {BattleStat} from "#app/data/battle-stat";
|
||||
import GameManager from "#app/test/utils/gameManager";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
|
||||
describe("Abilities - Intrepid Sword", () => {
|
||||
|
@ -29,7 +28,7 @@ describe("Abilities - Intrepid Sword", () => {
|
|||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.ZACIAN);
|
||||
game.override.enemyAbility(Abilities.INTREPID_SWORD);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTREPID_SWORD);
|
||||
game.override.ability(Abilities.INTREPID_SWORD);
|
||||
});
|
||||
|
||||
it("INTREPID SWORD on player", async() => {
|
||||
|
|
|
@ -34,7 +34,7 @@ describe("Abilities - Protean", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.LIBERO);
|
||||
game.override.ability(Abilities.LIBERO);
|
||||
game.override.startingLevel(100);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyMoveset([Moves.ENDURE, Moves.ENDURE, Moves.ENDURE, Moves.ENDURE]);
|
||||
|
|
|
@ -37,7 +37,7 @@ describe("Abilities - Moxie", () => {
|
|||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(Abilities.MOXIE);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.MOXIE);
|
||||
game.override.ability(Abilities.MOXIE);
|
||||
game.override.startingLevel(2000);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
|
|
|
@ -33,7 +33,7 @@ describe("Abilities - Parental Bond", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.PARENTAL_BOND);
|
||||
game.override.ability(Abilities.PARENTAL_BOND);
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("Abilities - POWER CONSTRUCT", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.POWER_CONSTRUCT);
|
||||
game.override.ability(Abilities.POWER_CONSTRUCT);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
});
|
||||
|
|
|
@ -34,7 +34,7 @@ describe("Abilities - Protean", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.PROTEAN);
|
||||
game.override.ability(Abilities.PROTEAN);
|
||||
game.override.startingLevel(100);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyMoveset([Moves.ENDURE, Moves.ENDURE, Moves.ENDURE, Moves.ENDURE]);
|
||||
|
|
|
@ -28,7 +28,7 @@ describe("Abilities - Quick Draw", () => {
|
|||
game.override.battleType("single");
|
||||
|
||||
game.override.starterSpecies(Species.MAGIKARP);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.QUICK_DRAW);
|
||||
game.override.ability(Abilities.QUICK_DRAW);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.TAIL_WHIP]);
|
||||
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
|
|
|
@ -120,7 +120,7 @@ describe("Abilities - Sap Sipper", () => {
|
|||
const ability = Abilities.SAP_SIPPER;
|
||||
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(ability);
|
||||
game.override.ability(ability);
|
||||
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(Abilities.NONE);
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("Abilities - SCHOOLING", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SCHOOLING);
|
||||
game.override.ability(Abilities.SCHOOLING);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
});
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("Abilities - Screen Cleaner", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SCREEN_CLEANER);
|
||||
game.override.ability(Abilities.SCREEN_CLEANER);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
});
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ describe("Abilities - Serene Grace", () => {
|
|||
|
||||
it("Move chance with Serene Grace", async() => {
|
||||
const moveToUse = Moves.AIR_SLASH;
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SERENE_GRACE);
|
||||
game.override.ability(Abilities.SERENE_GRACE);
|
||||
await game.startBattle([
|
||||
Species.TOGEKISS
|
||||
]);
|
||||
|
|
|
@ -43,7 +43,7 @@ describe("Abilities - Sheer Force", () => {
|
|||
|
||||
it("Sheer Force", async() => {
|
||||
const moveToUse = Moves.AIR_SLASH;
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SHEER_FORCE);
|
||||
game.override.ability(Abilities.SHEER_FORCE);
|
||||
await game.startBattle([
|
||||
Species.PIDGEOT
|
||||
]);
|
||||
|
@ -82,7 +82,7 @@ describe("Abilities - Sheer Force", () => {
|
|||
|
||||
it("Sheer Force with exceptions including binding moves", async() => {
|
||||
const moveToUse = Moves.BIND;
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SHEER_FORCE);
|
||||
game.override.ability(Abilities.SHEER_FORCE);
|
||||
await game.startBattle([
|
||||
Species.PIDGEOT
|
||||
]);
|
||||
|
@ -121,7 +121,7 @@ describe("Abilities - Sheer Force", () => {
|
|||
|
||||
it("Sheer Force with moves with no secondary effect", async() => {
|
||||
const moveToUse = Moves.TACKLE;
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SHEER_FORCE);
|
||||
game.override.ability(Abilities.SHEER_FORCE);
|
||||
await game.startBattle([
|
||||
Species.PIDGEOT
|
||||
]);
|
||||
|
@ -162,7 +162,7 @@ describe("Abilities - Sheer Force", () => {
|
|||
const moveToUse = Moves.CRUSH_CLAW;
|
||||
game.override.enemyAbility(Abilities.COLOR_CHANGE);
|
||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "KINGS_ROCK", count: 1}]);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SHEER_FORCE);
|
||||
game.override.ability(Abilities.SHEER_FORCE);
|
||||
await game.startBattle([
|
||||
Species.PIDGEOT
|
||||
]);
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("Abilities - SHIELDS DOWN", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.SHIELDS_DOWN);
|
||||
game.override.ability(Abilities.SHIELDS_DOWN);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
});
|
||||
|
|
|
@ -85,7 +85,7 @@ describe("Abilities - Sturdy", () => {
|
|||
test(
|
||||
"Sturdy is ignored by pokemon with `Abilities.MOLD_BREAKER`",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.MOLD_BREAKER);
|
||||
game.override.ability(Abilities.MOLD_BREAKER);
|
||||
|
||||
await game.startBattle();
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.CLOSE_COMBAT));
|
||||
|
|
|
@ -38,7 +38,7 @@ describe("Abilities - Volt Absorb", () => {
|
|||
const ability = Abilities.VOLT_ABSORB;
|
||||
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(ability);
|
||||
game.override.ability(ability);
|
||||
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
|
||||
game.override.enemySpecies(Species.DUSKULL);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
|
|
|
@ -48,7 +48,7 @@ describe("Abilities - Wind Power", () => {
|
|||
});
|
||||
|
||||
it("it becomes charged when Tailwind takes effect on its side", async () => {
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.WIND_POWER);
|
||||
game.override.ability(Abilities.WIND_POWER);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
|
||||
await game.startBattle([Species.SHIFTRY]);
|
||||
|
@ -64,7 +64,7 @@ describe("Abilities - Wind Power", () => {
|
|||
|
||||
it("does not become charged when Tailwind takes effect on opposing side", async () => {
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.WIND_POWER);
|
||||
game.override.ability(Abilities.WIND_POWER);
|
||||
|
||||
await game.startBattle([Species.SHIFTRY]);
|
||||
const magikarp = game.scene.getEnemyPokemon();
|
||||
|
|
|
@ -50,7 +50,7 @@ describe("Abilities - Wind Rider", () => {
|
|||
});
|
||||
|
||||
it("Attack is increased by one stage when Tailwind is present on its side", async () => {
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.WIND_RIDER);
|
||||
game.override.ability(Abilities.WIND_RIDER);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
|
||||
await game.startBattle([Species.SHIFTRY]);
|
||||
|
@ -66,7 +66,7 @@ describe("Abilities - Wind Rider", () => {
|
|||
});
|
||||
|
||||
it("does not increase Attack when Tailwind is present on opposing side", async () => {
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.WIND_RIDER);
|
||||
game.override.ability(Abilities.WIND_RIDER);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
|
||||
await game.startBattle([Species.SHIFTRY]);
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("Abilities - Wonder Skin", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.CHARM]);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.WONDER_SKIN);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
|
@ -65,7 +65,7 @@ describe("Abilities - Wonder Skin", () => {
|
|||
it(`does not affect pokemon with ${allAbilities[ability].name}`, async () => {
|
||||
const moveToCheck = allMoves[Moves.CHARM];
|
||||
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(ability);
|
||||
game.override.ability(ability);
|
||||
vi.spyOn(moveToCheck, "calculateBattleAccuracy");
|
||||
|
||||
await game.startBattle([Species.PIKACHU]);
|
||||
|
|
|
@ -46,7 +46,7 @@ describe("Abilities - ZEN MODE", () => {
|
|||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE);
|
||||
game.override.ability(Abilities.ZEN_MODE);
|
||||
game.override.startingLevel(100);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("Abilities - ZERO TO HERO", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZERO_TO_HERO);
|
||||
game.override.ability(Abilities.ZERO_TO_HERO);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
});
|
||||
|
|
|
@ -31,7 +31,7 @@ describe("Arena - Gravity", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE, Moves.GRAVITY, Moves.FISSURE]);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE);
|
||||
game.override.ability(Abilities.UNNERVE);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyMoveset(new Array(4).fill(Moves.SPLASH));
|
||||
|
|
|
@ -32,7 +32,7 @@ describe("Weather - Fog", () => {
|
|||
.weather(WeatherType.FOG)
|
||||
.battleType("single");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
game.override.enemyMoveset(new Array(4).fill(Moves.SPLASH));
|
||||
|
|
|
@ -36,7 +36,7 @@ describe("Battle order", () => {
|
|||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.MEWTWO);
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA);
|
||||
game.override.ability(Abilities.INSOMNIA);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ describe("Test Battle Phase", () => {
|
|||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.MIGHTYENA);
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION);
|
||||
game.override.ability(Abilities.HYDRATION);
|
||||
await game.startBattle([
|
||||
Species.BLASTOISE,
|
||||
Species.CHARIZARD,
|
||||
|
@ -221,7 +221,7 @@ describe("Test Battle Phase", () => {
|
|||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.MIGHTYENA);
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION);
|
||||
game.override.ability(Abilities.HYDRATION);
|
||||
await game.startBattle([
|
||||
Species.BLASTOISE,
|
||||
]);
|
||||
|
@ -233,7 +233,7 @@ describe("Test Battle Phase", () => {
|
|||
game.override.battleType("double");
|
||||
game.override.enemySpecies(Species.MIGHTYENA);
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION);
|
||||
game.override.ability(Abilities.HYDRATION);
|
||||
game.override.startingWave(3);
|
||||
await game.startBattle([
|
||||
Species.BLASTOISE,
|
||||
|
@ -247,7 +247,7 @@ describe("Test Battle Phase", () => {
|
|||
game.override.battleType("double");
|
||||
game.override.enemySpecies(Species.MIGHTYENA);
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION);
|
||||
game.override.ability(Abilities.HYDRATION);
|
||||
game.override.startingWave(3);
|
||||
await game.startBattle([
|
||||
Species.BLASTOISE,
|
||||
|
@ -265,7 +265,7 @@ describe("Test Battle Phase", () => {
|
|||
game.override.starterSpecies(Species.MEWTWO);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE);
|
||||
game.override.ability(Abilities.ZEN_MODE);
|
||||
game.override.startingLevel(2000);
|
||||
game.override.startingWave(3);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
|
@ -294,7 +294,7 @@ describe("Test Battle Phase", () => {
|
|||
game.override.starterSpecies(Species.MEWTWO);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE);
|
||||
game.override.ability(Abilities.ZEN_MODE);
|
||||
game.override.startingLevel(2000);
|
||||
game.override.startingWave(3);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
|
@ -312,7 +312,7 @@ describe("Test Battle Phase", () => {
|
|||
game.override.starterSpecies(Species.MEWTWO);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE);
|
||||
game.override.ability(Abilities.ZEN_MODE);
|
||||
game.override.startingLevel(2000);
|
||||
game.override.startingWave(3);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("Test Battle Phase", () => {
|
|||
game.override.starterSpecies(Species.MEWTWO);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.ZEN_MODE);
|
||||
game.override.ability(Abilities.ZEN_MODE);
|
||||
game.override.startingLevel(2000);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
|
|
|
@ -30,7 +30,7 @@ describe("Test Battle Phase", () => {
|
|||
game.override.startingLevel(2000);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TACKLE]);
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION);
|
||||
game.override.ability(Abilities.HYDRATION);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
});
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ describe("EXP Modifier Items", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
game.override.battleType("single");
|
||||
});
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ describe("Items - Grip Claw", () => {
|
|||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.POPULATION_BOMB, Moves.SPLASH ]);
|
||||
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([{name: "GRIP_CLAW", count: 5}, {name: "MULTI_LENS", count: 3}]);
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.KLUTZ);
|
||||
game.override.ability(Abilities.KLUTZ);
|
||||
game.override.enemyMoveset([ Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH ]);
|
||||
vi.spyOn(Overrides, "OPP_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([
|
||||
{name: "BERRY", type: BerryType.SITRUS, count: 2},
|
||||
|
|
|
@ -38,7 +38,7 @@ describe("Items - Toxic orb", () => {
|
|||
const oppMoveToUse = Moves.TACKLE;
|
||||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA);
|
||||
game.override.ability(Abilities.INSOMNIA);
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.startingLevel(2000);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
|
|
|
@ -36,7 +36,7 @@ describe("Moves - Aurora Veil", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
|
||||
game.override.ability(Abilities.NONE);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
|
|
|
@ -30,7 +30,7 @@ describe("Moves - Double Team", () => {
|
|||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DOUBLE_TEAM]);
|
||||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
|
|
|
@ -40,7 +40,7 @@ describe("Moves - Dragon Rage", () => {
|
|||
|
||||
game.override.starterSpecies(Species.SNORLAX);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DRAGON_RAGE]);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
game.override.startingLevel(100);
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ describe("Moves - Fissure", () => {
|
|||
});
|
||||
|
||||
it("ignores damage modification from abilities such as fur coat", async () => {
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NO_GUARD);
|
||||
game.override.ability(Abilities.NO_GUARD);
|
||||
game.override.enemyAbility(Abilities.FUR_COAT);
|
||||
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.FISSURE));
|
||||
|
|
|
@ -31,7 +31,7 @@ describe("Moves - Flower Shield", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
|
||||
game.override.ability(Abilities.NONE);
|
||||
game.override.enemyAbility(Abilities.NONE);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.FLOWER_SHIELD, Moves.SPLASH]);
|
||||
|
|
|
@ -101,7 +101,7 @@ describe("Moves - Follow Me", () => {
|
|||
test(
|
||||
"move effect should be bypassed by Stalwart",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.STALWART);
|
||||
game.override.ability(Abilities.STALWART);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.QUICK_ATTACK ]);
|
||||
game.override.enemyMoveset([ Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME, Moves.FOLLOW_ME ]);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ describe("Moves - Gastro Acid", () => {
|
|||
game.override.battleType("double");
|
||||
game.override.startingLevel(1);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
|
||||
game.override.ability(Abilities.NONE);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.GASTRO_ACID, Moves.WATER_GUN, Moves.SPLASH, Moves.CORE_ENFORCER]);
|
||||
game.override.enemySpecies(Species.BIDOOF);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
|
|
|
@ -32,7 +32,7 @@ describe("Moves - Glaive Rush", () => {
|
|||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.GLAIVE_RUSH));
|
||||
game.override.starterSpecies(Species.KLINK);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.UNNERVE);
|
||||
game.override.ability(Abilities.UNNERVE);
|
||||
vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.FUR_COAT);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SHADOW_SNEAK, Moves.AVALANCHE, Moves.SPLASH, Moves.GLAIVE_RUSH]);
|
||||
});
|
||||
|
|
|
@ -37,7 +37,7 @@ describe("Moves - Growth", () => {
|
|||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(Abilities.MOXIE);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA);
|
||||
game.override.ability(Abilities.INSOMNIA);
|
||||
game.override.startingLevel(2000);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
|
|
|
@ -31,7 +31,7 @@ describe("Moves - Hard Press", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
game.override.enemySpecies(Species.MUNCHLAX);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
|
|
|
@ -35,7 +35,7 @@ describe("Moves - Light Screen", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
|
||||
game.override.ability(Abilities.NONE);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ABSORB, Moves.DAZZLING_GLEAM, Moves.TACKLE]);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
|
|
|
@ -167,7 +167,7 @@ function beforeTrial(phaserGame: Phaser.Game, single: boolean = false) {
|
|||
const game = new GameManager(phaserGame);
|
||||
game.override.battleType("double");
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.EARTHQUAKE, Moves.HYPER_VOICE, Moves.SURF, Moves.SPLASH]);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
game.override.startingLevel(50);
|
||||
|
|
|
@ -37,7 +37,7 @@ describe("Moves - Octolock", () => {
|
|||
|
||||
game.override.startingLevel(2000);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.OCTOLOCK, Moves.SPLASH]);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
|
||||
game.override.ability(Abilities.NONE);
|
||||
});
|
||||
|
||||
it("Reduces DEf and SPDEF by 1 each turn", { timeout: 10000 }, async () => {
|
||||
|
|
|
@ -76,7 +76,7 @@ describe("Moves - Rage Powder", () => {
|
|||
test(
|
||||
"move effect should be bypassed by Overcoat",
|
||||
async () => {
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.OVERCOAT);
|
||||
game.override.ability(Abilities.OVERCOAT);
|
||||
game.override.enemyMoveset([ Moves.RAGE_POWDER, Moves.RAGE_POWDER, Moves.RAGE_POWDER, Moves.RAGE_POWDER ]);
|
||||
|
||||
// Test with two non-Grass type player Pokemon
|
||||
|
|
|
@ -35,7 +35,7 @@ describe("Moves - Reflect", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
|
||||
game.override.ability(Abilities.NONE);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.ABSORB, Moves.ROCK_SLIDE, Moves.TACKLE]);
|
||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(100);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("Moves - Rollout", () => {
|
|||
vi.spyOn(Overrides, "NEVER_CRIT_OVERRIDE", "get").mockReturnValue(true);
|
||||
game.override.battleType("single");
|
||||
game.override.starterSpecies(Species.RATTATA);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.NONE);
|
||||
game.override.ability(Abilities.NONE);
|
||||
game.override.enemySpecies(Species.BIDOOF);
|
||||
game.override.enemyAbility(Abilities.NONE);
|
||||
game.override.startingLevel(100);
|
||||
|
|
|
@ -31,7 +31,7 @@ describe("Moves - Spikes", () => {
|
|||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(Abilities.HYDRATION);
|
||||
vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION);
|
||||
game.override.ability(Abilities.HYDRATION);
|
||||
vi.spyOn(Overrides, "PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION);
|
||||
game.override.startingWave(3);
|
||||
game.override.enemyMoveset([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]);
|
||||
|
|
|
@ -36,7 +36,7 @@ describe("Moves - Tail whip", () => {
|
|||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INSOMNIA);
|
||||
game.override.ability(Abilities.INSOMNIA);
|
||||
game.override.startingLevel(2000);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE,Moves.TACKLE,Moves.TACKLE,Moves.TACKLE]);
|
||||
|
|
|
@ -33,7 +33,7 @@ describe("Moves - Tidy Up", () => {
|
|||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.starterSpecies(Species.FEEBAS);
|
||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.TIDY_UP]);
|
||||
game.override.startingLevel(50);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue