public void SwitchOut(Pokemon switchIn)
        {
            OnSwitchedOut(switchIn);

            if (IsBadlyPoisoned)
            {
                Pokemon.ChangeBadlyPoisonToPoison();
            }

            DetachPokemonEventHandlers();
            Pokemon = switchIn;
            AttachPokemonEventHandlers();

            TwoTurnMove?.Abort();
            TwoTurnMove = null;
            MultiTurnMove?.Abort();
            MultiTurnMove = null;

            SwitchedPokemonThisTurn = true;
            Seeded = false;
            mimic.Deactivate();
            Conversion.Deactivate();
            Substitute.Deactivate();
            Transform.Deactivate();
            Bide.Deactivate();
            SemiInvulnerable   = false;
            Flinching          = false;
            ConfusionTurnsLeft = 0;
            Disable.Deactivate();
            MistActive = false;
            N          = 1f;

            if (Pokemon.Status == Status.Paralysis)
            {
                ParalysisDecreasingSpeed = true;
            }
            else
            {
                ParalysisDecreasingSpeed = false;
            }

            if (Pokemon.Status == Status.Burn)
            {
                BurnDecreasingAttack = true;
            }
            else
            {
                BurnDecreasingAttack = false;
            }
        }