namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
///
/// Comatose is an ability that makes the Pokémon always be in a sleep state, but still able to attack.
/// The Pokémon cannot be affected by other status conditions, and moves that would normally fail on sleeping Pokémon
/// will work normally. The Pokémon will still be affected by sleep-related moves and abilities.
///
/// Bulbapedia - Comatose
///
[Script(ScriptCategory.Ability, "comatose")]
public class Comatose : Script
{
///
public override void PreventStatusChange(IPokemon pokemon, StringKey status, bool selfInflicted,
ref bool preventStatus)
{
if (status == ScriptUtils.ResolveName())
{
preventStatus = true;
}
}
///
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
{
if (eventName == CustomTriggers.BypassSleep && args is CustomTriggers.BypassSleepArgs bypassArgs)
{
bypassArgs.Bypass = true;
}
}
}