mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-01 14:02:18 +02:00
add cheek pouch trigger to EatBerryAttr class
This commit is contained in:
parent
6dd85672ec
commit
d6b8e42482
@ -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
|
* 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
|
* @param healPercent - Percent of Max HP to heal
|
||||||
* @see {@linkcode apply()} for implementation
|
* @see {@linkcode apply()} for implementation
|
||||||
|
@ -12,7 +12,7 @@ import * as Utils from "../utils";
|
|||||||
import { WeatherType } from "./weather";
|
import { WeatherType } from "./weather";
|
||||||
import { ArenaTagSide, ArenaTrapTag } from "./arena-tag";
|
import { ArenaTagSide, ArenaTrapTag } from "./arena-tag";
|
||||||
import { ArenaTagType } from "./enums/arena-tag-type";
|
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 { Abilities } from "./enums/abilities";
|
||||||
import { allAbilities } from './ability';
|
import { allAbilities } from './ability';
|
||||||
import { PokemonHeldItemModifier, BerryModifier, PreserveBerryModifier } from "../modifier/modifier";
|
import { PokemonHeldItemModifier, BerryModifier, PreserveBerryModifier } from "../modifier/modifier";
|
||||||
@ -1517,9 +1517,14 @@ export class EatBerryAttr extends MoveEffectAttr {
|
|||||||
if (!--this.chosenBerry.stackCount)
|
if (!--this.chosenBerry.stackCount)
|
||||||
target.scene.removeModifier(this.chosenBerry, !target.isPlayer());
|
target.scene.removeModifier(this.chosenBerry, !target.isPlayer());
|
||||||
target.scene.updateModifiers(target.isPlayer());
|
target.scene.updateModifiers(target.isPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.chosenBerry = undefined;
|
this.chosenBerry = undefined;
|
||||||
|
|
||||||
|
if (target.hasAbilityWithAttr(HealFromBerryUseAbAttr)) {
|
||||||
|
applyAbAttrs(HealFromBerryUseAbAttr, target, new Utils.BooleanHolder(false));
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user