mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-26 16:56:11 +00:00
Type immunity abilities only affect attack and status moves
This commit is contained in:
parent
8cb7433f55
commit
3ed80de330
@ -8,7 +8,7 @@ import { Weather, WeatherType } from "./weather";
|
|||||||
import { BattlerTag } from "./battler-tags";
|
import { BattlerTag } from "./battler-tags";
|
||||||
import { BattlerTagType } from "./enums/battler-tag-type";
|
import { BattlerTagType } from "./enums/battler-tag-type";
|
||||||
import { StatusEffect, getStatusEffectDescriptor } from "./status-effect";
|
import { StatusEffect, getStatusEffectDescriptor } from "./status-effect";
|
||||||
import Move, { MoveCategory, MoveFlags, RecoilAttr } from "./move";
|
import Move, { AttackMove, MoveCategory, MoveFlags, RecoilAttr, StatusEffectAttr } from "./move";
|
||||||
import { ArenaTagType } from "./enums/arena-tag-type";
|
import { ArenaTagType } from "./enums/arena-tag-type";
|
||||||
import { Stat } from "./pokemon-stat";
|
import { Stat } from "./pokemon-stat";
|
||||||
import { PokemonHeldItemModifier } from "../modifier/modifier";
|
import { PokemonHeldItemModifier } from "../modifier/modifier";
|
||||||
@ -191,7 +191,7 @@ export class TypeImmunityAbAttr extends PreDefendAbAttr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
applyPreDefend(pokemon: Pokemon, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
applyPreDefend(pokemon: Pokemon, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
||||||
if (move.getMove().type === this.immuneType) {
|
if ((move instanceof AttackMove || move.getMove().getAttrs(StatusEffectAttr).length) && move.getMove().type === this.immuneType) {
|
||||||
(args[0] as Utils.NumberHolder).value = 0;
|
(args[0] as Utils.NumberHolder).value = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user