public static void InitializeEasyChat()
        {
            SQLiteCommand    command;
            SQLiteDataReader reader;
            DataTable        table;

            SQLiteConnection connection = new SQLiteConnection("Data Source=ItemDatabase.db");

            connection.Open();

            // Load Gen3 Item Data
            command = new SQLiteCommand("SELECT * FROM EasyChat", connection);
            reader  = command.ExecuteReader();
            table   = new DataTable("EasyChat");
            table.Load(reader);
            foreach (DataRow row in table.Rows)
            {
                ushort id   = (ushort)(long)row["ID"];
                string word = row["Word"] as string;
                easyChatMap.Add(id, word);
                easyChatReverseMap.Add(word, id);
                easyChatList.Add(word);
            }

            // Add Pokemon
            for (ushort i = 1; i <= 386; i++)
            {
                string name      = PokemonDatabase.GetPokemonFromDexID(i).Name;
                ushort speciesID = PokemonDatabase.GetPokemonFromDexID(i).ID;
                easyChatMap.Add(speciesID, name);
                easyChatReverseMap.Add(name, speciesID);
                easyChatMap.Add((ushort)(0x2A00 | speciesID), name);
                easyChatList.Add(name);
            }

            // Add Moves
            for (ushort i = 1; i <= 354; i++)
            {
                string name = PokemonDatabase.GetMoveFromID(i).Name;
                easyChatMap.Add((ushort)(0x2600 | i), name);
                // There one duplicate word, Psychic the type and Psychic the move. Ignore them
                if (!easyChatReverseMap.ContainsKey(name))
                {
                    easyChatReverseMap.Add(name, (ushort)(0x2600 | i));
                }
                easyChatList.Add(name);
            }

            easyChatList.Sort((word1, word2) => string.Compare(word1, word2, CultureInfo.CurrentCulture, CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase));

            connection.Close();
        }
Exemple #2
0
 public StrategyMemoEntry this[ushort dexID] {
     get {
         ushort speciesID = PokemonDatabase.GetPokemonFromDexID(dexID).ID;
         foreach (StrategyMemoEntry entry in entries)
         {
             if (entry.SpeciesID == speciesID)
             {
                 return(entry);
             }
         }
         return(null);
     }
 }
Exemple #3
0
        private void AddAlteringCaveItem(ushort dexID)
        {
            StackPanel stackPanel = new StackPanel();

            stackPanel.Orientation = Orientation.Horizontal;
            Image image = new Image();

            //(form == byte.MaxValue ? 0 : form)
            image.Source              = PokemonDatabase.GetPokemonBoxImageFromDexID(dexID, false);
            image.Stretch             = Stretch.None;
            image.SnapsToDevicePixels = true;
            image.UseLayoutRounding   = true;
            image.Margin              = new Thickness(0, -7, 0, -1);
            TextBlock text = new TextBlock();

            text.Margin            = new Thickness(6, 0, 0, 0);
            text.Text              = PokemonDatabase.GetPokemonFromDexID(dexID).Name;
            text.VerticalAlignment = VerticalAlignment.Center;
            stackPanel.Children.Add(image);
            stackPanel.Children.Add(text);
            comboBoxAlteringCave.Items.Add(stackPanel);
        }
Exemple #4
0
        public void FillPokedex()
        {
            listViewPokemon.Items.Clear();
            for (int i = 1; i <= 386; i++)
            {
                bool living = livingFlags[i - 1];
                bool seen   = gameSave.IsPokemonSeen((ushort)i);
                bool owned  = gameSave.IsPokemonOwned((ushort)i);

                for (int j = 0; j < 28 && (j == 0 || (viewMode == PokedexViewModes.Living && (i == 201 || (j < 4 && i == 386)))); j++)
                {
                    if (viewMode == PokedexViewModes.Living)
                    {
                        if (i == 201)
                        {
                            living = unownLivingFlags[j];
                        }
                        if (i == 386)
                        {
                            living = deoxysLivingFlags[j];
                        }
                    }

                    if ((viewMode == PokedexViewModes.Owned && !owned) ||
                        (viewMode == PokedexViewModes.Seen && !seen) ||
                        (viewMode == PokedexViewModes.Living && !living) ||
                        (viewMode == PokedexViewModes.SeenMissing && seen) ||
                        (viewMode == PokedexViewModes.OwnedMissing && owned) ||
                        (viewMode == PokedexViewModes.LivingMissing && living))
                    {
                        continue;
                    }

                    ListViewItem listViewItem = new ListViewItem();
                    Grid         grid         = new Grid();
                    grid.Height = 28;

                    byte form = 255;
                    if (i == 201)
                    {
                        byte val         = 0;
                        uint personality = gameSave.GetPokedexPokemonPersonality(201);
                        val  = ByteHelper.SetBits(val, 0, ByteHelper.GetBits(personality, 0, 2));
                        val  = ByteHelper.SetBits(val, 2, ByteHelper.GetBits(personality, 8, 2));
                        val  = ByteHelper.SetBits(val, 4, ByteHelper.GetBits(personality, 16, 2));
                        val  = ByteHelper.SetBits(val, 6, ByteHelper.GetBits(personality, 24, 2));
                        form = (byte)(val % 28);
                    }

                    Image boxImage = new Image();
                    boxImage.Source = PokemonDatabase.GetPokemonBoxImageFromDexID((ushort)i, gameSave.IsPokedexPokemonShiny((ushort)i), (viewMode == PokedexViewModes.Living && (i == 201 || i == 386)) ? (byte)j : form);
                    boxImage.Width  = 32;
                    boxImage.Height = 32;
                    boxImage.Margin = new Thickness(-2, -7, -2, -2);
                    boxImage.HorizontalAlignment = HorizontalAlignment.Left;
                    boxImage.VerticalAlignment   = VerticalAlignment.Top;
                    grid.Children.Add(boxImage);

                    if (!seen)
                    {
                        Rectangle boxMask = new Rectangle();
                        boxMask.Width               = 32;
                        boxMask.Height              = 32;
                        boxMask.Margin              = new Thickness(-2, -7, -2, -2);
                        boxMask.OpacityMask         = new ImageBrush(PokemonDatabase.GetPokemonBoxImageFromDexID((ushort)i, false, (viewMode == PokedexViewModes.Living && (i == 201 || i == 386)) ? (byte)j : byte.MaxValue));
                        boxMask.Fill                = new SolidColorBrush(Color.FromArgb(160, 0, 0, 0));
                        boxMask.HorizontalAlignment = HorizontalAlignment.Left;
                        boxMask.VerticalAlignment   = VerticalAlignment.Top;
                        grid.Children.Add(boxMask);
                    }

                    if (seen)
                    {
                        Image ownedImage = new Image();
                        ownedImage.Width  = 9;
                        ownedImage.Height = 9;
                        ownedImage.Margin = new Thickness(32, 10, 0, 0);
                        ownedImage.Source = ResourceDatabase.GetImageFromName(living ? "PokedexPokeballLiving" : (owned ? "PokedexPokeballOwned" : "PokedexEyeSeen"));
                        if (!living && owned && (gameSave.GameType == GameTypes.Colosseum || gameSave.GameType == GameTypes.XD))
                        {
                            ownedImage.Source = ResourceDatabase.GetImageFromName("PokedexRRegistered");
                        }
                        ownedImage.HorizontalAlignment = HorizontalAlignment.Left;
                        ownedImage.VerticalAlignment   = VerticalAlignment.Top;
                        ownedImage.Stretch             = Stretch.None;
                        grid.Children.Add(ownedImage);
                    }

                    Label dexID = new Label();
                    dexID.FontWeight        = FontWeights.Bold;
                    dexID.VerticalAlignment = VerticalAlignment.Center;
                    dexID.Content           = "No" + i.ToString("000");
                    dexID.Margin            = new Thickness(40, 0, 0, 0);
                    grid.Children.Add(dexID);

                    Label name = new Label();
                    name.VerticalAlignment = VerticalAlignment.Center;
                    name.Content           = PokemonDatabase.GetPokemonFromDexID((ushort)i).Name;
                    if (viewMode == PokedexViewModes.Living && (i == 201 || i == 386))
                    {
                        name.Content = PokemonDatabase.GetPokemonFromDexID((ushort)i).GetForm((byte)j).Name;
                    }
                    name.Margin = new Thickness(84, 0, 0, 0);
                    grid.Children.Add(name);

                    listViewItem.Tag     = i;
                    listViewItem.Content = grid;
                    listViewPokemon.Items.Add(listViewItem);
                }
            }
        }
        private void GeneratePID(GBAPokemon pkm, Random random)
        {
            PokemonData pokemonData = PokemonDatabase.GetPokemonFromDexID(DexID);
            byte        genderByte  = pokemonData.GenderRatio;

            BitArray bitsID   = ByteHelper.GetBits((ushort)(pkm.TrainerID ^ pkm.SecretID));
            BitArray bitsPID1 = new BitArray(16);
            BitArray bitsPID2 = new BitArray(16);
            uint     pid      = 0;
            int      tryCount = 0;

            while (true)
            {
                if (IsShiny.HasValue && !IsEgg)
                {
                    if (IsShiny.Value)
                    {
                        for (int i = 0; i < 3; i++)
                        {
                            bitsPID1[i] = random.Next(2) == 1;
                            bitsPID2[i] = random.Next(2) == 1;
                        }
                        for (int i = 3; i < 16; i++)
                        {
                            bool bit = random.Next(2) == 1;
                            bitsPID1[i] = (bitsID[i] ? !bit : bit);
                            bitsPID2[i] = bit;
                        }
                        pid             = 0;
                        pid             = ByteHelper.SetBits(pid, 16, bitsPID1);
                        pid             = ByteHelper.SetBits(pid, 0, bitsPID2);
                        pkm.Personality = pid;
                    }
                    else
                    {
                        // The chances of this are astronamically low so we can be lazy and not use an algorithm
                        while (pkm.IsShiny)
                        {
                            pkm.Personality = (uint)random.Next();
                        }
                    }
                }
                else
                {
                    pkm.Personality = (uint)random.Next();
                }

                if ((!Gender.HasValue || pkm.Gender == Gender || genderByte == 255 || genderByte == 254 || genderByte == 0) &&
                    (!NatureID.HasValue || pkm.NatureID == NatureID))
                {
                    break;
                }

                tryCount++;
                // Let's give up (I haven't done the math to see if it's always possible to get all 3 combinations. Plus RNG is a bitch so... we need a failsafe)
                if (tryCount > 5000)
                {
                    break;
                }
            }
        }
        public override void GenerateReward(IGameSave gameSave)
        {
            Random      random      = new Random((int)DateTime.Now.Ticks);
            PokemonData pokemonData = PokemonDatabase.GetPokemonFromDexID(DexID);
            GBAPokemon  pkm         = new GBAPokemon();

            pkm.DexID            = DexID;
            pkm.Personality      = (Personality.HasValue ? Personality.Value : (uint)random.Next());
            pkm.Experience       = PokemonDatabase.GetExperienceFromLevel(pokemonData.ExperienceGroup, (IsEgg ? (byte)5 : Level));
            pkm.IsSecondAbility2 = (IsSecondAbility.HasValue ? IsSecondAbility.Value : (!pokemonData.CanOnlyHaveFirstAbility && random.Next(2) == 1));
            pkm.Nickname         = (Nickname != null ? Nickname : pokemonData.Name.ToUpper());
            pkm.BallCaughtID     = 4;
            pkm.MetLocationID    = 255;
            if (DexID == 151 || DexID == 386)
            {
                pkm.IsFatefulEncounter = true;
            }
            pkm.LevelMet   = (IsEgg ? (byte)0 : Level);
            pkm.Language   = Languages.English;
            pkm.Friendship = (byte)(IsEgg ? 10 : 70);

            // Ownership
            pkm.TrainerName   = (TrainerName != null ? TrainerName : PokeManager.ManagerGameSave.TrainerName);
            pkm.TrainerGender = (TrainerGender.HasValue ? TrainerGender.Value : PokeManager.ManagerGameSave.TrainerGender);
            pkm.TrainerID     = (TrainerID.HasValue ? TrainerID.Value : PokeManager.ManagerGameSave.TrainerID);
            pkm.SecretID      = (SecretID.HasValue ? SecretID.Value : PokeManager.ManagerGameSave.SecretID);
            if (TrainerGender.HasValue && TrainerGender.Value == Genders.Genderless)
            {
                pkm.TrainerGender = (random.Next(2) == 1 ? Genders.Female : Genders.Male);
            }

            if (!Personality.HasValue)
            {
                GeneratePID(pkm, random);
            }

            if (HeldItem != null)
            {
                pkm.HeldItemID = HeldItem[random.Next(HeldItem.Length)];
            }

            if (Conditions != null)
            {
                pkm.Coolness  = Conditions[0];
                pkm.Beauty    = Conditions[1];
                pkm.Cuteness  = Conditions[2];
                pkm.Smartness = Conditions[3];
                pkm.Toughness = Conditions[4];
                pkm.Feel      = Conditions[5];
            }

            pkm.HPIV        = (IVs != null ? IVs[0] : (byte)random.Next(32));
            pkm.AttackIV    = (IVs != null ? IVs[1] : (byte)random.Next(32));
            pkm.DefenseIV   = (IVs != null ? IVs[2] : (byte)random.Next(32));
            pkm.SpAttackIV  = (IVs != null ? IVs[3] : (byte)random.Next(32));
            pkm.SpDefenseIV = (IVs != null ? IVs[4] : (byte)random.Next(32));
            pkm.SpeedIV     = (IVs != null ? IVs[5] : (byte)random.Next(32));

            if (HiddenPowerDamage.HasValue)
            {
                pkm.SetHiddenPowerDamage(HiddenPowerDamage.Value);
            }
            if (HiddenPowerType.HasValue)
            {
                pkm.SetHiddenPowerType(HiddenPowerType.Value);
            }

            // Teach the Pokemon all of it's default moves
            ushort[] moves = PokemonDatabase.GetMovesLearnedAtLevelRange(pkm, 1, (IsEgg ? (byte)5 : Level));
            foreach (ushort moveID in moves)
            {
                if (!PokemonDatabase.PokemonHasMove(pkm, moveID))
                {
                    if (pkm.NumMoves < 4)
                    {
                        pkm.SetMoveAt(pkm.NumMoves, new Move(moveID));
                    }
                    else
                    {
                        for (int i = 0; i < 3; i++)
                        {
                            pkm.SetMoveAt(i, pkm.GetMoveAt(i + 1));
                        }
                        pkm.SetMoveAt(3, new Move(moveID));
                    }
                }
            }
            if (Move1ID.HasValue)
            {
                pkm.SetMoveAt(0, new Move(Move1ID.Value));
            }
            if (Move2ID.HasValue)
            {
                pkm.SetMoveAt(1, new Move(Move2ID.Value));
            }
            if (Move3ID.HasValue)
            {
                pkm.SetMoveAt(2, new Move(Move3ID.Value));
            }
            if (Move4ID.HasValue)
            {
                pkm.SetMoveAt(3, new Move(Move4ID.Value));
            }

            GameTypes gameType = gameSave.GameType;

            if (gameType == GameTypes.Ruby)
            {
                pkm.GameOrigin = GameOrigins.Ruby;
            }
            else if (gameType == GameTypes.Sapphire)
            {
                pkm.GameOrigin = GameOrigins.Sapphire;
            }
            else if (gameType == GameTypes.Emerald)
            {
                pkm.GameOrigin = GameOrigins.Emerald;
            }
            else if (gameType == GameTypes.FireRed)
            {
                pkm.GameOrigin = GameOrigins.FireRed;
            }
            else if (gameType == GameTypes.LeafGreen)
            {
                pkm.GameOrigin = GameOrigins.LeafGreen;
            }
            else if (gameType == GameTypes.Colosseum ||
                     gameType == GameTypes.XD)
            {
                pkm.GameOrigin = GameOrigins.ColosseumXD;
            }
            else
            {
                pkm.GameOrigin = GameOrigins.Emerald;
            }

            pkm.GameType = gameType;
            pkm.Checksum = pkm.CalculateChecksum();
            pkm.RecalculateStats();
            reward = pkm;
        }
Exemple #7
0
        private void FillGridItem(ushort dexID)
        {
            Grid grid = stackPanelList.Children[dexID - 1] as Grid;

            grid.Width = double.NaN;
            grid.HorizontalAlignment = HorizontalAlignment.Stretch;
            grid.Height           = 64 + 18;
            grid.IsHitTestVisible = true;
            grid.Background       = new SolidColorBrush(Color.FromRgb(255, 255, 255));
            grid.Children.Clear();

            Label labelName = new Label();

            if (dexID == 387)
            {
                labelName.Content = "Egg - Pokémon Egg";
            }
            else
            {
                labelName.Content = "No" + dexID.ToString("000") + " - " + PokemonDatabase.GetPokemonFromDexID(dexID).Name;
            }
            labelName.Padding           = new Thickness(5, 1, 5, 1);
            labelName.FontWeight        = FontWeights.Bold;
            labelName.VerticalAlignment = VerticalAlignment.Top;
            labelName.IsHitTestVisible  = false;

            StackPanel stackPanel = new StackPanel();

            stackPanel.Margin = new Thickness(0, 18, 0, 0);
            stackPanel.HorizontalAlignment = HorizontalAlignment.Stretch;
            stackPanel.VerticalAlignment   = VerticalAlignment.Stretch;
            stackPanel.Orientation         = Orientation.Horizontal;
            stackPanel.Height = 64;
            stackPanel.Width  = double.NaN;

            bool hasFRLG   = PokemonDatabase.HasPokemonImageType(dexID, FrontSpriteSelectionTypes.FRLG, shinyMode);
            bool hasCustom = PokemonDatabase.HasPokemonImageType(dexID, FrontSpriteSelectionTypes.Custom, shinyMode);

            stackPanel.Children.Add(CreateSpriteSelection(dexID, FrontSpriteSelectionTypes.RSE));
            if (hasFRLG)
            {
                stackPanel.Children.Add(CreateSpriteSelection(dexID, FrontSpriteSelectionTypes.FRLG));
            }
            else
            {
                stackPanel.Children.Add(CreateBlankSpriteSelection(dexID, FrontSpriteSelectionTypes.FRLG));
            }
            if (hasCustom)
            {
                stackPanel.Children.Add(CreateSpriteSelection(dexID, FrontSpriteSelectionTypes.Custom));
            }
            else
            {
                stackPanel.Children.Add(CreateBlankSpriteSelection(dexID, FrontSpriteSelectionTypes.Custom));
            }

            grid.Children.Add(stackPanel);
            grid.Children.Add(labelName);

            grid.Visibility = ((!hasFRLG && !hasCustom) ? Visibility.Collapsed : Visibility.Visible);
            grid.Tag        = dexID;
        }
        private void PopulateComboBoxes()
        {
            bool oldLoaded = loaded;

            loaded = false;

            AddComparisonComboBoxItems(comboBoxHatchCounterComparison);
            AddComparisonComboBoxItems(comboBoxStatComparison);
            AddComparisonComboBoxItems(comboBoxConditionComparison);
            AddComparisonComboBoxItems(comboBoxIVComparison);
            AddComparisonComboBoxItems(comboBoxEVComparison);
            AddComparisonComboBoxItems(comboBoxLevelComparison);
            AddComparisonComboBoxItems(comboBoxFriendshipComparison);
            AddComparisonComboBoxItems(comboBoxHiddenPowerDamageComparison);

            comboBoxSpecies.Items.Clear();
            for (ushort i = 1; i <= 386; i++)
            {
                AddComboBoxItem(comboBoxSpecies, PokemonDatabase.GetPokemonFromDexID(i).Name, (int)i);
            }

            comboBoxType.Items.Clear();
            for (PokemonTypes i = PokemonTypes.Normal; i <= PokemonTypes.Dark; i++)
            {
                AddComboBoxItem(comboBoxType, i.ToString(), (int)i);
            }

            comboBoxNature.Items.Clear();
            for (byte i = 0; i <= 24; i++)
            {
                AddComboBoxItem(comboBoxNature, PokemonDatabase.GetNatureFromID(i).Name, (int)i);
            }

            comboBoxAbility.Items.Clear();
            for (byte i = 1; i <= 76; i++)
            {
                AddComboBoxItem(comboBoxAbility, PokemonDatabase.GetAbilityFromID(i).Name, (int)i);
            }

            comboBoxHeldItem.Items.Clear();
            AddComboBoxItem(comboBoxHeldItem, "Any", 0);
            for (int i = 1; ItemDatabase.GetItemAt(i) != null; i++)
            {
                ItemData item = ItemDatabase.GetItemAt(i);
                if (!item.IsImportant && item.ID < 500)
                {
                    AddComboBoxItem(comboBoxHeldItem, item.Name, (int)item.ID);
                }
            }

            comboBoxPokeBall.Items.Clear();
            AddComboBoxItem(comboBoxPokeBall, "Poké Ball", 4);
            AddComboBoxItem(comboBoxPokeBall, "Great Ball", 3);
            AddComboBoxItem(comboBoxPokeBall, "Ultra Ball", 2);
            AddComboBoxItem(comboBoxPokeBall, "Master Ball", 1);
            AddComboBoxItem(comboBoxPokeBall, "Safari Ball", 5);
            AddComboBoxItem(comboBoxPokeBall, "Timer Ball", 10);
            AddComboBoxItem(comboBoxPokeBall, "Repeat Ball", 9);
            AddComboBoxItem(comboBoxPokeBall, "Net Ball", 6);
            AddComboBoxItem(comboBoxPokeBall, "Dive Ball", 7);
            AddComboBoxItem(comboBoxPokeBall, "Nest Ball", 8);
            AddComboBoxItem(comboBoxPokeBall, "Premier Ball", 12);
            AddComboBoxItem(comboBoxPokeBall, "Luxury Ball", 11);


            comboBoxRibbon.Items.Clear();
            for (PokemonRibbons i = PokemonRibbons.Any; i <= PokemonRibbons.World; i++)
            {
                // Add spaces to the names
                string        name    = i.ToString();
                StringBuilder newName = new StringBuilder();
                foreach (char c in name)
                {
                    if (char.IsUpper(c) && newName.Length > 0)
                    {
                        newName.Append(' ');
                    }
                    newName.Append(c);
                }
                AddComboBoxItem(comboBoxRibbon, newName.ToString(), (int)i);
            }


            comboBoxPokerus.Items.Clear();
            AddComboBoxItem(comboBoxPokerus, "None", (int)PokerusStatuses.None);
            AddComboBoxItem(comboBoxPokerus, "Infected", (int)PokerusStatuses.Infected);
            AddComboBoxItem(comboBoxPokerus, "Cured", (int)PokerusStatuses.Cured);

            ComboBox[] statComboBoxes = new ComboBox[] { comboBoxStatType, comboBoxIVType, comboBoxEVType };
            for (int i = 0; i < 3; i++)
            {
                statComboBoxes[i].Items.Clear();
                AddComboBoxItem(statComboBoxes[i], "HP", (int)StatTypes.HP);
                AddComboBoxItem(statComboBoxes[i], "Attack", (int)StatTypes.Attack);
                AddComboBoxItem(statComboBoxes[i], "Defense", (int)StatTypes.Defense);
                AddComboBoxItem(statComboBoxes[i], "Sp Attack", (int)StatTypes.SpAttack);
                AddComboBoxItem(statComboBoxes[i], "Sp Defense", (int)StatTypes.SpDefense);
                AddComboBoxItem(statComboBoxes[i], "Speed", (int)StatTypes.Speed);
                AddComboBoxItem(statComboBoxes[i], "Any", (int)StatTypes.Any);
                AddComboBoxItem(statComboBoxes[i], "All", (int)StatTypes.All);
                AddComboBoxItem(statComboBoxes[i], "Total", (int)StatTypes.Total);
            }

            comboBoxConditionType.Items.Clear();
            AddComboBoxItem(comboBoxConditionType, "Cool", (int)ConditionTypes.Cool);
            AddComboBoxItem(comboBoxConditionType, "Beauty", (int)ConditionTypes.Beauty);
            AddComboBoxItem(comboBoxConditionType, "Cute", (int)ConditionTypes.Cute);
            AddComboBoxItem(comboBoxConditionType, "Smart", (int)ConditionTypes.Smart);
            AddComboBoxItem(comboBoxConditionType, "Tough", (int)ConditionTypes.Tough);
            AddComboBoxItem(comboBoxConditionType, "Feel", (int)ConditionTypes.Feel);
            AddComboBoxItem(comboBoxConditionType, "Any", (int)ConditionTypes.Any);
            AddComboBoxItem(comboBoxConditionType, "All", (int)ConditionTypes.All);
            AddComboBoxItem(comboBoxConditionType, "Total", (int)ConditionTypes.Total);

            comboBoxGender.Items.Clear();
            AddComboBoxItem(comboBoxGender, "Male", (int)Genders.Male);
            AddComboBoxItem(comboBoxGender, "Female", (int)Genders.Female);
            AddComboBoxItem(comboBoxGender, "Genderless", (int)Genders.Genderless);

            comboBoxFamily.Items.Clear();
            for (ushort i = 1; i <= 386; i++)
            {
                PokemonData pokemonData = PokemonDatabase.GetPokemonFromDexID(i);
                if (pokemonData.FamilyDexID == i)
                {
                    AddComboBoxItem(comboBoxFamily, pokemonData.Name, (int)i);
                }
            }


            ComboBox[] moveComboBoxes = new ComboBox[] { comboBoxMove1, comboBoxMove2, comboBoxMove3, comboBoxMove4 };
            for (int i = 0; i < 4; i++)
            {
                moveComboBoxes[i].Items.Clear();
                AddComboBoxItem(moveComboBoxes[i], "None", 0);
                for (ushort j = 1; j <= 354; j++)
                {
                    AddComboBoxItem(moveComboBoxes[i], PokemonDatabase.GetMoveFromID(j).Name, (int)j);
                }
            }

            comboBoxHiddenPowerType.Items.Clear();
            for (PokemonTypes i = PokemonTypes.Fighting; i <= PokemonTypes.Dark; i++)
            {
                AddComboBoxItem(comboBoxHiddenPowerType, i.ToString(), (int)i);
            }


            comboBoxEggGroup.Items.Clear();
            for (EggGroups i = EggGroups.Field; i <= EggGroups.Ditto; i++)
            {
                AddComboBoxItem(comboBoxEggGroup, PokemonDatabase.GetEggGroupName(i), (int)i);
            }

            comboBoxEggMode.Items.Clear();
            AddComboBoxItem(comboBoxEggMode, "Include Eggs", (int)EggModes.IncludeEggs);
            AddComboBoxItem(comboBoxEggMode, "Exclude Eggs", (int)EggModes.ExcludeEggs);
            AddComboBoxItem(comboBoxEggMode, "Only Eggs", (int)EggModes.OnlyEggs);

            comboBoxShinyMode.Items.Clear();
            AddComboBoxItem(comboBoxShinyMode, "Include Shinies", (int)ShinyModes.IncludeShinies);
            AddComboBoxItem(comboBoxShinyMode, "Exclude Shinies", (int)ShinyModes.ExcludeShinies);
            AddComboBoxItem(comboBoxShinyMode, "Only Shinies", (int)ShinyModes.OnlyShinies);

            comboBoxShadowMode.Items.Clear();
            AddComboBoxItem(comboBoxShadowMode, "Include Shadow", (int)ShadowModes.IncludeShadow);
            AddComboBoxItem(comboBoxShadowMode, "Exclude Shadow", (int)ShadowModes.ExcludeShadow);
            AddComboBoxItem(comboBoxShadowMode, "Only Shadow", (int)ShadowModes.OnlyShadow);

            comboBoxSortMethod.Items.Clear();
            AddComboBoxItem(comboBoxSortMethod, "None", (int)SortMethods.None);
            AddComboBoxItem(comboBoxSortMethod, "Dex Number", (int)SortMethods.DexNumber);
            AddComboBoxItem(comboBoxSortMethod, "Alphabetical", (int)SortMethods.Alphabetical);
            AddComboBoxItem(comboBoxSortMethod, "Level", (int)SortMethods.Level);
            AddComboBoxItem(comboBoxSortMethod, "Friendship", (int)SortMethods.Friendship);
            AddComboBoxItem(comboBoxSortMethod, "Hatch Counter", (int)SortMethods.HatchCounter);
            AddComboBoxItem(comboBoxSortMethod, "Type", (int)SortMethods.Type);
            AddComboBoxItem(comboBoxSortMethod, "Hidden Power Type", (int)SortMethods.HiddenPowerType);
            AddComboBoxItem(comboBoxSortMethod, "Hidden Power Damage", (int)SortMethods.HiddenPowerDamage);
            AddComboBoxItem(comboBoxSortMethod, "Total Stats", (int)SortMethods.TotalStats);
            AddComboBoxItem(comboBoxSortMethod, "Total IVs", (int)SortMethods.TotalIVs);
            AddComboBoxItem(comboBoxSortMethod, "Total EVs", (int)SortMethods.TotalEVs);
            AddComboBoxItem(comboBoxSortMethod, "Total Conditions", (int)SortMethods.TotalCondition);
            AddComboBoxItem(comboBoxSortMethod, "Ribbon Count", (int)SortMethods.RibbonCount);
            AddComboBoxItem(comboBoxSortMethod, "HP", (int)SortMethods.HP);
            AddComboBoxItem(comboBoxSortMethod, "Attack", (int)SortMethods.Attack);
            AddComboBoxItem(comboBoxSortMethod, "Defense", (int)SortMethods.Defense);
            AddComboBoxItem(comboBoxSortMethod, "Sp Attack", (int)SortMethods.SpAttack);
            AddComboBoxItem(comboBoxSortMethod, "Sp Defense", (int)SortMethods.SpDefense);
            AddComboBoxItem(comboBoxSortMethod, "Speed", (int)SortMethods.Speed);
            AddComboBoxItem(comboBoxSortMethod, "HP IV", (int)SortMethods.HPIV);
            AddComboBoxItem(comboBoxSortMethod, "Attack IV", (int)SortMethods.AttackIV);
            AddComboBoxItem(comboBoxSortMethod, "Defense IV", (int)SortMethods.DefenseIV);
            AddComboBoxItem(comboBoxSortMethod, "Sp Attack IV", (int)SortMethods.SpAttackIV);
            AddComboBoxItem(comboBoxSortMethod, "Sp Defense IV", (int)SortMethods.SpDefenseIV);
            AddComboBoxItem(comboBoxSortMethod, "Speed IV", (int)SortMethods.SpeedIV);
            AddComboBoxItem(comboBoxSortMethod, "HP EV", (int)SortMethods.HPEV);
            AddComboBoxItem(comboBoxSortMethod, "Attack EV", (int)SortMethods.AttackEV);
            AddComboBoxItem(comboBoxSortMethod, "Defense EV", (int)SortMethods.DefenseEV);
            AddComboBoxItem(comboBoxSortMethod, "Sp Attack EV", (int)SortMethods.SpAttackEV);
            AddComboBoxItem(comboBoxSortMethod, "Sp Defense EV", (int)SortMethods.SpDefenseEV);
            AddComboBoxItem(comboBoxSortMethod, "Speed EV", (int)SortMethods.SpeedEV);
            AddComboBoxItem(comboBoxSortMethod, "Coolness", (int)SortMethods.Coolness);
            AddComboBoxItem(comboBoxSortMethod, "Beauty", (int)SortMethods.Beauty);
            AddComboBoxItem(comboBoxSortMethod, "Cuteness", (int)SortMethods.Cuteness);
            AddComboBoxItem(comboBoxSortMethod, "Smartness", (int)SortMethods.Smartness);
            AddComboBoxItem(comboBoxSortMethod, "Toughness", (int)SortMethods.Toughness);
            AddComboBoxItem(comboBoxSortMethod, "Feel", (int)SortMethods.Feel);

            comboBoxSortOrder.Items.Clear();
            AddComboBoxItem(comboBoxSortOrder, "Highest to Lowest", (int)SortOrders.HighestToLowest);
            AddComboBoxItem(comboBoxSortOrder, "Lowest to Highest", (int)SortOrders.LowestToHighest);

            comboBoxSearchMode.Items.Clear();
            AddComboBoxItem(comboBoxSearchMode, "New Search", (int)SearchModes.NewSearch);
            AddComboBoxItem(comboBoxSearchMode, "Add Results", (int)SearchModes.AddResults);
            AddComboBoxItem(comboBoxSearchMode, "Refine Results", (int)SearchModes.RefineResults);

            loaded = oldLoaded;
        }