示例#1
0
        private void ForgetMoveSelected(string option, int index)
        {
            _moveSelectBox.OptionSelected -= ForgetMoveSelected;
            if (index == _pokemon.Moves.Length)
            {
                // canceled selection
                ShowStopLearning();
            }
            else
            {
                var oldMove = _pokemon.Moves[index];

                if (oldMove.GetMove().IsHM)
                {
                    // can't forget hm moves
                    _textbox.Show("HM moves can^t be\nforgotten now.");
                    _textbox.Closed += HMWarningClosed;
                }
                else
                {
                    _pokemon.RemoveMove(index);
                    _pokemon.AddMove(_moveData);
                    var name = _pokemon.DisplayName;
                    var move = _moveData.name;
                    _textbox.Show($"1, 2 and^.. Poof!\n\n{name} forgot\n{oldMove.name}.\n\nAnd^..\n\n{name} learned\n{move}!");
                    _textbox.Closed += ForgetMoveClosed;
                }
            }
        }