using PkmnLib.Plugin.Gen7.Scripts.Weather;

namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "rain_dance")]
public class RainDance : Script, IScriptOnSecondaryEffect
{
    /// <inheritdoc />
    public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
    {
        var battleData = move.User.BattleData;
        if (battleData == null)
            return;
        battleData.Battle.SetWeather(ScriptUtils.ResolveName<Rain>(), 5);
    }
}