private void button1_Click(object sender, EventArgs e) { if (turno == 1) { if (xcb1.SelectedItem == null) { MessageBox.Show("Opción inválida, ingrésela nuevamente porfavor!!"); this.Hide(); Form7 form77 = new Form7(); form77.Show(); } else { Form1.lucha1.Neutro1(); Bitmon ca = (Bitmon)xcb1.SelectedItem; Form1.lucha1.Cambiar1(ca.nombre); Form1.lucha1.lucha.turno = 2; MessageBox.Show("Bitmon cambiado con éxito!!"); Form5 form51 = new Form5(); this.Hide(); form51.Show(); } } if (turno == 2) { if (comboBox1.SelectedItem == null) { MessageBox.Show("Opción inválida, ingrésela nuevamente porfavor!!"); this.Hide(); Form7 form77 = new Form7(); form77.Show(); } else { Form1.lucha1.Neutro2(); Bitmon co = (Bitmon)comboBox1.SelectedItem; Form1.lucha1.Cambiar2(co.nombre); MessageBox.Show("Bitmon cambiado con éxito!!"); Form5 form51 = new Form5(); this.Hide(); form51.Show(); } } }
private void BotonJugador2Agregar_Click(object sender, EventArgs e) { if (contadorSeleccion == 2 | contadorSeleccion == 4 | contadorSeleccion == 6) { BotonJugador1Agregar.Show(); if (contador2 <= 3) { try { Bitmon c = (Bitmon)ListaBits.SelectedItem; eq2.Add(c); MessageBox.Show(c.nombre + " se ha agregado para el equipo del jugador " + Form1.nombre2); ListaBits.Items.Remove(ListaBits.SelectedItem); contadorSeleccion++; contador2++; } catch (NullReferenceException) { MessageBox.Show("No eligió ningún Bitmon, reiniciando Form..."); this.Hide(); Form2 form2 = new Form2(); form2.Show(); } } else { MessageBox.Show("Ya tiene listo su equipo, no puede elegir mas bitmons"); } BotonJugador2Agregar.Hide(); } else { MessageBox.Show("No es su turno para elegir bitmon todavia"); } if (contador2 == 4) { Form1.lucha1.AddEquipos(eq1, 1); Form1.lucha1.AddEquipos(eq2, 2); Form3 form3 = new Form3(); this.Hide(); form3.Show(); } }
static void Main(string[] args) { Console.Write("Enter your name: "); string name = Console.ReadLine(); Console.Clear(); Console.WriteLine("Select your Bitmon: "); Thread.Sleep(2000); Bitmon playersBitmon = SelectBitmon.Choose(); Console.Clear(); Console.WriteLine("Select your 2nd Bitmon: "); Thread.Sleep(2000); Bitmon players2ndBitmon = SelectBitmon.Choose(); Console.Clear(); Console.WriteLine("Select opponent's Bitmon: "); Thread.Sleep(2000); Bitmon enemyBitmon = SelectBitmon.Choose(); Console.Clear(); Trainer Player = new Trainer(name); Player.AddToParty(playersBitmon); Player.AddToParty(players2ndBitmon); Side playerSide = new TrainerSide(Player); Side enemySide = new WildBitmonSide(enemyBitmon); ConsoleBattlePlayer.Run(playerSide, enemySide, new RandomWildBitmonActor()); Console.Write("Press enter to exit"); Console.ReadLine(); }
private void button1_Click(object sender, EventArgs e) { Bitmon nombre_b1 = (Bitmon)comboBox1.SelectedItem; Bitmon nombre_b2 = (Bitmon)comboBox2.SelectedItem; if (nombre_b1 == null || nombre_b2 == null) { MessageBox.Show("Opción inválida, reiniciando Form!!"); this.Hide(); Form3 form3 = new Form3(); form3.Show(); } else { Form1.lucha1.AddActivo(nombre_b1.nombre, nombre_b2.nombre); Form4 form4 = new Form4(); this.Hide(); form4.Show(); } }
public void Descansar(string nombre_jug) { Bitmon act = GetActivo(nombre_jug); act.vida = act.vida + 40; act.stamina = act.stamina + 10; foreach (Jugador j in lucha.participantes) { if (j.nombre == nombre_jug) { foreach (Bitmon b in j.equipo) { if (b.nombre == act.nombre) { b.vida = act.vida; b.stamina = act.stamina; } } } } }
public Bitmon Ataca(Bitmon atacado, Poder pow, string nombre_jug) { Bitmon act = GetActivo(nombre_jug); double defensareal = atacado.defensa * (0.3);//esto nos pareció necesario para hacer un poco más rápido y fluido el juego double ataquereal = pow.danio + act.ataque; //reduccion de vida if (pow.tipo == "Normal") { atacado.vida = atacado.vida - Convert.ToInt32(ataquereal - defensareal); } if (pow.tipo == "Electro") { if (atacado.tipo == "Agua")//aumentaremos 30%+ el ataque y la defensa la redujiremos 30%- { atacado.vida = atacado.vida - Convert.ToInt32(ataquereal * 1.3 - defensareal * 0.7); } if (atacado.tipo == "Hielo")//ataque 30%- y defensa 30%+ { atacado.vida = atacado.vida - Convert.ToInt32(ataquereal * 0.7 - defensareal * 1.3); } if (atacado.tipo == "Normal" || atacado.tipo == "Fuego" || atacado.tipo == "Electro") { atacado.vida = atacado.vida - Convert.ToInt32(ataquereal - defensareal); } } if (pow.tipo == "Agua") { if (atacado.tipo == "Fuego")//aumentaremos 30%+ el ataque y la defensa la redujiremos 30%- { atacado.vida = atacado.vida - Convert.ToInt32(ataquereal * 1.3 - defensareal * 0.7); } if (atacado.tipo == "Electro")//ataque 30%- y defensa 30%+ { atacado.vida = atacado.vida - Convert.ToInt32(ataquereal * 0.7 - defensareal * 1.3); } if (atacado.tipo == "Normal" || atacado.tipo == "Agua" || atacado.tipo == "Hielo") { atacado.vida = atacado.vida - Convert.ToInt32(ataquereal - defensareal); } } if (pow.tipo == "Hielo") { if (atacado.tipo == "Electro")//aumentaremos 30%+ el ataque y la defensa la redujiremos 30%- { atacado.vida = atacado.vida - Convert.ToInt32(ataquereal * 1.3 - defensareal * 0.7); } if (atacado.tipo == "Fuego")//ataque 30%- y defensa 30%+ { atacado.vida = atacado.vida - Convert.ToInt32(ataquereal * 0.7 - defensareal * 1.3); } if (atacado.tipo == "Normal" || atacado.tipo == "Agua" || atacado.tipo == "Hielo") { atacado.vida = atacado.vida - Convert.ToInt32(ataquereal - defensareal); } } if (pow.tipo == "Fuego") { if (atacado.tipo == "Hielo")//aumentaremos 30%+ el ataque y la defensa la redujiremos 30%- { atacado.vida = atacado.vida - Convert.ToInt32(ataquereal * 1.3 - defensareal * 0.7); } if (atacado.tipo == "Agua")//ataque 30%- y defensa 30%+ { atacado.vida = atacado.vida - Convert.ToInt32(ataquereal * 0.7 - defensareal * 1.3); } if (atacado.tipo == "Normal" || atacado.tipo == "Fuego" || atacado.tipo == "Electro") { atacado.vida = atacado.vida - Convert.ToInt32(ataquereal - defensareal); } } //reduccion stamina act.stamina = act.stamina - pow.costo; atacado.estadosalud = pow.ulti; if (atacado.vida <= 0) { atacado.vida = 0; atacado.estadolucha = "activo"; } return(atacado); }
public ControllerLucha() { allbitmons = new List <Bitmon>(); Poder Ember = new Poder(10, 1, "Fuego", null, "Ember"); Poder FireFang = new Poder(11, 2, "Fuego", null, "Fire Fang"); Poder FireSpin = new Poder(14, 3, "Fuego", null, "Fire Spin"); Poder Flamethrower = new Poder(15, 5, "Fuego", "Confusion", "Flamethrower"); Poder Iceshard = new Poder(12, 3, "Hielo", null, "Ice Shard"); Poder FrostBreath = new Poder(10, 2, "Hielo", null, "Frost Breath"); Poder PowderSnow = new Poder(6, 1, "Hielo", null, "Powder Snow"); Poder Hypothemia = new Poder(0, 1, "Hielo", "Sueño", "Hypothemia"); Poder WaterGun = new Poder(5, 2, "Agua", null, "Water Gun"); Poder PoisonGun = new Poder(5, 4, "Agua", "Veneno", "Poison Gun"); Poder Bubble = new Poder(12, 4, "Agua", null, "Bubble"); Poder Waterfall = new Poder(16, 5, "Agua", null, "Waterfall"); Poder ThunderShock = new Poder(5, 2, "Electro", null, "Thunder Shock"); Poder Spark = new Poder(6, 5, "Electro", "Paralisis", "Spark"); Poder ChargeBeam = new Poder(8, 4, "Electro", null, "Charge Beam"); Poder VoltSwitch = new Poder(20, 6, "Electro", null, "Volt Switch"); List <Poder> charmonpow = new List <Poder>(); charmonpow.Add(ThunderShock); charmonpow.Add(Spark); charmonpow.Add(Ember); charmonpow.Add(Flamethrower); Bitmon Charmon = new Bitmon(500, 15, 128, 108, "Charmon", "Fuego", null, charmonpow, null); List <Poder> bitpow = new List <Poder>(); bitpow.Add(Ember); bitpow.Add(FireFang); bitpow.Add(FireSpin); bitpow.Add(Flamethrower); Bitmon Bitmeleon = new Bitmon(800, 20, 160, 140, "Bitmeleon", "Fuego", null, bitpow, null); List <Poder> pikapow = new List <Poder>(); pikapow.Add(ChargeBeam); pikapow.Add(VoltSwitch); pikapow.Add(FireFang); pikapow.Add(FireSpin); Bitmon Pikamon = new Bitmon(400, 17, 124, 108, "Pikamon", "Electro", null, pikapow, null); List <Poder> qwertypow = new List <Poder>(); qwertypow.Add(ThunderShock); qwertypow.Add(Spark); qwertypow.Add(ChargeBeam); qwertypow.Add(VoltSwitch); Bitmon Qwertymon = new Bitmon(700, 22, 200, 154, "Qwertymon", "Electro", null, qwertypow, null); List <Poder> squipow = new List <Poder>(); squipow.Add(FrostBreath); squipow.Add(PowderSnow); squipow.Add(Bubble); squipow.Add(Waterfall); Bitmon Squimon = new Bitmon(500, 13, 112, 142, "Squimon", "Agua", null, squipow, null); List <Poder> worpow = new List <Poder>(); worpow.Add(WaterGun); worpow.Add(PoisonGun); worpow.Add(Bubble); worpow.Add(Waterfall); Bitmon Worbito = new Bitmon(600, 19, 144, 176, "Worbito", "Agua", null, worpow, null); List <Poder> icepow = new List <Poder>(); icepow.Add(PoisonGun); icepow.Add(Iceshard); icepow.Add(Hypothemia); icepow.Add(WaterGun); Bitmon Icemon = new Bitmon(500, 12, 128, 110, "Icemon", "Hielo", null, icepow, null); List <Poder> dragpow = new List <Poder>(); dragpow.Add(Iceshard); dragpow.Add(FrostBreath); dragpow.Add(PowderSnow); dragpow.Add(Hypothemia); Bitmon Dragonice = new Bitmon(800, 20, 170, 152, "Dragonice", "Hielo", null, dragpow, null); List <Poder> tiripow = new List <Poder>(); tiripow.Add(Flamethrower); tiripow.Add(Hypothemia); tiripow.Add(PoisonGun); tiripow.Add(Spark); Bitmon Tirimon = new Bitmon(600, 17, 132, 136, "Tirimon", "Normal", null, tiripow, null); List <Poder> naidopow = new List <Poder>(); naidopow.Add(FireSpin); naidopow.Add(Iceshard); naidopow.Add(Waterfall); naidopow.Add(VoltSwitch); Bitmon Naidormon = new Bitmon(1000, 16, 142, 128, "Naidormon", "Normal", null, naidopow, null); allbitmons.Add(Charmon); allbitmons.Add(Bitmeleon); allbitmons.Add(Pikamon); allbitmons.Add(Qwertymon); allbitmons.Add(Squimon); allbitmons.Add(Worbito); allbitmons.Add(Icemon); allbitmons.Add(Dragonice); allbitmons.Add(Tirimon); allbitmons.Add(Naidormon); // ver como implementar bien el metodo turno }
public Form5() { InitializeComponent(); if (Form1.lucha1.lucha.turno == 1) { label1.Text = "Turno de " + Form1.nombre1; turno = Form1.lucha1.lucha.turno; nombre_jugador = Form1.nombre1; } if (Form1.lucha1.lucha.turno == 2) { label1.Text = "Turno de " + Form1.nombre2; turno = Form1.lucha1.lucha.turno; nombre_jugador = Form1.nombre2; } Bitmon act1 = Form1.lucha1.GetActivo(Form1.nombre1); Bitmon act2 = Form1.lucha1.GetActivo(Form1.nombre2); string ruta1 = "C:\\Users\\usuario\\Desktop\\entrega3POODonoso-Martinez\\Imagenes\\" + act1.nombre + ".PNG"; string ruta2 = "C:\\Users\\usuario\\Desktop\\entrega3POODonoso-Martinez\\Imagenes\\" + act2.nombre + ".PNG"; pictureBox1.Image = Image.FromFile(ruta1); pictureBox2.Image = Image.FromFile(ruta2); if (turno == 1) { if (act1.vida == 0) { button1.Hide(); button2.Hide(); MessageBox.Show("Debido a los stats de su Bitmon, usted sólo tiene las siguientes opciones, Descansar o Rendirse"); } if (act1.stamina <= 0) { button1.Hide(); MessageBox.Show("Debido a su baja stamina, usted solo puede hacer las siguientes opciones"); } if (act1.estadosalud == "Paralisis" || act1.estadosalud == "Sueño") { MessageBox.Show("Pierde turno por efectos en su Bitmon"); foreach (Bitmon b in Form1.lucha1.lucha.participantes[0].equipo) { if (b == act1) { b.estadosalud = null; } } turno = 1; } } if (turno == 2) { if (act2.vida == 0) { button1.Hide(); button2.Hide(); MessageBox.Show("Debido a los stats de su Bitmon, usted sólo tiene las siguientes opciones, Descansar o Rendirse"); } if (act2.stamina <= 0) { button1.Hide(); MessageBox.Show("Debido a su baja stamina, usted solo puede hacer las siguientes opciones"); } if (act2.estadosalud == "Paralisis" || act2.estadosalud == "Sueño") { MessageBox.Show("Pierde turno por efectos en su Bitmon"); foreach (Bitmon b in Form1.lucha1.lucha.participantes[0].equipo) { if (b == act2) { b.estadosalud = null; } } turno = 2; } } label2.Text = "Bitmon de " + Form1.nombre1 + ": Nombre: " + act1.nombre + " Vida: " + Convert.ToString(act1.vida) + " Stamina:" + Convert.ToString(act1.stamina) + " Tipo: " + act1.tipo; label3.Text = "Bitmon de " + Form1.nombre2 + ": Nombre: " + act2.nombre + " Vida: " + Convert.ToString(act2.vida) + " Stamina:" + Convert.ToString(act2.stamina) + " Tipo: " + act2.tipo; }