using PkmnLib.Plugin.Gen7.Scripts.Battle;

namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "water_sport")]
public class WaterSport : Script, IScriptOnSecondaryEffect
{
    /// <inheritdoc />
    public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
    {
        var effect = move.Battle.Volatile.Add(new WaterSportEffect());
        if (effect?.Script is WaterSportEffect waterSportEffect)
        {
            waterSportEffect.Placers.Add(move.User);
        }
    }
}