mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-04-28 12:34:37 +01:00
* Add PostSummonHealAbAttr and give it to appropriate abilities * Add attr to insomnia * Remove attr from leaf guard (it does not activate on gain with sun up) * Add tests and remove attr from shields down * Add PostSummonRemoveBattlerTag and give it to oblivious and own tempo * Add tests for oblivious and own tempo * Fix oblivious test sometimes failing * Remove Comatose changes as it doesn't reapply * Remove unused tagRemoved field * Fix tests checking status instead of tag * Fix attr comments * Add PostSetStatusHealStatusAbAttr * Add ResetStatusPhase * Modify pokemon.resetStatus to use ResetStatusPhase * Move post status effects to ObtainStatusEffectPhase * Ensure status overriding (ie rest) works properly * Add PostApplyBattlerTagRemoveTagAbAttr for own tempo and oblivious * Guard removeTag call in PostApplyBattlerTagRemoveTagAbAttr * Commenting * Handle Mold Breaker case in MoveEndPhase * Remove PostSummonHealStatusAbAttr from purifying salt * Fix not passing overrideStatus to canSetStatus * Apply suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Add isNullOrUndefined import * Add canApply to new attrs * Add followup argument back * Remove guard around new MoveEndPhase --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
52 lines
1.5 KiB
TypeScript
52 lines
1.5 KiB
TypeScript
import { Abilities } from "#enums/abilities";
|
|
import { Moves } from "#enums/moves";
|
|
import { Species } from "#enums/species";
|
|
import { StatusEffect } from "#enums/status-effect";
|
|
import GameManager from "#test/testUtils/gameManager";
|
|
import Phaser from "phaser";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
|
|
describe("Abilities - Immunity", () => {
|
|
let phaserGame: Phaser.Game;
|
|
let game: GameManager;
|
|
|
|
beforeAll(() => {
|
|
phaserGame = new Phaser.Game({
|
|
type: Phaser.HEADLESS,
|
|
});
|
|
});
|
|
|
|
afterEach(() => {
|
|
game.phaseInterceptor.restoreOg();
|
|
});
|
|
|
|
beforeEach(() => {
|
|
game = new GameManager(phaserGame);
|
|
game.override
|
|
.moveset([ Moves.SPLASH ])
|
|
.ability(Abilities.BALL_FETCH)
|
|
.battleType("single")
|
|
.disableCrits()
|
|
.enemySpecies(Species.MAGIKARP)
|
|
.enemyAbility(Abilities.BALL_FETCH)
|
|
.enemyMoveset(Moves.SPLASH);
|
|
});
|
|
|
|
it("should remove poison when gained", async () => {
|
|
game.override.ability(Abilities.IMMUNITY)
|
|
.enemyAbility(Abilities.BALL_FETCH)
|
|
.moveset(Moves.SKILL_SWAP)
|
|
.enemyMoveset(Moves.SPLASH),
|
|
|
|
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
|
const enemy = game.scene.getEnemyPokemon();
|
|
enemy?.trySetStatus(StatusEffect.POISON);
|
|
expect(enemy?.status?.effect).toBe(StatusEffect.POISON);
|
|
|
|
game.move.select(Moves.SKILL_SWAP);
|
|
await game.phaseInterceptor.to("BerryPhase");
|
|
|
|
expect(enemy?.status).toBeNull();
|
|
});
|
|
});
|