From 6d9424e43158123f9bceff53f5499f53f59ea694 Mon Sep 17 00:00:00 2001 From: Xavion3 Date: Thu, 2 May 2024 14:22:30 +1000 Subject: [PATCH] Implement Gastro Acid (#393) --- src/data/move.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/data/move.ts b/src/data/move.ts index ad1ae31c0..e1694ede8 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -3594,6 +3594,25 @@ export class SwitchAbilitiesAttr extends MoveEffectAttr { } } +export class SuppressAbilitiesAttr extends MoveEffectAttr { + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + if (!super.apply(user, target, move, args)) + return false; + + target.summonData.abilitySuppressed = true; + + target.scene.queueMessage(getPokemonMessage(target, ` ability\nwas suppressed!`)); + + return true; + } + + getCondition(): MoveConditionFunc { + return (user, target, move) => !target.getAbility().hasAttr(UnsuppressableAbilityAbAttr); + } +} + + + export class TransformAttr extends MoveEffectAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): Promise { return new Promise(resolve => { @@ -4831,7 +4850,7 @@ export function initMoves() { new SelfStatusMove(Moves.POWER_TRICK, Type.PSYCHIC, -1, 10, -1, 0, 4) .unimplemented(), new StatusMove(Moves.GASTRO_ACID, Type.POISON, 100, 10, -1, 0, 4) - .unimplemented(), + .attr(SuppressAbilitiesAttr), new StatusMove(Moves.LUCKY_CHANT, Type.NORMAL, -1, 30, -1, 0, 4) .attr(AddBattlerTagAttr, BattlerTagType.NO_CRIT, false, false, 5) .target(MoveTarget.USER_SIDE)