mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 15:32:18 +02:00
Update some tests
- Disable broken Good As Gold test and add `.edgeCase` to Good As Gold - Fix Powder test - Update some tests to demonstrate new methods
This commit is contained in:
parent
f7cb6acb1f
commit
fb53b12cd6
@ -7425,7 +7425,12 @@ export function initAbilities() {
|
|||||||
.uncopiable()
|
.uncopiable()
|
||||||
.attr(NoTransformAbilityAbAttr),
|
.attr(NoTransformAbilityAbAttr),
|
||||||
new Ability(Abilities.GOOD_AS_GOLD, 9)
|
new Ability(Abilities.GOOD_AS_GOLD, 9)
|
||||||
.attr(MoveImmunityAbAttr, (pokemon, attacker, move) => pokemon !== attacker && move.category === MoveCategory.STATUS && ![ MoveTarget.ENEMY_SIDE, MoveTarget.BOTH_SIDES, MoveTarget.USER_SIDE ].includes(move.moveTarget))
|
.attr(MoveImmunityAbAttr, (pokemon, attacker, move) =>
|
||||||
|
pokemon !== attacker
|
||||||
|
&& move.category === MoveCategory.STATUS
|
||||||
|
&& ![ MoveTarget.ENEMY_SIDE, MoveTarget.BOTH_SIDES, MoveTarget.USER_SIDE ].includes(move.moveTarget)
|
||||||
|
)
|
||||||
|
.edgeCase() // Heal Bell should not cure the status of a Pokemon with Good As Gold
|
||||||
.ignorable(),
|
.ignorable(),
|
||||||
new Ability(Abilities.VESSEL_OF_RUIN, 9)
|
new Ability(Abilities.VESSEL_OF_RUIN, 9)
|
||||||
.attr(FieldMultiplyStatAbAttr, Stat.SPATK, 0.75)
|
.attr(FieldMultiplyStatAbAttr, Stat.SPATK, 0.75)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { BattlerIndex } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
import { allAbilities } from "#app/data/data-lists";
|
|
||||||
import { ArenaTagSide } from "#app/data/arena-tag";
|
import { ArenaTagSide } from "#app/data/arena-tag";
|
||||||
|
import { allAbilities } from "#app/data/data-lists";
|
||||||
import { ArenaTagType } from "#app/enums/arena-tag-type";
|
import { ArenaTagType } from "#app/enums/arena-tag-type";
|
||||||
import { BattlerTagType } from "#app/enums/battler-tag-type";
|
import { BattlerTagType } from "#app/enums/battler-tag-type";
|
||||||
import { Stat } from "#app/enums/stat";
|
import { Stat } from "#app/enums/stat";
|
||||||
@ -107,35 +107,33 @@ describe("Abilities - Good As Gold", () => {
|
|||||||
expect(game.scene.getPlayerField()[1].getTag(BattlerTagType.HELPING_HAND)).toBeUndefined();
|
expect(game.scene.getPlayerField()[1].getTag(BattlerTagType.HELPING_HAND)).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should block the ally's heal bell, but only if the good as gold user is on the field", async () => {
|
// TODO: re-enable when heal bell is fixed
|
||||||
game.override.battleStyle("double");
|
it.todo("should block the ally's heal bell, but only if the good as gold user is on the field", async () => {
|
||||||
game.override.moveset([Moves.HEAL_BELL, Moves.SPLASH]);
|
game.override.battleStyle("double").statusEffect(StatusEffect.BURN);
|
||||||
game.override.statusEffect(StatusEffect.BURN);
|
await game.classicMode.startBattle([Species.MILOTIC, Species.FEEBAS, Species.ABRA]);
|
||||||
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS, Species.ABRA]);
|
const [milotic, feebas, abra] = game.scene.getPlayerParty();
|
||||||
const [good_as_gold, ball_fetch] = game.scene.getPlayerField();
|
game.field.mockAbility(milotic, Abilities.GOOD_AS_GOLD);
|
||||||
|
game.field.mockAbility(feebas, Abilities.BALL_FETCH);
|
||||||
// Force second pokemon to have ball fetch to isolate to a single mon.
|
game.field.mockAbility(abra, Abilities.BALL_FETCH);
|
||||||
vi.spyOn(ball_fetch, "getAbility").mockReturnValue(allAbilities[Abilities.BALL_FETCH]);
|
|
||||||
|
|
||||||
// turn 1
|
// turn 1
|
||||||
game.move.select(Moves.SPLASH, 0);
|
game.move.use(Moves.SPLASH, 0);
|
||||||
game.move.select(Moves.HEAL_BELL, 1);
|
game.move.use(Moves.HEAL_BELL, 1);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
expect(good_as_gold.status?.effect).toBe(StatusEffect.BURN);
|
expect(milotic.status?.effect).toBe(StatusEffect.BURN);
|
||||||
|
|
||||||
game.doSwitchPokemon(2);
|
game.doSwitchPokemon(2);
|
||||||
game.move.select(Moves.HEAL_BELL, 0);
|
game.move.use(Moves.HEAL_BELL, 1);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
expect(good_as_gold.status?.effect).toBeUndefined();
|
expect(milotic.status?.effect).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not block field targeted effects like rain dance", async () => {
|
it("should not block field targeted effects like rain dance", async () => {
|
||||||
game.override.battleStyle("single");
|
game.override.battleStyle("single");
|
||||||
game.override.enemyMoveset([Moves.RAIN_DANCE]);
|
game.override.enemyMoveset([Moves.RAIN_DANCE]);
|
||||||
game.override.weather(WeatherType.NONE);
|
|
||||||
await game.classicMode.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH, 0);
|
game.move.use(Moves.SPLASH, 0);
|
||||||
await game.phaseInterceptor.to("BerryPhase");
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.RAIN);
|
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.RAIN);
|
||||||
|
@ -29,20 +29,18 @@ describe("Moves - Alluring Voice", () => {
|
|||||||
.disableCrits()
|
.disableCrits()
|
||||||
.enemySpecies(Species.MAGIKARP)
|
.enemySpecies(Species.MAGIKARP)
|
||||||
.enemyAbility(Abilities.ICE_SCALES)
|
.enemyAbility(Abilities.ICE_SCALES)
|
||||||
.enemyMoveset([Moves.HOWL])
|
.enemyMoveset(Moves.HOWL)
|
||||||
.startingLevel(10)
|
.startingLevel(10)
|
||||||
.enemyLevel(10)
|
.enemyLevel(10)
|
||||||
.starterSpecies(Species.FEEBAS)
|
.ability(Abilities.BALL_FETCH);
|
||||||
.ability(Abilities.BALL_FETCH)
|
|
||||||
.moveset([Moves.ALLURING_VOICE]);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should confuse the opponent if their stat stages were raised", async () => {
|
it("should confuse the opponent if their stat stages were raised", async () => {
|
||||||
await game.classicMode.startBattle();
|
await game.classicMode.startBattle([Species.FEEBAS]);
|
||||||
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
const enemy = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
game.move.select(Moves.ALLURING_VOICE);
|
game.move.use(Moves.ALLURING_VOICE);
|
||||||
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
||||||
await game.phaseInterceptor.to(BerryPhase);
|
await game.phaseInterceptor.to(BerryPhase);
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { MoveResult } from "#app/field/pokemon";
|
||||||
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";
|
||||||
@ -22,21 +23,23 @@ describe("Moves - Chloroblast", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override
|
game.override
|
||||||
.moveset([Moves.CHLOROBLAST])
|
|
||||||
.ability(Abilities.BALL_FETCH)
|
.ability(Abilities.BALL_FETCH)
|
||||||
.battleStyle("single")
|
.battleStyle("single")
|
||||||
.disableCrits()
|
.disableCrits()
|
||||||
.enemySpecies(Species.MAGIKARP)
|
.enemySpecies(Species.MAGIKARP)
|
||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH);
|
||||||
.enemyMoveset(Moves.PROTECT);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not deal recoil damage if the opponent uses protect", async () => {
|
it("should not deal recoil damage if the opponent uses protect", async () => {
|
||||||
await game.classicMode.startBattle([Species.FEEBAS]);
|
await game.classicMode.startBattle([Species.FEEBAS]);
|
||||||
|
|
||||||
game.move.select(Moves.CHLOROBLAST);
|
game.move.use(Moves.CHLOROBLAST);
|
||||||
await game.phaseInterceptor.to("BerryPhase");
|
await game.move.forceEnemyMove(Moves.PROTECT);
|
||||||
|
await game.toEndOfTurn();
|
||||||
|
|
||||||
expect(game.scene.getPlayerPokemon()!.isFullHp()).toBe(true);
|
const player = game.field.getPlayerPokemon();
|
||||||
|
|
||||||
|
expect(player.isFullHp()).toBe(true);
|
||||||
|
expect(player.getLastXMoves()[0]).toMatchObject({ result: MoveResult.MISS, move: Moves.CHLOROBLAST });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { BattlerIndex } from "#app/battle";
|
||||||
import Phaser from "phaser";
|
import { MoveResult, PokemonMove } from "#app/field/pokemon";
|
||||||
import GameManager from "#test/testUtils/gameManager";
|
import { BerryPhase } from "#app/phases/berry-phase";
|
||||||
|
import { MoveEffectPhase } from "#app/phases/move-effect-phase";
|
||||||
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 { BerryPhase } from "#app/phases/berry-phase";
|
|
||||||
import { MoveResult, PokemonMove } from "#app/field/pokemon";
|
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import { MoveEffectPhase } from "#app/phases/move-effect-phase";
|
import { Species } from "#enums/species";
|
||||||
import { StatusEffect } from "#enums/status-effect";
|
import { StatusEffect } from "#enums/status-effect";
|
||||||
import { BattlerIndex } from "#app/battle";
|
import GameManager from "#test/testUtils/gameManager";
|
||||||
|
import Phaser from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
describe("Moves - Powder", () => {
|
describe("Moves - Powder", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
@ -161,7 +161,6 @@ describe("Moves - Powder", () => {
|
|||||||
game.move.select(Moves.ROAR, 0, BattlerIndex.ENEMY_2);
|
game.move.select(Moves.ROAR, 0, BattlerIndex.ENEMY_2);
|
||||||
game.move.select(Moves.SPLASH, 1);
|
game.move.select(Moves.SPLASH, 1);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
await game.toNextTurn(); // Requires game.toNextTurn() twice due to double battle
|
|
||||||
|
|
||||||
// Turn 2: Enemy should activate Powder twice: From using Ember, and from copying Fiery Dance via Dancer
|
// Turn 2: Enemy should activate Powder twice: From using Ember, and from copying Fiery Dance via Dancer
|
||||||
playerPokemon.hp = playerPokemon.getMaxHp();
|
playerPokemon.hp = playerPokemon.getMaxHp();
|
||||||
|
Loading…
Reference in New Issue
Block a user