Exemple #1
0
        public void FightWnenCharacterOneStartedFirst()
        {
            Console.WriteLine(" !! Бой начинает первый персонаж !! ");
            CharacterOne one = new CharacterOne();
            CharacterTwo two = new CharacterTwo();

            one.Freeze     += Displayed;
            two.Oglyshenie += Displayed;
            int index = 0;

            while (true)


            {
                //index++;
                if (++index % 2 != 0)
                {
                    FirstCharecterHit(one, two);
                    if (two.Dead())
                    {
                        Console.WriteLine("Второй персонаж умер! Первый победил!!");
                        winPlayerOne++;
                        break;
                    }
                    if (one.FreezeHit())
                    {
                        index++;
                    }
                }
                else
                {
                    SecondCharecterAttack(one, two);
                    if (one.Dead())
                    {
                        Console.WriteLine("Первый персонаж умер! Второй победил!!");
                        winPlayerTwo++;
                        break;
                    }
                    if (two.OglyshenieHit())
                    {
                        index++;
                    }
                }
            }
        }
Exemple #2
0
 public void SecondCharecterAttack(CharacterOne one, CharacterTwo two)
 {
     one.countLife -= two.Hit();
 }
Exemple #3
0
 public void FirstCharecterHit(CharacterOne one, CharacterTwo two)
 {
     two.countLife -= one.Hit();
 }