示例#1
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (button4.Text == "Rendirse")
            {
                button4.Text = "Está seguro que quiere rendirse?\nPresione para confirmar!!";
            }

            if (button4.Text == "Está seguro que quiere rendirse?\nPresione para confirmar!!")
            {
                if (Form1.lucha1.lucha.turno == 1)
                {
                    Form1.lucha1.Rendirse(Form1.nombre1);
                }
                if (Form1.lucha1.lucha.turno == 2)
                {
                    Form1.lucha1.Rendirse(Form1.nombre2);
                }
            }

            this.Hide();
            Form8 form8 = new Form8();

            form8.Show();
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Poder pi = (Poder)listAtaques.SelectedItem;

            atq = pi.nombre;

            if (Form1.lucha1.lucha.turno == 1)
            {
                foreach (Bitmon b in Form1.lucha1.lucha.participantes[0].equipo)
                {
                    if (b.estadolucha == "activo")
                    {
                        foreach (Poder p in b.poderes)
                        {
                            if (atq == p.nombre)
                            {
                                Form1.lucha1.GetActivo(Form1.nombre2);
                                Form1.lucha1.Ataca(Form1.lucha1.GetActivo(Form1.nombre2), p, Form1.nombre1);
                                Form1.lucha1.lucha.turno = 2;
                                if (Form1.lucha1.Verify(Form1.lucha1.lucha.turno) == true)
                                {
                                    this.Hide();
                                    Form5 form5 = new Form5();
                                    form5.Show();
                                }

                                if (Form1.lucha1.Verify(Form1.lucha1.lucha.turno) == false)
                                {
                                    this.Hide();
                                    Form8 form8 = new Form8();
                                    form8.Show();
                                }
                            }
                        }
                    }
                }
            }
            if (Form1.lucha1.lucha.turno == 2)
            {
                foreach (Bitmon b in Form1.lucha1.lucha.participantes[1].equipo)
                {
                    if (b.estadolucha == "activo")
                    {
                        foreach (Poder p in b.poderes)
                        {
                            if (atq == p.nombre)
                            {
                                Form1.lucha1.GetActivo(Form1.nombre1);
                                Form1.lucha1.Ataca(Form1.lucha1.GetActivo(Form1.nombre1), p, Form1.nombre2);

                                Form1.lucha1.lucha.turno = 1;


                                if (Form1.lucha1.Verify(Form1.lucha1.lucha.turno) == true)
                                {
                                    this.Hide();
                                    Form5 form5 = new Form5();
                                    form5.Show();
                                }

                                if (Form1.lucha1.Verify(Form1.lucha1.lucha.turno) == false)
                                {
                                    this.Hide();
                                    Form8 form8 = new Form8();
                                    form8.Show();
                                }
                            }
                        }
                    }
                }
            }
        }