namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "simple_beam")]
public class SimpleBeam : Script, IScriptOnSecondaryEffect
{
    /// <inheritdoc />
    public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
    {
        if (!move.Battle.Library.StaticLibrary.Abilities.TryGet("simple", out var simpleAbility))
        {
            move.GetHitData(target, hit).Fail();
            return;
        }
        target.ChangeAbility(simpleAbility);
    }
}