mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-01 14:02:18 +02:00
Telekinesis Test + Move Fix
This commit is contained in:
parent
5f63f6c7a1
commit
0d797abdf4
@ -8386,12 +8386,11 @@ export function initMoves() {
|
|||||||
new SelfStatusMove(Moves.RAGE_POWDER, Type.BUG, -1, 20, -1, 2, 5)
|
new SelfStatusMove(Moves.RAGE_POWDER, Type.BUG, -1, 20, -1, 2, 5)
|
||||||
.powderMove()
|
.powderMove()
|
||||||
.attr(AddBattlerTagAttr, BattlerTagType.CENTER_OF_ATTENTION, true),
|
.attr(AddBattlerTagAttr, BattlerTagType.CENTER_OF_ATTENTION, true),
|
||||||
new StatusMove(Moves.TELEKINESIS, Type.PSYCHIC, -1, 15, -1, 0, 5)
|
new StatusMove(Moves.TELEKINESIS, Type.PSYCHIC, 100, 15, -1, 0, 5)
|
||||||
.condition(failOnGravityCondition)
|
.condition(failOnGravityCondition)
|
||||||
.condition((_user, target, _move) => ![ Species.DIGLETT, Species.DUGTRIO, Species.ALOLA_DIGLETT, Species.ALOLA_DUGTRIO, Species.SANDYGAST, Species.PALOSSAND, Species.WIGLETT, Species.WUGTRIO ].includes(target.species.speciesId))
|
.condition((_user, target, _move) => ![ Species.DIGLETT, Species.DUGTRIO, Species.ALOLA_DIGLETT, Species.ALOLA_DUGTRIO, Species.SANDYGAST, Species.PALOSSAND, Species.WIGLETT, Species.WUGTRIO ].includes(target.species.speciesId))
|
||||||
.condition((_user, target, _move) => !(target.species.speciesId !== Species.GENGAR && target.getFormKey() !== "mega"))
|
.condition((_user, target, _move) => (target.species.speciesId !== Species.GENGAR && target.getFormKey() !== "mega"))
|
||||||
.condition((_user, target, _move) => !(target.getTag(BattlerTagType.INGRAIN) || target.getTag(BattlerTagType.IGNORE_FLYING)))
|
//.condition((_user, target, _move) => target.getTag(BattlerTagType.INGRAIN) || target.getTag(BattlerTagType.IGNORE_FLYING)
|
||||||
.attr(AddBattlerTagAttr, BattlerTagType.FLYING, false, false, 3)
|
|
||||||
.attr(AddBattlerTagAttr, BattlerTagType.TELEKINESIS, false, false, 3),
|
.attr(AddBattlerTagAttr, BattlerTagType.TELEKINESIS, false, false, 3),
|
||||||
new StatusMove(Moves.MAGIC_ROOM, Type.PSYCHIC, -1, 10, -1, 0, 5)
|
new StatusMove(Moves.MAGIC_ROOM, Type.PSYCHIC, -1, 10, -1, 0, 5)
|
||||||
.ignoresProtect()
|
.ignoresProtect()
|
||||||
|
52
src/test/moves/telekinesis.test.ts
Normal file
52
src/test/moves/telekinesis.test.ts
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
import { BattlerTagType } from "#app/enums/battler-tag-type";
|
||||||
|
import { allMoves } from "#app/data/move";
|
||||||
|
import { Abilities } from "#enums/abilities";
|
||||||
|
import { Moves } from "#enums/moves";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
|
import GameManager from "#test/utils/gameManager";
|
||||||
|
import Phaser from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, it, expect, vi } from "vitest";
|
||||||
|
|
||||||
|
describe("Moves - Telekinesis", () => {
|
||||||
|
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.TELEKINESIS, Moves.TACKLE, Moves.MUD_SHOT ])
|
||||||
|
.battleType("single")
|
||||||
|
.enemySpecies(Species.SNORLAX)
|
||||||
|
.enemyLevel(60)
|
||||||
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
|
.enemyMoveset(Moves.SPLASH);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("test case", async () => {
|
||||||
|
await game.classicMode.startBattle([ Species.MAGIKARP ]);
|
||||||
|
|
||||||
|
const enemyOpponent = game.scene.getEnemyPokemon();
|
||||||
|
expect(enemyOpponent).toBeDefined();
|
||||||
|
|
||||||
|
game.move.select(Moves.TELEKINESIS);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
expect(enemyOpponent?.getTag(BattlerTagType.TELEKINESIS)).toBeDefined();
|
||||||
|
expect(enemyOpponent?.getTag(BattlerTagType.FLOATING)).toBeDefined();
|
||||||
|
|
||||||
|
await game.toNextTurn();
|
||||||
|
vi.spyOn(allMoves[Moves.TACKLE], "accuracy", "get").mockReturnValue(0);
|
||||||
|
game.move.select(Moves.TACKLE);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
expect(enemyOpponent?.hp).toBeLessThan(enemyOpponent?.getMaxHp()!);
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user