예제 #1
0
        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;
            }
        }
예제 #2
0
파일: StartForm.cs 프로젝트: Dieho/Hero
        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!");
                }
            }
        }
예제 #3
0
파일: StartForm.cs 프로젝트: Dieho/Hero
        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;
                        }
                    }
                }
            }
        }