mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 15:32:18 +02:00
Apply small fixes from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
parent
c75ced6c12
commit
1d8f06b240
@ -1698,8 +1698,7 @@ export class GorillaTacticsAbAttr extends ExecutedMoveAbAttr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override canApplyExecutedMove(pokemon: Pokemon, simulated: boolean): boolean {
|
override canApplyExecutedMove(pokemon: Pokemon, simulated: boolean): boolean {
|
||||||
return super.canApplyExecutedMove(pokemon, simulated) &&
|
return simulated || !pokemon.getTag(BattlerTagType.GORILLA_TACTICS);
|
||||||
simulated || !pokemon.getTag(BattlerTagType.GORILLA_TACTICS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override applyExecutedMove(pokemon: Pokemon, simulated: boolean): void {
|
override applyExecutedMove(pokemon: Pokemon, simulated: boolean): void {
|
||||||
|
@ -73,7 +73,7 @@ describe("Abilities - Gorilla Tactics", () => {
|
|||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
|
|
||||||
game.move.select(MoveId.TACKLE);
|
game.move.select(MoveId.TACKLE);
|
||||||
await game.selectTarget(MoveId.SPLASH); //prevent protect from being used by the enemy
|
await game.move.forceEnemyMove(MoveId.SPLASH); //prevent protect from being used by the enemy
|
||||||
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
|
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
|
||||||
|
|
||||||
await game.phaseInterceptor.to("MoveEndPhase");
|
await game.phaseInterceptor.to("MoveEndPhase");
|
||||||
@ -83,12 +83,12 @@ describe("Abilities - Gorilla Tactics", () => {
|
|||||||
it("should activate when the opponenet protects", async () => {
|
it("should activate when the opponenet protects", async () => {
|
||||||
await game.classicMode.startBattle([SpeciesId.GALAR_DARMANITAN]);
|
await game.classicMode.startBattle([SpeciesId.GALAR_DARMANITAN]);
|
||||||
|
|
||||||
const darmanitan = game.scene.getPlayerPokemon()!;
|
const darmanitan = game.field.getPlayerPokemon();
|
||||||
|
|
||||||
game.move.select(MoveId.TACKLE);
|
game.move.select(MoveId.TACKLE);
|
||||||
await game.move.selectEnemyMove(MoveId.PROTECT);
|
await game.move.selectEnemyMove(MoveId.PROTECT);
|
||||||
|
|
||||||
await game.phaseInterceptor.to("TurnEndPhase");
|
await game.toEndOfTurn();
|
||||||
expect(darmanitan.isMoveRestricted(MoveId.SPLASH)).toBe(true);
|
expect(darmanitan.isMoveRestricted(MoveId.SPLASH)).toBe(true);
|
||||||
expect(darmanitan.isMoveRestricted(MoveId.TACKLE)).toBe(false);
|
expect(darmanitan.isMoveRestricted(MoveId.TACKLE)).toBe(false);
|
||||||
});
|
});
|
||||||
@ -96,13 +96,13 @@ describe("Abilities - Gorilla Tactics", () => {
|
|||||||
it("should activate when a move is succesfully executed but misses", async () => {
|
it("should activate when a move is succesfully executed but misses", async () => {
|
||||||
await game.classicMode.startBattle([SpeciesId.GALAR_DARMANITAN]);
|
await game.classicMode.startBattle([SpeciesId.GALAR_DARMANITAN]);
|
||||||
|
|
||||||
const darmanitan = game.scene.getPlayerPokemon()!;
|
const darmanitan = game.field.getPlayerPokemon();
|
||||||
|
|
||||||
game.move.select(MoveId.TACKLE);
|
game.move.select(MoveId.TACKLE);
|
||||||
await game.move.selectEnemyMove(MoveId.SPLASH);
|
await game.move.selectEnemyMove(MoveId.SPLASH);
|
||||||
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
|
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
|
||||||
await game.move.forceMiss();
|
await game.move.forceMiss();
|
||||||
await game.phaseInterceptor.to("TurnEndPhase");
|
await game.toEndOfTurn();
|
||||||
|
|
||||||
expect(darmanitan.isMoveRestricted(MoveId.SPLASH)).toBe(true);
|
expect(darmanitan.isMoveRestricted(MoveId.SPLASH)).toBe(true);
|
||||||
expect(darmanitan.isMoveRestricted(MoveId.TACKLE)).toBe(false);
|
expect(darmanitan.isMoveRestricted(MoveId.TACKLE)).toBe(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user