namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "misty_terrain")]
public class MistyTerrain : Script, IScriptOnSecondaryEffect
{
    /// <inheritdoc />
    public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
    {
        var battle = move.User.BattleData?.Battle;
        if (battle is null)
            return;
        battle.SetTerrain(ScriptUtils.ResolveName<Terrain.MistyTerrain>());
    }
}