Esempio n. 1
0
        public void Fight()
        {
            double playerOneAT = 0;
            double playerOneDF = 0;
            double playerTwoAT = 0;
            double playerTwoDF = 0;
            int    counter     = 0;

            match.StartFight(PlayerOne, PlayerTwo);

            while (true)
            {
                counter++;
                match.RoundStart(counter);

                playerOneAT = PlayerOne.Attack();
                playerTwoDF = PlayerTwo.Defence();

                PlayerTwo.HealthLeft(playerOneAT, playerTwoDF);

                match.GameTurn(PlayerOne, PlayerTwo, playerOneAT, playerTwoDF);

                if (PlayerTwo.HealthPoints <= 0)
                {
                    match.RoundEnd(PlayerOne.HealthPoints, PlayerTwo.HealthPoints);
                    match.EndFight(PlayerOne);
                    break;
                }

                playerTwoAT = PlayerTwo.Attack();
                playerOneDF = PlayerOne.Defence();

                PlayerOne.HealthLeft(playerTwoAT, playerOneDF);

                match.GameTurn(PlayerTwo, PlayerOne, playerTwoAT, playerOneDF);
                match.RoundEnd(PlayerOne.HealthPoints, PlayerTwo.HealthPoints);

                if (PlayerOne.HealthPoints <= 0)
                {
                    match.EndFight(PlayerTwo);
                    break;
                }
            }
        }
Esempio n. 2
0
 private void StartFight()
 {
     playerFightScript.StartFight();
     fightIsStarted = true;
 }