namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
///
/// Insomnia is an ability that prevents the Pokémon from falling asleep.
///
/// Bulbapedia - Insomnia
///
[Script(ScriptCategory.Ability, "insomnia")]
public class Insomnia : Script, IScriptPreventStatusChange
{
///
public void PreventStatusChange(IPokemon pokemon, StringKey status, bool selfInflicted, ref bool preventStatus)
{
if (status != ScriptUtils.ResolveName())
return;
pokemon.BattleData?.Battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon));
preventStatus = true;
}
}