Fix if statement in FaintPhase

This commit is contained in:
NightKev 2025-02-08 06:44:49 -08:00
parent f42e11f770
commit 37c69896be
2 changed files with 4 additions and 7 deletions

View File

@ -121,7 +121,7 @@ export class FaintPhase extends PokemonPhase {
if (pokemon.turnData?.attacksReceived?.length) { if (pokemon.turnData?.attacksReceived?.length) {
const defeatSource = this.source; const defeatSource = this.source;
if (defeatSource instanceof Pokemon && defeatSource.isOnField()) { if (defeatSource?.isOnField()) {
applyPostVictoryAbAttrs(PostVictoryAbAttr, defeatSource); applyPostVictoryAbAttrs(PostVictoryAbAttr, defeatSource);
const pvmove = allMoves[pokemon.turnData.attacksReceived[0].move]; const pvmove = allMoves[pokemon.turnData.attacksReceived[0].move];
const pvattrs = pvmove.getAttrs(PostVictoryStatStageChangeAttr); const pvattrs = pvmove.getAttrs(PostVictoryStatStageChangeAttr);

View File

@ -35,14 +35,11 @@ describe("Moves - Fell Stinger", () => {
Moves.LEECH_SEED Moves.LEECH_SEED
]) ])
.startingLevel(50) .startingLevel(50)
.disableCrits(); .disableCrits()
.enemyAbility(Abilities.STURDY)
game.override.enemyAbility(Abilities.STURDY)
.enemySpecies(Species.HYPNO) .enemySpecies(Species.HYPNO)
.enemyMoveset([ Moves.SPLASH ]) .enemyMoveset(Moves.SPLASH)
.enemyLevel(5); .enemyLevel(5);
game.override.weather(WeatherType.NONE);
}); });
it("should not grant stat boost if opponent gets KO'd by recoil", async () => { it("should not grant stat boost if opponent gets KO'd by recoil", async () => {