Beispiel #1
0
        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!");
                }
            }
        }
Beispiel #2
0
        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;
                        }
                    }
                }
            }
        }