private void OKClicked(object sender, RoutedEventArgs e)
        {
            for (int i = 0; i < 4; i++)
            {
                if (i < moves.Count)
                {
                    pokemon.SetMoveAt(i, (Move)moves[i].Tag);
                }
                else
                {
                    pokemon.SetMoveAt(i, new Move());
                }
            }

            PokeManager.RefreshUI();
            DialogResult = true;
        }
예제 #2
0
        private void OKClicked(object sender, RoutedEventArgs e)
        {
            Move move = new Move(newMoveID);

            if (selectedIndex >= 0 && selectedIndex < 4)
            {
                pokemon.SetMoveAt(selectedIndex, move);
            }

            PokeManager.RefreshUI();
            DialogResult = true;
        }
예제 #3
0
        private void OnWindowClosing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (playerCry != null)
            {
                playerCry.Close();
            }
            if (playerEvolutionCry != null)
            {
                playerEvolutionCry.Close();
            }
            playerMusic.Close();

            ushort[] moves = PokemonDatabase.GetMovesLearnedAtLevel(pokemon);
            foreach (ushort moveID in moves)
            {
                Move move = new Move(moveID);
                if (pokemon.NumMoves == 4)
                {
                    var result = LearnMoveWindow.ShowDialog(Window.GetWindow(this), pokemon, move.ID);
                    if (result.HasValue && result.Value)
                    {
                        TriggerMessageBox.Show(this, pokemon.Nickname + " learned " + move.MoveData.Name + "!", "Move Learned");
                        PokeManager.RefreshUI();
                    }
                }
                else
                {
                    pokemon.SetMoveAt(pokemon.NumMoves, move);
                    TriggerMessageBox.Show(this, pokemon.Nickname + " learned " + move.MoveData.Name + "!", "Move Learned");
                    PokeManager.RefreshUI();
                }
            }

            if (shedinjaAdded)
            {
                TriggerMessageBox.Show(PokeManager.ManagerWindow, "A Shedinja has appeared from the shed exoskeleton of " + pokemon.Nickname, "New Pokémon");
            }
        }
예제 #4
0
        private void OKClicked(object sender, RoutedEventArgs e)
        {
            ushort[] validItemIDs = new ushort[] { 103, 104, 111 };

            Item item = SelectItemWindow.ShowDialog(this, validItemIDs, new ItemTypes[] { ItemTypes.Items }, "Hand Over Valuable", "Hand Over", true);

            if (item != null)
            {
                if (item.ID == 103 && item.Count < 2)
                {
                    TriggerMessageBox.Show(this, "2 " + item.ItemData.Name + "s are needed to learn a move. You don't have enough", "Not Enough");
                }
                else
                {
                    if (pokemon.NumMoves == 4)
                    {
                        var result = LearnMoveWindow.ShowDialog(this, pokemon, selectedMove.ID);
                        if (result.HasValue && result.Value)
                        {
                            item.Pocket.TossItemAt(item.Pocket.IndexOf(item), (uint)(item.ID == 103 ? 2 : 1));
                            TriggerMessageBox.Show(this, pokemon.Nickname + " learned " + selectedMove.MoveData.Name + "!", "Move Learned");
                            PokeManager.RefreshUI();
                            DialogResult = true;
                        }
                    }
                    else
                    {
                        pokemon.SetMoveAt(pokemon.NumMoves, selectedMove);
                        item.Pocket.TossItemAt(item.Pocket.IndexOf(item), (uint)(item.ID == 103 ? 2 : 1));
                        TriggerMessageBox.Show(this, pokemon.Nickname + " learned " + selectedMove.MoveData.Name + "!", "Move Learned");
                        PokeManager.RefreshUI();
                        DialogResult = true;
                    }
                }
            }
        }