示例#1
0
        private void btn_atacar_Click(object sender, EventArgs e)
        {
            this.Heroi.atacar(Monstro);
            lbl_vidaMonstro.Text = "Vida Monstro: " + Monstro.Status.Vida;

            lbl_vida.Text = "Vida: " + Heroi.Status.Vida;

            if (this.Monstro.Status.Vida <= 0)
            {
                DialogResult dialogResult = MessageBox.Show("Deseja passar no mercado antes de prosseguir?", "Confirmação", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    frm_comprarItens menu = new frm_comprarItens(this.Heroi);
                    menu.ShowDialog();
                    this.Hide();
                }
                else
                {
                    frm_batalha form = new frm_batalha(Heroi);
                    form.Show();
                    this.Hide();
                }
            }
            else
            {
                this.Monstro.atacar(Heroi);
            }

            if (Heroi.Status.Vida <= 0)
            {
                MessageBox.Show("GAME OVER");
            }
        }
示例#2
0
        private void btn_voltar_Click(object sender, EventArgs e)
        {
            frm_batalha batalha = new frm_batalha(this.Heroi);

            batalha.Show();
            this.Hide();
        }
示例#3
0
        private void btn_ok_Click_1(object sender, EventArgs e)
        {
            int valor = confeirPontos((int)nud_forca.Value, (int)nud_defesa.Value, (int)nud_agilidade.Value, (int)nud_sorte.Value, (int)nud_vida.Value, (int)nud_mana.Value);

            if (valor == 1)
            {
                MessageBox.Show("Os seus pontos de habilidade passaram de 300!");
            }
            else if (valor == 2)
            {
                MessageBox.Show("Os seus pontos de habilidade são menor do que 300!");
                //MessageBox com sim e não
                DialogResult dialogResult = MessageBox.Show("Deseja jogar mesmo assim e tentar no hardcore?", "Confirmação", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    if (Heroi == "Guerreiro")
                    {
                        Guerreiro = new Guerreiro(Nome, 10, 1, (int)nud_forca.Value, (int)nud_defesa.Value, (int)nud_agilidade.Value, (int)nud_sorte.Value, (int)nud_vida.Value, (int)nud_mana.Value, "Guerreiro");
                        frm_batalha form = new frm_batalha(Guerreiro);
                        form.ShowDialog();
                        this.Hide();
                    }
                    else if (Heroi == "Mago")
                    {
                        Mago = new Mago(Nome, 10, 1, (int)nud_forca.Value, (int)nud_defesa.Value, (int)nud_agilidade.Value, (int)nud_sorte.Value, (int)nud_vida.Value, (int)nud_mana.Value, "Mago");
                        frm_batalha form = new frm_batalha(Mago);
                        form.ShowDialog();
                        this.Hide();
                    }
                    else
                    {
                        Arqueiro = new Arqueiro(Nome, 10, 1, (int)nud_forca.Value, (int)nud_defesa.Value, (int)nud_agilidade.Value, (int)nud_sorte.Value, (int)nud_vida.Value, (int)nud_mana.Value, "Arqueiro");
                        frm_batalha form = new frm_batalha(Arqueiro);
                        form.ShowDialog();
                        this.Hide();
                    }
                }
                else if (dialogResult == DialogResult.No)
                {
                    MessageBox.Show("Não");
                }
            }
            else
            {
                if (Heroi == "Guerreiro")
                {
                    Guerreiro = new Guerreiro(Nome, 10, 1, (int)nud_forca.Value, (int)nud_defesa.Value, (int)nud_agilidade.Value, (int)nud_sorte.Value, (int)nud_vida.Value, (int)nud_mana.Value, "Guerreiro");
                    frm_batalha form = new frm_batalha(Guerreiro);
                    form.ShowDialog();
                    this.Hide();
                }
                else if (Heroi == "Mago")
                {
                    Mago = new Mago(Nome, 10, 1, (int)nud_forca.Value, (int)nud_defesa.Value, (int)nud_agilidade.Value, (int)nud_sorte.Value, (int)nud_vida.Value, (int)nud_mana.Value, "Mago");
                    frm_batalha form = new frm_batalha(Mago);
                    form.ShowDialog();
                    this.Hide();
                }
                else
                {
                    Arqueiro = new Arqueiro(Nome, 10, 1, (int)nud_forca.Value, (int)nud_defesa.Value, (int)nud_agilidade.Value, (int)nud_sorte.Value, (int)nud_vida.Value, (int)nud_mana.Value, "Arqueiro");
                    frm_batalha form = new frm_batalha(Arqueiro);
                    form.ShowDialog();
                    this.Hide();
                }
            }
        }