namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
///
/// Cheek Pouch is an ability that heals the user for 1/3 of its maximum HP after consuming a berry.
/// This effect applies to any berry item consumed by the Pokémon.
///
/// Bulbapedia - Cheek Pouch
///
[Script(ScriptCategory.Ability, "cheek_pouch")]
public class CheekPouch : Script
{
///
public override void OnAfterItemConsume(IPokemon pokemon, IItem item)
{
if (item.Category == ItemCategory.Berry)
{
pokemon.BattleData?.Battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon));
pokemon.Heal(pokemon.MaxHealth / 3);
}
}
}