mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 06:49:35 +02:00
Apply suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
parent
8277d2e334
commit
fa5f6f88fd
@ -4687,7 +4687,7 @@ export class TerrainEventTypeChangeAbAttr extends PostSummonAbAttr {
|
|||||||
super(true);
|
super(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
apply(pokemon: Pokemon, passive: boolean, simulated: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
apply(pokemon: Pokemon, _passive: boolean, _simulated: boolean, _cancelled: Utils.BooleanHolder, _args: any[]): boolean {
|
||||||
if (pokemon.isTerastallized()) {
|
if (pokemon.isTerastallized()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,14 @@ import Move from "#app/data/move";
|
|||||||
import { ArenaTag, ArenaTagSide, ArenaTrapTag, getArenaTag } from "#app/data/arena-tag";
|
import { ArenaTag, ArenaTagSide, ArenaTrapTag, getArenaTag } from "#app/data/arena-tag";
|
||||||
import { BattlerIndex } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
import { Terrain, TerrainType } from "#app/data/terrain";
|
import { Terrain, TerrainType } from "#app/data/terrain";
|
||||||
import { applyAbAttrs, applyPostTerrainChangeAbAttrs, applyPostWeatherChangeAbAttrs, PostTerrainChangeAbAttr, PostWeatherChangeAbAttr, TerrainEventTypeChangeAbAttr } from "#app/data/ability";
|
import {
|
||||||
|
applyAbAttrs,
|
||||||
|
applyPostTerrainChangeAbAttrs,
|
||||||
|
applyPostWeatherChangeAbAttrs,
|
||||||
|
PostTerrainChangeAbAttr,
|
||||||
|
PostWeatherChangeAbAttr,
|
||||||
|
TerrainEventTypeChangeAbAttr
|
||||||
|
} from "#app/data/ability";
|
||||||
import Pokemon from "#app/field/pokemon";
|
import Pokemon from "#app/field/pokemon";
|
||||||
import Overrides from "#app/overrides";
|
import Overrides from "#app/overrides";
|
||||||
import { TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena";
|
import { TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena";
|
||||||
|
@ -1245,8 +1245,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// the type added to Pokemon from moves like Forest's Curse or Trick Or Treat
|
// the type added to Pokemon from moves like Forest's Curse or Trick Or Treat
|
||||||
if (this.summonData?.addedType && !types.includes(this.summonData?.addedType)) {
|
if (this.summonData && this.summonData.addedType && !types.includes(this.summonData.addedType)) {
|
||||||
types.push(this.summonData?.addedType);
|
types.push(this.summonData.addedType);
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.scene potentially can be undefined for a fainted pokemon in doubles
|
// this.scene potentially can be undefined for a fainted pokemon in doubles
|
||||||
|
@ -38,16 +38,15 @@ describe("Abilities - Mimicry", () => {
|
|||||||
game.override.enemyAbility(Abilities.MISTY_SURGE);
|
game.override.enemyAbility(Abilities.MISTY_SURGE);
|
||||||
await game.classicMode.startBattle([ Species.FEEBAS, Species.ABRA ]);
|
await game.classicMode.startBattle([ Species.FEEBAS, Species.ABRA ]);
|
||||||
|
|
||||||
const playerPokemon1 = game.scene.getPlayerPokemon();
|
const [ playerPokemon1, playerPokemon2 ] = game.scene.getParty();
|
||||||
game.move.select(Moves.SPLASH);
|
game.move.select(Moves.SPLASH);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
expect(playerPokemon1?.getTypes().includes(Type.FAIRY)).toBe(true);
|
expect(playerPokemon1.getTypes().includes(Type.FAIRY)).toBe(true);
|
||||||
|
|
||||||
game.doSwitchPokemon(1);
|
game.doSwitchPokemon(1);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
|
|
||||||
const playerPokemon2 = game.scene.getPlayerPokemon();
|
expect(playerPokemon2.getTypes().includes(Type.FAIRY)).toBe(true);
|
||||||
expect(playerPokemon2?.getTypes().includes(Type.FAIRY)).toBe(true);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Pokemon should revert back to its original, root type once terrain ends", async () => {
|
it("Pokemon should revert back to its original, root type once terrain ends", async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user