private void btn_Escapar_Click(object sender, EventArgs e) { DialogResult r = MessageBox.Show("Huyes Cobarde?", "", MessageBoxButtons.YesNo); if (r == DialogResult.Yes) { Owner.Enabled = true; Mapa mp = (Mapa)this.Owner; this.Close(); mp.BringToFront(); cls_j.BackgroundImage = Properties.Resources.Xv_2; cls_j.BackgroundImageLayout = ImageLayout.Center; } }
private void timerCmbt_Tick(object sender, EventArgs e) { if (!accion) { BoxJugador.Image = player_Cmbt.animacionNormal(); i++; BoxEnemigo.Image = enemy.animacionNormal(); j++; } else { if (turno_player) { if (ataque) { animacionCombate(1); inst_ataque(); } else if (ataqueEsp) { animacionCombate(1); inst_ataqueEsp(); } } else { if (enemy.Vida_Real > 0) { switch (accionar_enemigo) { case 1: animacionCombate(2); inst_ataque(); if (player_Cmbt.Vida_Real <= 0) { MessageBox.Show("Perdiste Rata inmunda", "GAME OVER!!"); Owner.Enabled = true; Mapa mp = (Mapa)this.Owner; this.Close(); mp.BringToFront(); Application.Exit(); } break; case 2: if (defensa_jug == false) { defensa_ene = true; if (Math.Floor(rmd.NextDouble()) <= 50) { critico = true; } btn_Defender.Enabled = false; turno_player = true; accion = false; } else { accionar_enemigo = rmd.Next(1, 3); turno_player = false; accion = true; } break; case 3: if (enemy.Mana_Real >= (int)enemy.Mana_Max * 0.2) { animacionCombate(2); inst_ataqueEsp(); } else { accionar_enemigo = rmd.Next(1, 3); turno_player = false; accion = true; } break; default: accion = true; break; } } else { accion = false; turno_player = true; //cuando el enemigo muere sube la experiencias MessageBox.Show("Esta vez has Ganado!!", player_Cmbt.Nombre); ec.Close(); subirExp(); ganaPocion(); Owner.Enabled = true; Mapa mp = (Mapa)this.Owner; this.Close(); mp.BringToFront(); cls_j.BackgroundImage = Properties.Resources.Espada4; cls_j.BackgroundImageLayout = ImageLayout.Center; } } } }