diff --git a/src/data/move.ts b/src/data/move.ts index abed38a660d..69708fe4caa 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -278,12 +278,14 @@ export default class Move implements Localizable { } /** - * Checks if the move is immune to certain types - * currently only look at case of Grass types and powder moves - * @param type {@linkcode Type} enum + * Checks if the move is immune to certain types. + * Currently looks at cases of Grass types with powder moves and Dark types with moves affected by Prankster. + * @param {Pokemon} user the source of this move + * @param {Pokemon} target the target of this move + * @param {Type} type the type of the move's target * @returns boolean */ - isTypeImmune(type: Type): boolean { + isTypeImmune(user: Pokemon, target: Pokemon, type: Type): boolean { if (this.moveTarget === MoveTarget.USER) { return false; } @@ -294,6 +296,11 @@ export default class Move implements Localizable { return true; } break; + case Type.DARK: + if (user.hasAbility(Abilities.PRANKSTER) && this.category === MoveCategory.STATUS && (user.isPlayer() !== target.isPlayer())) { + return true; + } + break; } return false; } @@ -4599,7 +4606,7 @@ export class RemoveTypeAttr extends MoveEffectAttr { export class CopyTypeAttr extends MoveEffectAttr { constructor() { - super(true); + super(false); } apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index fcc55a645a0..4146adee377 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1730,11 +1730,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (typeless) { typeMultiplier.value = 1; } - if (types.find(t => move.isTypeImmune(t))) { + if (types.find(t => move.isTypeImmune(source, this, t))) { typeMultiplier.value = 0; } - // Apply arena tags for conditional protection if (!move.checkFlag(MoveFlags.IGNORE_PROTECT, source, this) && !move.isAllyTarget()) { const defendingSide = this.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY;