mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-24 00:09:31 +02:00
[test] add some sandstorm and hail tests
This commit is contained in:
parent
356889920c
commit
ab6cb23bab
@ -58,4 +58,18 @@ describe("Weather - Hail", () => {
|
|||||||
expect(playerPokemon.hp).toBe(playerPokemon.getMaxHp());
|
expect(playerPokemon.hp).toBe(playerPokemon.getMaxHp());
|
||||||
expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp() - Math.max(Math.floor(enemyPokemon.getMaxHp() / 16), 1));
|
expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp() - Math.max(Math.floor(enemyPokemon.getMaxHp() / 16), 1));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("does not inflict damage to Ice type Pokemon", async () => {
|
||||||
|
await game.classicMode.startBattle([Species.CLOYSTER]);
|
||||||
|
|
||||||
|
game.move.select(Moves.SPLASH);
|
||||||
|
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
|
||||||
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
|
expect(playerPokemon.hp).toBe(playerPokemon.getMaxHp());
|
||||||
|
expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp() - Math.max(Math.floor(enemyPokemon.getMaxHp() / 16), 1));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import { WeatherType } from "#app/data/weather";
|
import { WeatherType } from "#app/data/weather";
|
||||||
|
import { Abilities } from "#app/enums/abilities";
|
||||||
|
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";
|
||||||
@ -55,4 +57,35 @@ describe("Weather - Sandstorm", () => {
|
|||||||
expect(playerPokemon.hp).toBe(playerPokemon.getMaxHp());
|
expect(playerPokemon.hp).toBe(playerPokemon.getMaxHp());
|
||||||
expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp() - Math.max(Math.floor(enemyPokemon.getMaxHp() / 16), 1));
|
expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp() - Math.max(Math.floor(enemyPokemon.getMaxHp() / 16), 1));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("does not inflict damage to Rock, Ground and Steel type Pokemon", async () => {
|
||||||
|
game.override
|
||||||
|
.battleType("double")
|
||||||
|
.enemySpecies(Species.SANDSHREW)
|
||||||
|
.ability(Abilities.BALL_FETCH)
|
||||||
|
.enemyAbility(Abilities.BALL_FETCH);
|
||||||
|
|
||||||
|
await game.classicMode.startBattle([Species.ROCKRUFF, Species.KLINK]);
|
||||||
|
|
||||||
|
game.move.select(Moves.SPLASH, 0);
|
||||||
|
game.move.select(Moves.SPLASH, 1);
|
||||||
|
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
|
||||||
|
game.scene.getField(true).forEach(pokemon => {
|
||||||
|
expect(pokemon.hp).toBe(pokemon.getMaxHp());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("increases Rock type Pokemon Sp.Def by 50%", async () => {
|
||||||
|
await game.classicMode.startBattle([Species.ROCKRUFF]);
|
||||||
|
|
||||||
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
const playerSpdef = playerPokemon.getStat(Stat.SPDEF);
|
||||||
|
expect(playerPokemon.getEffectiveStat(Stat.SPDEF)).toBe(Math.floor(playerSpdef * 1.5));
|
||||||
|
|
||||||
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
const enemySpdef = enemyPokemon.getStat(Stat.SPDEF);
|
||||||
|
expect(enemyPokemon.getEffectiveStat(Stat.SPDEF)).toBe(enemySpdef);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user