diff --git a/src/data/move.ts b/src/data/move.ts index bada67b2850..8e1c1ad921d 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -5117,7 +5117,7 @@ export class SuppressAbilitiesAttr extends MoveEffectAttr { target.summonData.abilitySuppressed = true; - target.scene.queueMessage(getPokemonMessage(target, " ability\nwas suppressed!")); + target.scene.queueMessage(getPokemonMessage(target, "'s ability\nwas suppressed!")); return true; } @@ -5127,6 +5127,35 @@ export class SuppressAbilitiesAttr extends MoveEffectAttr { } } +/** + * Applies the effects of {@linkcode SuppressAbilitiesAttr} if the target has already moved this turn. + * @extends MoveEffectAttr + * @see {@linkcode Moves.CORE_ENFORCER} (the move which uses this effect) + */ +export class SuppressAbilitiesIfActedAttr extends MoveEffectAttr { + /** + * If the target has already acted this turn, apply a {@linkcode SuppressAbilitiesAttr} effect unless the + * abillity cannot be suppressed. This is a secondary effect and has no bearing on the success or failure of the move. + * + * @returns True if the move occurred, otherwise false. Note that true will be returned even if the target has not + * yet moved or if the target's abiilty is un-suppressable. + */ + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + if (!super.apply(user, target, move, args)) { + return false; + } + + if (target.turnData.acted) { + const suppressAttr = new SuppressAbilitiesAttr(); + if (suppressAttr.getCondition()(user, target, move)) { + suppressAttr.apply(user, target, move, args); + } + } + + return true; + } +} + export class TransformAttr extends MoveEffectAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): Promise { return new Promise(resolve => { @@ -7311,7 +7340,7 @@ export function initMoves() { .attr(MatchUserTypeAttr), new AttackMove(Moves.CORE_ENFORCER, Type.DRAGON, MoveCategory.SPECIAL, 100, 100, 10, -1, 0, 7) .target(MoveTarget.ALL_NEAR_ENEMIES) - .partial(), + .attr(SuppressAbilitiesIfActedAttr), new AttackMove(Moves.TROP_KICK, Type.GRASS, MoveCategory.PHYSICAL, 70, 100, 15, 100, 0, 7) .attr(StatChangeAttr, BattleStat.ATK, -1), new StatusMove(Moves.INSTRUCT, Type.PSYCHIC, -1, 15, -1, 0, 7)