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();
        }
Beispiel #2
0
        public void SetCurrentMove(int moveIndex)
        {
            MoveData moveData = null;

            currentMoveIndex                 = moveIndex;
            rectMove1.Stroke                 = new SolidColorBrush(Color.FromRgb(70, 95, 191));
            rectMove2.Stroke                 = new SolidColorBrush(Color.FromRgb(70, 95, 191));
            rectMove3.Stroke                 = new SolidColorBrush(Color.FromRgb(70, 95, 191));
            rectMove4.Stroke                 = new SolidColorBrush(Color.FromRgb(70, 95, 191));
            rectContestMove1.Stroke          = new SolidColorBrush(Color.FromRgb(141, 77, 185));
            rectContestMove2.Stroke          = new SolidColorBrush(Color.FromRgb(141, 77, 185));
            rectContestMove3.Stroke          = new SolidColorBrush(Color.FromRgb(141, 77, 185));
            rectContestMove4.Stroke          = new SolidColorBrush(Color.FromRgb(141, 77, 185));
            rectMove1.StrokeThickness        = 1;
            rectMove2.StrokeThickness        = 1;
            rectMove3.StrokeThickness        = 1;
            rectMove4.StrokeThickness        = 1;
            rectContestMove1.StrokeThickness = 1;
            rectContestMove2.StrokeThickness = 1;
            rectContestMove3.StrokeThickness = 1;
            rectContestMove4.StrokeThickness = 1;
            if (moveIndex == -1)
            {
                this.textBlockMoveDescription.Text        = "";
                this.labelMovePower.Content               = "";
                this.labelMoveAccuracy.Content            = "";
                this.labelMoveCategory.Content            = "";
                this.textBlockContestMoveDescription.Text = "";
                this.labelMoveAppeal.Content              = "";
                this.labelMoveJam.Content = "";
                return;
            }
            else if (moveIndex == 0)
            {
                moveData                         = PokemonDatabase.GetMoveFromID(pokemon.Move1ID);
                rectMove1.Stroke                 = new SolidColorBrush(Color.FromRgb(255, 0, 0));
                rectContestMove1.Stroke          = new SolidColorBrush(Color.FromRgb(255, 0, 0));
                rectMove1.StrokeThickness        = 2;
                rectContestMove1.StrokeThickness = 2;
            }
            else if (moveIndex == 1)
            {
                moveData                         = PokemonDatabase.GetMoveFromID(pokemon.Move2ID);
                rectMove2.Stroke                 = new SolidColorBrush(Color.FromRgb(255, 0, 0));
                rectContestMove2.Stroke          = new SolidColorBrush(Color.FromRgb(255, 0, 0));
                rectMove2.StrokeThickness        = 2;
                rectContestMove2.StrokeThickness = 2;
            }
            else if (moveIndex == 2)
            {
                moveData                         = PokemonDatabase.GetMoveFromID(pokemon.Move3ID);
                rectMove3.Stroke                 = new SolidColorBrush(Color.FromRgb(255, 0, 0));
                rectContestMove3.Stroke          = new SolidColorBrush(Color.FromRgb(255, 0, 0));
                rectMove3.StrokeThickness        = 2;
                rectContestMove3.StrokeThickness = 2;
            }
            else if (moveIndex == 3)
            {
                moveData                         = PokemonDatabase.GetMoveFromID(pokemon.Move4ID);
                rectMove4.Stroke                 = new SolidColorBrush(Color.FromRgb(255, 0, 0));
                rectContestMove4.Stroke          = new SolidColorBrush(Color.FromRgb(255, 0, 0));
                rectMove4.StrokeThickness        = 2;
                rectContestMove4.StrokeThickness = 2;
            }
            this.textBlockMoveDescription.Text        = moveData.Description;
            this.labelMovePower.Content               = (moveData.Power != 0 ? moveData.Power.ToString() : "---");
            this.labelMoveAccuracy.Content            = (moveData.Accuracy != 0 ? moveData.Accuracy.ToString() : "---");
            this.labelMoveCategory.Content            = moveData.Category.ToString();
            this.textBlockContestMoveDescription.Text = moveData.ContestDescription;
            this.labelMoveAppeal.Content              = moveData.Appeal.ToString();
            this.labelMoveJam.Content = moveData.Jam.ToString();
        }
Beispiel #3
0
        public void LoadPokemon(IPokemon pokemon)
        {
            this.gameIndex            = PokeManager.GetIndexOfGame(pokemon.GameSave);
            this.currentMoveIndex     = -1;
            this.pokemon              = pokemon;
            this.imagePokemon.Source  = pokemon.Sprite;
            this.imagePokemon2.Source = pokemon.Sprite;
            if (pokemon.IsShadowPokemon)
            {
                this.rectShadowMask.OpacityMask  = new ImageBrush(this.imagePokemon.Source);
                this.rectShadowMask2.OpacityMask = new ImageBrush(this.imagePokemon.Source);
                this.rectShadowMask.Visibility   = Visibility.Visible;
                this.rectShadowMask2.Visibility  = Visibility.Visible;
                this.imageShadowAura.Visibility  = Visibility.Visible;
                this.imageShadowAura2.Visibility = Visibility.Visible;
            }
            else
            {
                this.rectShadowMask.Visibility   = Visibility.Hidden;
                this.rectShadowMask2.Visibility  = Visibility.Hidden;
                this.imageShadowAura.Visibility  = Visibility.Hidden;
                this.imageShadowAura2.Visibility = Visibility.Hidden;
            }
            this.imageShinyStar.Visibility  = (pokemon.IsShiny ? Visibility.Visible : Visibility.Hidden);
            this.imageShinyStar2.Visibility = (pokemon.IsShiny ? Visibility.Visible : Visibility.Hidden);
            this.imageBallCaught.Source     = PokemonDatabase.GetBallCaughtImageFromID(pokemon.BallCaughtID);
            this.imageBallCaught2.Source    = PokemonDatabase.GetBallCaughtImageFromID(pokemon.BallCaughtID);


            if (pokemon.IsEgg)
            {
                this.labelNickname.Content = "EGG";
            }
            else
            {
                this.labelNickname.Content = pokemon.Nickname;
            }
            this.labelLevel.Content = "Lv " + pokemon.Level.ToString();
            if (pokemon.Gender == Genders.Male)
            {
                this.labelGender.Content    = "♂";
                this.labelGender.Foreground = new SolidColorBrush(Color.FromRgb(0, 136, 184));
            }
            else if (pokemon.Gender == Genders.Female)
            {
                this.labelGender.Content    = "♀";
                this.labelGender.Foreground = new SolidColorBrush(Color.FromRgb(184, 88, 80));
            }
            else
            {
                this.labelGender.Content = "";
            }

            if (pokemon.IsEgg)
            {
                this.labelOTName.Content    = "?????";
                this.labelOTName.Foreground = new SolidColorBrush(Color.FromRgb(0, 0, 0));
                this.labelOTID.Content      = "?????";
                this.labelSecretID.Content  = "?????";
            }
            else
            {
                this.labelOTName.Content = pokemon.TrainerName;
                if (pokemon.TrainerGender == Genders.Male)
                {
                    this.labelOTName.Foreground = new SolidColorBrush(Color.FromRgb(0, 136, 184));
                }
                else if (pokemon.TrainerGender == Genders.Female)
                {
                    this.labelOTName.Foreground = new SolidColorBrush(Color.FromRgb(184, 88, 80));
                }
                this.labelOTID.Content     = pokemon.TrainerID.ToString("00000");
                this.labelSecretID.Content = pokemon.SecretID.ToString("00000");
            }

            if (pokemon.HasForm)
            {
                this.labelSpeciesName.Content = pokemon.PokemonFormData.Name;
            }
            else
            {
                this.labelSpeciesName.Content = pokemon.PokemonData.Name;
            }
            this.labelSpeciesNumber.Content = "No. " + pokemon.DexID.ToString("000");

            this.labelHPIV.Content        = pokemon.HPIV.ToString();
            this.labelAttackIV.Content    = pokemon.AttackIV.ToString();
            this.labelDefenseIV.Content   = pokemon.DefenseIV.ToString();
            this.labelSpAttackIV.Content  = pokemon.SpAttackIV.ToString();
            this.labelSpDefenseIV.Content = pokemon.SpDefenseIV.ToString();
            this.labelSpeedIV.Content     = pokemon.SpeedIV.ToString();

            this.labelHPEV.Content        = pokemon.HPEV.ToString();
            this.labelAttackEV.Content    = pokemon.AttackEV.ToString();
            this.labelDefenseEV.Content   = pokemon.DefenseEV.ToString();
            this.labelSpAttackEV.Content  = pokemon.SpAttackEV.ToString();
            this.labelSpDefenseEV.Content = pokemon.SpDefenseEV.ToString();
            this.labelSpeedEV.Content     = pokemon.SpeedEV.ToString();

            this.labelHPStat.Content        = pokemon.HP.ToString();
            this.labelAttackStat.Content    = pokemon.Attack.ToString();
            this.labelDefenseStat.Content   = pokemon.Defense.ToString();
            this.labelSpAttackStat.Content  = pokemon.SpAttack.ToString();
            this.labelSpDefenseStat.Content = pokemon.SpDefense.ToString();
            this.labelSpeedStat.Content     = pokemon.Speed.ToString();

            this.labelCool.Content   = pokemon.Coolness.ToString();
            this.labelBeauty.Content = pokemon.Beauty.ToString();
            this.labelCute.Content   = pokemon.Cuteness.ToString();
            this.labelSmart.Content  = pokemon.Smartness.ToString();
            this.labelTough.Content  = pokemon.Toughness.ToString();
            this.labelFeel.Content   = pokemon.Feel.ToString();

            if (pokemon.Move1ID != 0)
            {
                this.labelMove1Name.Content        = PokemonDatabase.GetMoveFromID(pokemon.Move1ID).Name;
                this.labelMove1PP.Content          = pokemon.Move1TotalPP.ToString();
                this.typeMove1.Type                = PokemonDatabase.GetMoveFromID(pokemon.Move1ID).Type;
                this.typeMove1.Visibility          = Visibility.Visible;
                this.labelContestMove1Name.Content = PokemonDatabase.GetMoveFromID(pokemon.Move1ID).Name;
                this.labelContestMove1PP.Content   = (pokemon.Move1Data.PP == 0 ? "--" : pokemon.Move1TotalPP.ToString());
                this.conditionMove1.Type           = PokemonDatabase.GetMoveFromID(pokemon.Move1ID).ConditionType;
                this.conditionMove1.Visibility     = Visibility.Visible;
            }
            else
            {
                this.labelMove1Name.Content        = "-";
                this.labelMove1PP.Content          = "--";
                this.typeMove1.Visibility          = Visibility.Hidden;
                this.labelContestMove1Name.Content = "-";
                this.labelContestMove1PP.Content   = "--";
                this.conditionMove1.Visibility     = Visibility.Hidden;
            }
            if (pokemon.Move2ID != 0)
            {
                this.labelMove2Name.Content        = PokemonDatabase.GetMoveFromID(pokemon.Move2ID).Name;
                this.labelMove2PP.Content          = pokemon.Move2TotalPP.ToString();
                this.typeMove2.Type                = PokemonDatabase.GetMoveFromID(pokemon.Move2ID).Type;
                this.typeMove2.Visibility          = Visibility.Visible;
                this.labelContestMove2Name.Content = PokemonDatabase.GetMoveFromID(pokemon.Move2ID).Name;
                this.labelContestMove2PP.Content   = (pokemon.Move2Data.PP == 0 ? "--" : pokemon.Move2TotalPP.ToString());
                this.conditionMove2.Type           = PokemonDatabase.GetMoveFromID(pokemon.Move2ID).ConditionType;
                this.conditionMove2.Visibility     = Visibility.Visible;
            }
            else
            {
                this.labelMove2Name.Content        = "-";
                this.labelMove2PP.Content          = "--";
                this.typeMove2.Visibility          = Visibility.Hidden;
                this.labelContestMove2Name.Content = "-";
                this.labelContestMove2PP.Content   = "--";
                this.conditionMove2.Visibility     = Visibility.Hidden;
            }
            if (pokemon.Move3ID != 0)
            {
                this.labelMove3Name.Content        = PokemonDatabase.GetMoveFromID(pokemon.Move3ID).Name;
                this.labelMove3PP.Content          = pokemon.Move3TotalPP.ToString();
                this.typeMove3.Type                = PokemonDatabase.GetMoveFromID(pokemon.Move3ID).Type;
                this.typeMove3.Visibility          = Visibility.Visible;
                this.labelContestMove3Name.Content = PokemonDatabase.GetMoveFromID(pokemon.Move3ID).Name;
                this.labelContestMove3PP.Content   = (pokemon.Move3Data.PP == 0 ? "--" : pokemon.Move3TotalPP.ToString());
                this.conditionMove3.Type           = PokemonDatabase.GetMoveFromID(pokemon.Move3ID).ConditionType;
                this.conditionMove3.Visibility     = Visibility.Visible;
            }
            else
            {
                this.labelMove3Name.Content        = "-";
                this.labelMove3PP.Content          = "--";
                this.typeMove3.Visibility          = Visibility.Hidden;
                this.labelContestMove3Name.Content = "-";
                this.labelContestMove3PP.Content   = "--";
                this.conditionMove3.Visibility     = Visibility.Hidden;
            }
            if (pokemon.Move4ID != 0)
            {
                this.labelMove4Name.Content        = PokemonDatabase.GetMoveFromID(pokemon.Move4ID).Name;
                this.labelMove4PP.Content          = pokemon.Move4TotalPP.ToString();
                this.typeMove4.Type                = PokemonDatabase.GetMoveFromID(pokemon.Move4ID).Type;
                this.typeMove4.Visibility          = Visibility.Visible;
                this.labelContestMove4Name.Content = PokemonDatabase.GetMoveFromID(pokemon.Move4ID).Name;
                this.labelContestMove4PP.Content   = (pokemon.Move4Data.PP == 0 ? "--" : pokemon.Move4TotalPP.ToString());
                this.conditionMove4.Type           = PokemonDatabase.GetMoveFromID(pokemon.Move4ID).ConditionType;
                this.conditionMove4.Visibility     = Visibility.Visible;
            }
            else
            {
                this.labelMove4Name.Content        = "-";
                this.labelMove4PP.Content          = "--";
                this.typeMove4.Visibility          = Visibility.Hidden;
                this.labelContestMove4Name.Content = "-";
                this.labelContestMove4PP.Content   = "--";
                this.conditionMove4.Visibility     = Visibility.Hidden;
            }

            if (pokemon.IsHoldingItem)
            {
                this.imageHeldItem.Source  = ItemDatabase.GetItemImageFromID(pokemon.HeldItemID);
                this.labelHeldItem.Content = ItemDatabase.GetItemFromID(pokemon.HeldItemID).Name;
            }
            else
            {
                this.imageHeldItem.Source  = null;
                this.labelHeldItem.Content = "None";
            }
            if (pokemon.IsEgg)
            {
                this.labelFriendshipText.Content = "Hatch Counter";
                this.labelFriendship.Content     = pokemon.Friendship.ToString() + " Cycles";
            }
            else
            {
                this.labelFriendshipText.Content = "Friendship";
                this.labelFriendship.Content     = pokemon.Friendship.ToString();
            }


            this.labelNature.Content        = pokemon.NatureData.Name;
            this.labelNatureRaised.Content  = "+" + pokemon.NatureData.RaisedStat.ToString();
            this.labelNatureLowered.Content = "-" + pokemon.NatureData.LoweredStat.ToString();

            this.labelAbility.Content             = pokemon.AbilityData.Name;
            this.textBlockAbilityDescription.Text = pokemon.AbilityData.Description;

            if (pokemon.IsShadowPokemon)
            {
                uint totalPurification = pokemon.HeartGauge;
                uint levelStartExp     = PokemonDatabase.GetExperienceFromLevel(pokemon.PokemonData.ExperienceGroup, pokemon.Level);
                this.labelNextLevelText.Content    = "Exp Stored";
                this.labelNextLevel.Content        = pokemon.ExperienceStored.ToString() + " (+" + (PokemonDatabase.GetLevelFromExperience(pokemon.PokemonData.ExperienceGroup, pokemon.Experience + pokemon.ExperienceStored) - pokemon.Level).ToString() + ")";
                this.labelTotalExperience.Content  = pokemon.Experience.ToString();
                this.labelExperienceText2.Content  = "Heart Gauge";
                this.labelTotalExperience2.Content = pokemon.Purification.ToString();

                double ratio = (double)Math.Max(0, pokemon.Purification) / (double)totalPurification;
                LinearGradientBrush purBrush = new LinearGradientBrush();
                purBrush.GradientStops.Add(new GradientStop(Color.FromRgb(160, 72, 220), 0));
                purBrush.GradientStops.Add(new GradientStop(Color.FromRgb(160, 72, 220), ratio));
                purBrush.GradientStops.Add(new GradientStop(Color.FromRgb(225, 235, 250), ratio));
                purBrush.GradientStops.Add(new GradientStop(Color.FromRgb(225, 235, 250), 1));
                this.rectExperienceBar.Fill = purBrush;

                this.rectPurificationBorder1.Visibility = Visibility.Visible;
                this.rectPurificationBorder2.Visibility = Visibility.Visible;
            }
            else
            {
                this.labelExperienceText.Content   = "Experience";
                this.labelNextLevelText.Content    = "Next Level";
                this.labelExperienceText2.Content  = "";
                this.labelTotalExperience2.Content = "";
                uint levelStartExp = PokemonDatabase.GetExperienceFromLevel(pokemon.PokemonData.ExperienceGroup, pokemon.Level);
                uint levelNextExp  = PokemonDatabase.GetExperienceFromLevel(pokemon.PokemonData.ExperienceGroup, (byte)Math.Min(100, (int)pokemon.Level + 1));
                this.labelTotalExperience.Content = pokemon.Experience.ToString();
                this.labelNextLevel.Content       = (levelNextExp - levelStartExp).ToString();

                double ratio = (double)(pokemon.Experience - levelStartExp) / (double)(levelNextExp - levelStartExp);
                LinearGradientBrush expBrush = new LinearGradientBrush();
                expBrush.GradientStops.Add(new GradientStop(Color.FromRgb(0, 160, 220), 0));
                expBrush.GradientStops.Add(new GradientStop(Color.FromRgb(0, 160, 220), ratio));
                expBrush.GradientStops.Add(new GradientStop(Color.FromRgb(100, 100, 100), ratio));
                expBrush.GradientStops.Add(new GradientStop(Color.FromRgb(100, 100, 100), 1));
                this.rectExperienceBar.Fill = expBrush;

                this.rectPurificationBorder1.Visibility = Visibility.Hidden;
                this.rectPurificationBorder2.Visibility = Visibility.Hidden;
            }

            this.labelPokerus.Content = pokemon.PokerusStatus.ToString();

            if (pokemon.IsEgg)
            {
                this.labelMetAtText.Content     = "Waiting to Hatch";
                this.labelMetAtLevel.Content    = "";
                this.labelMetAtLocation.Content = "";
                this.labelGame.Content          = "";
            }
            else
            {
                if (pokemon.LevelMet == 0)
                {
                    this.labelMetAtText.Content  = "Hatched At";
                    this.labelMetAtLevel.Content = "Lv 5";
                }
                else
                {
                    this.labelMetAtText.Content  = (pokemon.IsFatefulEncounter ? "Fateful Encounter At" : "Met At");
                    this.labelMetAtLevel.Content = "Lv " + pokemon.LevelMet.ToString();
                }
                this.labelMetAtLocation.Content = (pokemon.GameOrigin == GameOrigins.ColosseumXD ? "Orre Region" : PokemonDatabase.GetMetLocationFromID(pokemon.MetLocationID));
                this.labelGame.Content          = pokemon.GameOrigin.ToString() + " (" + pokemon.Language.ToString() + ")";
            }

            this.type1Pokemon.Type = pokemon.PokemonData.Type1;
            if (pokemon.PokemonData.HasTwoTypes)
            {
                this.type2Pokemon.Type       = pokemon.PokemonData.Type2;
                this.type2Pokemon.Visibility = Visibility.Visible;
            }
            else
            {
                this.type2Pokemon.Visibility = Visibility.Hidden;
            }

            Brush unmarkedBrush = new SolidColorBrush(Color.FromRgb(200, 200, 200));
            Brush markedBrush   = new SolidColorBrush(Color.FromRgb(0, 0, 0));

            markCircle.Foreground   = (pokemon.IsCircleMarked ? markedBrush : unmarkedBrush);
            markSquare.Foreground   = (pokemon.IsSquareMarked ? markedBrush : unmarkedBrush);
            markTriangle.Foreground = (pokemon.IsTriangleMarked ? markedBrush : unmarkedBrush);
            markHeart.Foreground    = (pokemon.IsHeartMarked ? markedBrush : unmarkedBrush);

            stackPanelRibbons.Children.Clear();
            for (int i = 0; i < pokemon.CoolRibbonCount; i++)
            {
                AddRibbon("COOL-" + (i + 1).ToString());
            }
            for (int i = 0; i < pokemon.BeautyRibbonCount; i++)
            {
                AddRibbon("BEAUTY-" + (i + 1).ToString());
            }
            for (int i = 0; i < pokemon.CuteRibbonCount; i++)
            {
                AddRibbon("CUTE-" + (i + 1).ToString());
            }
            for (int i = 0; i < pokemon.SmartRibbonCount; i++)
            {
                AddRibbon("SMART-" + (i + 1).ToString());
            }
            for (int i = 0; i < pokemon.ToughRibbonCount; i++)
            {
                AddRibbon("TOUGH-" + (i + 1).ToString());
            }

            /*for (int i = 0; i < 4; i++)
             *      AddRibbon("COOL-" + (i + 1).ToString());
             * for (int i = 0; i < 4; i++)
             *      AddRibbon("BEAUTY-" + (i + 1).ToString());
             * for (int i = 0; i < 4; i++)
             *      AddRibbon("CUTE-" + (i + 1).ToString());
             * for (int i = 0; i < 4; i++)
             *      AddRibbon("SMART-" + (i + 1).ToString());
             * for (int i = 0; i < 4; i++)
             *      AddRibbon("TOUGH-" + (i + 1).ToString());*/
            /*AddRibbon("CHAMPION");
             * AddRibbon("WINNING");
             * AddRibbon("VICTORY");
             * AddRibbon("ARTIST");
             * AddRibbon("EFFORT");
             * AddRibbon("MARINE");
             * AddRibbon("LAND");
             * AddRibbon("SKY");
             * AddRibbon("COUNTRY");
             * AddRibbon("NATIONAL");
             * AddRibbon("EARTH");
             * AddRibbon("WORLD");*/
            if (pokemon.HasChampionRibbon)
            {
                AddRibbon("CHAMPION");
            }
            if (pokemon.HasWinningRibbon)
            {
                AddRibbon("WINNING");
            }
            if (pokemon.HasVictoryRibbon)
            {
                AddRibbon("VICTORY");
            }
            if (pokemon.HasArtistRibbon)
            {
                AddRibbon("ARTIST");
            }
            if (pokemon.HasEffortRibbon)
            {
                AddRibbon("EFFORT");
            }
            if (pokemon.HasMarineRibbon)
            {
                AddRibbon("MARINE");
            }
            if (pokemon.HasLandRibbon)
            {
                AddRibbon("LAND");
            }
            if (pokemon.HasSkyRibbon)
            {
                AddRibbon("SKY");
            }
            if (pokemon.HasCountryRibbon)
            {
                AddRibbon("COUNTRY");
            }
            if (pokemon.HasNationalRibbon)
            {
                AddRibbon("NATIONAL");
            }
            if (pokemon.HasEarthRibbon)
            {
                AddRibbon("EARTH");
            }
            if (pokemon.HasWorldRibbon)
            {
                AddRibbon("WORLD");
            }

            buttonBall.IsEnabled     = !pokemon.IsEgg;
            buttonNickname.IsEnabled = !pokemon.IsEgg && !pokemon.IsShadowPokemon;
            buttonDeoxys.IsEnabled   = pokemon.DexID == 386;
            ButtonEVs.IsEnabled      = !pokemon.IsEgg && !pokemon.IsShadowPokemon;

            buttonMarkings.IsEnabled = true;
            buttonMoves.IsEnabled    = !pokemon.IsEgg && !pokemon.IsShadowPokemon;
            buttonGive.IsEnabled     = !pokemon.IsEgg;
            buttonTake.IsEnabled     = pokemon.IsHoldingItem;

            SetCurrentMove(-1);
        }
Beispiel #4
0
 public Move(ushort id)
 {
     this.id        = id;
     this.ppUpsUsed = 0;
     this.pp        = PokemonDatabase.GetMoveFromID(id).PP;
 }
        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;
        }