private void Btn_Battle_Click(object sender, EventArgs e) { if (character == 0) { MessageBox.Show("Add meg melyik karakterrel játszol!"); } else if (name == "") { MessageBox.Show("Add meg a neved!"); } else if (name.Length > 6) { MessageBox.Show("A neved nem lehet több mint 6 karakter!"); } else { // TOVÁBB A CSATÁHOZ NewMap.Visible = false; valasztottKarakter = new Karakter(name, ability); CsataPanel.Visible = true; MenuPanel.Visible = false; Karakter1.Visible = true; BotKarakter.Visible = true; Név1.Visible = true; Bothp.Visible = true; Név1.Text = name + ": " + valasztottKarakter.EletEro + "hp"; randomKarakter = r.Next(harcosLista.Count); Bothp.Text = "Ellenfél: " + harcosLista[randomKarakter].EletEro.ToString() + "hp"; switch (character) { case 1: Karakter1.Image = Image.FromFile("assets/Knight1L.png"); break; case 2: Karakter1.Image = Image.FromFile("assets/Knight2L.png"); break; case 3: Karakter1.Image = Image.FromFile("assets/Knight3L.png"); break; } switch (randomKarakter) { case 0: BotKarakter.Image = Image.FromFile("assets/Knight1R.png"); break; case 1: BotKarakter.Image = Image.FromFile("assets/Knight2R.png"); break; case 2: BotKarakter.Image = Image.FromFile("assets/Knight3R.png"); break; } } }
private void karakterListaFeltoltes() { Karakter k1 = new Karakter("Bot1", r.Next(3)); Karakter k2 = new Karakter("Bot2", r.Next(3)); Karakter k3 = new Karakter("Bot3", r.Next(3)); harcosLista.Add(k1); harcosLista.Add(k2); harcosLista.Add(k3); }