using PkmnLib.Plugin.Gen7.Scripts.Battle;

namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "magic_room")]
public class MagicRoom : Script, IScriptOnSecondaryEffect
{
    /// <inheritdoc />
    public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
    {
        var battleData = move.User.BattleData;
        if (battleData == null)
            return;

        var battle = battleData.Battle;
        battle.Volatile.Add(new MagicRoomEffect());
    }
}