void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.GymBattle1 = ((Pokemon_3080.GymBattle)(target));
                return;

            case 2:
                this.format1 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 3:
                this.chosenpokemon = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 4:
                this.Lelvelformat1 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 5:
                this.level1 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 6:
                this.HPformat1 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 7:
                this.HP1 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 8:
                this.Skillformat1 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 9:
                this.run = ((System.Windows.Controls.Button)(target));

            #line 21 "..\..\GymBattle.xaml"
                this.run.Click += new System.Windows.RoutedEventHandler(this.runaway_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.skill2 = ((System.Windows.Controls.Button)(target));

            #line 22 "..\..\GymBattle.xaml"
                this.skill2.Click += new System.Windows.RoutedEventHandler(this.skill2_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.skill1 = ((System.Windows.Controls.Button)(target));

            #line 23 "..\..\GymBattle.xaml"
                this.skill1.Click += new System.Windows.RoutedEventHandler(this.skill1_Click);

            #line default
            #line hidden
                return;

            case 12:
                this.skill3 = ((System.Windows.Controls.Button)(target));

            #line 24 "..\..\GymBattle.xaml"
                this.skill3.Click += new System.Windows.RoutedEventHandler(this.skill3_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.normalattack = ((System.Windows.Controls.Button)(target));

            #line 25 "..\..\GymBattle.xaml"
                this.normalattack.Click += new System.Windows.RoutedEventHandler(this.normalattack_Click);

            #line default
            #line hidden
                return;

            case 14:
                this.format2 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 15:
                this.enemypokemon = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 16:
                this.Levelformat2 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 17:
                this.level2 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 18:
                this.HPformat2 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 19:
                this.HP2 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 20:
                this.fightingrecord = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 21:
                this.HPformat2_Copy = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #2
0
        public void IfGymBattle() // Tell whether the player will walk into the gym
        {
            if (CurrentMap == 1)
            {
                if (NumberMatrixList[CurrentMap][X, Y] == 3 || NumberMatrixList[CurrentMap][X, Y] == 4)
                {
                    if (StoryMode == 0)
                    {
                        Dialogue newDialogue = new Dialogue(1);
                        newDialogue.ShowDialog();
                    }
                    Pokemon temp = Pokemons[0];
                    foreach (Pokemon x in Pokemons)
                    {
                        if (x.GetCP() > temp.GetCP())
                        {
                            temp = x;
                        }
                    }
                    string store = "";
                    foreach (string x in temp.GetSkill())
                    {
                        store += x + "+";
                    }
                    string substring = store.Substring(0, store.Count() - 1);
                    AddInfo("\nEntering Gym...");
                    MessageBox.Show("Ready to enter the battle field?\nThe system will automatically choose your strongest pixelmon.");
                    GymBattle newBattle = new GymBattle("Wartortle", 150, 40, 10, 32, "Tackle+Hydro Pump", temp.GetName(), temp.Name, temp.GetHP(), temp.GetCP(), temp.GetLevel(), temp.GetAttack(), substring);
                    newBattle.ShowDialog();
                    AddInfo("\nLeaving Gym: ");
                    if (newBattle.Result == "Yes")
                    {
                        if (StoryMode == 0)
                        {
                            StoryMode = 1;
                        }
                        Master.AddStardust(100);
                        Master.AddEggs(20);
                        RefreshPlayerInfo();
                        MessageBox.Show("Battle Prize: 300 stardust and 50 eggs has been added to your pocket.");
                        AddInfo("300 stardust and 50 eggs has been added to your pocket.");
                    }
                }
            }
            else if (CurrentMap == 0)
            {
                if (NumberMatrixList[CurrentMap][X, Y] == 3 || NumberMatrixList[CurrentMap][X, Y] == 4)
                {
                    if (StoryMode == 1)
                    {
                        Dialogue newDialogue = new Dialogue(2);
                        newDialogue.ShowDialog();
                    }
                    Pokemon temp = Pokemons[0];
                    foreach (Pokemon x in Pokemons)
                    {
                        if (x.GetCP() > temp.GetCP())
                        {
                            temp = x;
                        }
                    }
                    string store = "";
                    foreach (string x in temp.GetSkill())
                    {
                        store += x + "+";
                    }
                    string substring = store.Substring(0, store.Count() - 1);
                    AddInfo("\nEntering Gym...");
                    MessageBox.Show("Ready to enter the battle field?\nThe system will automatically choose your strongest pixelmon.");
                    GymBattle newBattle = new GymBattle("Butterfree", 350, 75, 18, 55, "Tackle+Sting+Wind Shell", temp.GetName(), temp.Name, temp.GetHP(), temp.GetCP(), temp.GetLevel(), temp.GetAttack(), substring);
                    newBattle.ShowDialog();
                    AddInfo("\nLeaving Gym: ");
                    if (newBattle.Result == "Yes")
                    {
                        if (StoryMode == 1)
                        {
                            StoryMode = 2;
                        }
                        Master.AddStardust(200);
                        Master.AddEggs(40);
                        RefreshPlayerInfo();
                        MessageBox.Show("Battle Prize: 300 stardust and 50 eggs has been added to your pocket.");
                        AddInfo("300 stardust and 50 eggs has been added to your pocket.");
                    }
                    if (StoryMode == 2)
                    {
                        Dialogue newDialogue0 = new Dialogue(3);
                        newDialogue0.ShowDialog();
                        StoryMode = 3;
                    }
                }
            }
            else
            {
                if (NumberMatrixList[CurrentMap][X, Y] == 13 || NumberMatrixList[CurrentMap][X, Y] == 14)
                {
                    if (StoryMode == 3)
                    {
                        Dialogue newDialogue = new Dialogue(4);
                        newDialogue.ShowDialog();

                        Pokemon temp = Pokemons[0];
                        foreach (Pokemon x in Pokemons)
                        {
                            if (x.GetCP() > temp.GetCP())
                            {
                                temp = x;
                            }
                        }
                        string store = "";
                        foreach (string x in temp.GetSkill())
                        {
                            store += x + "+";
                        }

                        string substring = store.Substring(0, store.Count() - 1);
                        AddInfo("\nEntering Battle...");
                        MessageBox.Show("Ready to enter the battle field?\nThe system will automatically choose your strongest pixelmon.");
                        GymBattle newBattle = new GymBattle("Venusaur", 1000, 220, 35, 200, "Tackle+Leech Seed+Seed Bomb", temp.GetName(), temp.Name, temp.GetHP(), temp.GetCP(), temp.GetLevel(), temp.GetAttack(), substring);
                        newBattle.ShowDialog();
                        AddInfo("\nLeaving Battle: ");
                        if (newBattle.Result == "Yes")
                        {
                            StoryMode = 4;
                            Master.AddStardust(300);
                            Master.AddEggs(50);
                            RefreshPlayerInfo();
                            MessageBox.Show("Battle Prize: 300 stardust and 50 eggs has been added to your pocket.");
                            AddInfo("300 stardust and 50 eggs has been added to your pocket.");
                        }
                        if (StoryMode == 4)
                        {
                            Dialogue newDialogue0 = new Dialogue(5);
                            newDialogue0.ShowDialog();
                            StoryMode = 5;
                        }
                    }
                }
            }
        }