namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "wake_up_slap")]
public class WakeUpSlap : Script, IScriptOnSecondaryEffect, IScriptChangeBasePower
{
    /// <inheritdoc />
    public void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
    {
        if (target.HasStatus(ScriptUtils.ResolveName<Status.Sleep>()))
        {
            basePower = basePower.MultiplyOrMax(2);
        }
    }

    /// <inheritdoc />
    public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
    {
        // Wake up the target if it is asleep
        if (target.HasStatus(ScriptUtils.ResolveName<Status.Sleep>()))
        {
            target.ClearStatus();
        }
    }
}