From d6b8e424829079e48eef2bdf99e8d5a7f626cba3 Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Mon, 20 May 2024 01:26:16 -0400 Subject: [PATCH] add cheek pouch trigger to EatBerryAttr class --- src/data/ability.ts | 2 +- src/data/move.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 2f615da6db4..4657f7d4e74 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2509,7 +2509,7 @@ export class PreventBerryUseAbAttr extends AbAttr { } } -/** + /** * A Pokemon with this ability heals by a percentage of their maximum hp after eating a berry * @param healPercent - Percent of Max HP to heal * @see {@linkcode apply()} for implementation diff --git a/src/data/move.ts b/src/data/move.ts index 2d27afcbe47..925b19a19d7 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -12,7 +12,7 @@ import * as Utils from "../utils"; import { WeatherType } from "./weather"; import { ArenaTagSide, ArenaTrapTag } from "./arena-tag"; import { ArenaTagType } from "./enums/arena-tag-type"; -import { UnswappableAbilityAbAttr, UncopiableAbilityAbAttr, UnsuppressableAbilityAbAttr, NoTransformAbilityAbAttr, BlockRecoilDamageAttr, BlockOneHitKOAbAttr, IgnoreContactAbAttr, MaxMultiHitAbAttr, applyAbAttrs, BlockNonDirectDamageAbAttr, applyPreSwitchOutAbAttrs, PreSwitchOutAbAttr, applyPostDefendAbAttrs, PostDefendContactApplyStatusEffectAbAttr, MoveAbilityBypassAbAttr, ReverseDrainAbAttr, FieldPreventExplosiveMovesAbAttr, ForceSwitchOutImmunityAbAttr, PreventBerryUseAbAttr, BlockItemTheftAbAttr } from "./ability"; +import { UnswappableAbilityAbAttr, UncopiableAbilityAbAttr, UnsuppressableAbilityAbAttr, NoTransformAbilityAbAttr, BlockRecoilDamageAttr, BlockOneHitKOAbAttr, IgnoreContactAbAttr, MaxMultiHitAbAttr, applyAbAttrs, BlockNonDirectDamageAbAttr, applyPreSwitchOutAbAttrs, PreSwitchOutAbAttr, applyPostDefendAbAttrs, PostDefendContactApplyStatusEffectAbAttr, MoveAbilityBypassAbAttr, ReverseDrainAbAttr, FieldPreventExplosiveMovesAbAttr, ForceSwitchOutImmunityAbAttr, PreventBerryUseAbAttr, BlockItemTheftAbAttr, HealFromBerryUseAbAttr } from "./ability"; import { Abilities } from "./enums/abilities"; import { allAbilities } from './ability'; import { PokemonHeldItemModifier, BerryModifier, PreserveBerryModifier } from "../modifier/modifier"; @@ -1517,9 +1517,14 @@ export class EatBerryAttr extends MoveEffectAttr { if (!--this.chosenBerry.stackCount) target.scene.removeModifier(this.chosenBerry, !target.isPlayer()); target.scene.updateModifiers(target.isPlayer()); -} + } + this.chosenBerry = undefined; + if (target.hasAbilityWithAttr(HealFromBerryUseAbAttr)) { + applyAbAttrs(HealFromBerryUseAbAttr, target, new Utils.BooleanHolder(false)); + } + return true; }