private void button1_Click(object sender, EventArgs e) { Fight f = new Fight(); string result; result = f.Kick(hero1, hero2); richTextBox1.Text = richTextBox1.Text + hero1.Name + " - " + hero1.HPCurent.ToString() + " - " + hero2.Name + " " + hero2.HPCurent.ToString() + "\n" + result + " \n"; if (hero1.HPCurent == 0 ) { hero1 = null; button1.Enabled = false; } if( hero2.HPCurent == 0) { hero2 = null; button1.Enabled = false; } }
private void button9_Click(object sender, EventArgs e) { foreach (Skill i in _hero1.battleSkills) { if (i.Name == "BleedingSting") { var f = new Fight(); string result = f.Kick(_hero1, _hero2, i as IBattleSkill); richTextBox1.Text = richTextBox1.Text + _hero1.Name + " - " + _hero1.HPCurent.ToString() + " - " + _hero2.Name + " " + _hero2.HPCurent.ToString() + "\n" + result + " \n"; if (_hero1.HPCurent == 0) { _hero1 = null; button1.Enabled = false; button8.Enabled = false; } if (_hero2.HPCurent == 0) { _hero2 = null; var asd = new BatleCalculates(); asd.LvlUp(_hero1); button1.Enabled = false; } button9.Enabled = false; } else { MessageBox.Show("You have not this skill!"); } } }
private void Button1Click(object sender, EventArgs e) { var f = new Fight(); string result = f.Kick(_hero1, _hero2); richTextBox1.Text = richTextBox1.Text + _hero1.Name + " - " + _hero1.HPCurent.ToString() + " - " + _hero2.Name + " " + _hero2.HPCurent.ToString() + "\n" + result + " \n"; if (_hero1.HPCurent == 0) { _hero1 = null; button1.Enabled = false; button8.Enabled = false; } if (_hero2.HPCurent == 0) { _hero2 = null; var asd = new BatleCalculates(); asd.LvlUp(_hero1); button1.Enabled = false; } if (_hero1 != null) { if (_hero1.skillInUse.Count == 0) { button9.Enabled = true; } else { foreach (var i in _hero1.skillInUse) { if (i.Name == "BleedingSting") { if (i.IsCooled) button9.Enabled = true; } } } } }