Ejemplo n.º 1
0
 public void Reset()
 {
     firstOpponent = new Opponent("Nick", 1, 3);
     currentPlayer = new Player("Kid", 1, 10);
 }
Ejemplo n.º 2
0
        public void Fight()
        {
            while (firstOpponent.OppHealth > 0 && currentPlayer.MyHealth > 0)
            {
                Punches userPunch = _combatAI.UserPunch();
                Punches compPunch = _combatAI.ComputerPunch();
                int     victor    = _combatAI.CombatCheck(userPunch, compPunch);
                Console.Clear();
                Console.WriteLine(_combatAI.WhoWon(userPunch, compPunch, firstOpponent.OppName, victor));

                if (victor == 1)
                {
                    Console.WriteLine();
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.WriteLine($"{currentPlayer.MyName} landed a hit on {firstOpponent.OppName}");
                    Console.ResetColor();
                    Console.WriteLine();
                    Console.WriteLine($"{firstOpponent.OppName}'s Health Remaining {firstOpponent.OppHealth -= 1}");
                    Console.WriteLine();
                    Console.WriteLine($"{currentPlayer.MyName}'s Health Remaining {currentPlayer.MyHealth}");
                    Console.WriteLine();
                }

                else if (victor == 2)
                {
                    Console.WriteLine();
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine($"{firstOpponent.OppName} landed a hit on {currentPlayer.MyName}");
                    Console.ResetColor();
                    Console.WriteLine();
                    Console.WriteLine($"{firstOpponent.OppName}'s Health Remaining {firstOpponent.OppHealth}");
                    Console.WriteLine();
                    Console.WriteLine($"{currentPlayer.MyName}'s Health Remaining {currentPlayer.MyHealth -= 1}");
                    Console.WriteLine();
                }

                else
                {
                    Console.WriteLine();
                    Console.ForegroundColor = ConsoleColor.Blue;
                    Console.WriteLine("Lots of moving air");
                    Console.ResetColor();
                    Console.WriteLine();
                    Console.WriteLine($"{firstOpponent.OppName}'s Health Remaining {firstOpponent.OppHealth}");
                    Console.WriteLine();
                    Console.WriteLine($"{currentPlayer.MyName}'s Health Remaining {currentPlayer.MyHealth}");
                    Console.WriteLine();
                }

                if (firstOpponent.OppHealth <= 0)
                {
                    Console.WriteLine();
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.WriteLine($"You knocked {firstOpponent.OppName} clean out!!!");
                    Console.ResetColor();
                    Console.WriteLine();
                    Console.ReadLine();

                    if (firstOpponent.OppName == "Nick")
                    {
                        Console.WriteLine();
                        Console.WriteLine("'You can LOOK, but you can't TOUCH MY BEARD... GRAWL!'");
                        firstOpponent = new Opponent("Adam", 1, 3);
                        Console.Clear();
                        Console.WriteLine("Announcer - 'Touch gloves and let's get it on'");
                        Console.WriteLine();
                        Console.WriteLine($"You touched gloves with {firstOpponent.OppName}, now throw a punch");
                        Console.WriteLine();
                        Console.WriteLine("(J)ab , (H)ook , or (U)ppercut");
                        Console.WriteLine();
                    }
                    else if (firstOpponent.OppName == "Adam")
                    {
                        Console.WriteLine();
                        Console.WriteLine("'The fencers cut my INTERNET WIRE... AHHHH!'");
                        firstOpponent = new Opponent("Michael", 1, 4);
                        Console.Clear();
                        Console.WriteLine("Announcer - 'Touch gloves and let's get it on'");
                        Console.WriteLine();
                        Console.WriteLine($"You touched gloves with {firstOpponent.OppName}, now throw a punch");
                        Console.WriteLine();
                        Console.WriteLine("(J)ab , (H)ook , or (U)ppercut");
                        Console.WriteLine();
                    }
                    else if (firstOpponent.OppName == "Michael")
                    {
                        Console.WriteLine();
                        Console.WriteLine("'You could also do it.... THIS WAY!! ...just a suggestion.'");
                        firstOpponent = new Opponent("Jacob", 1, 5);
                        Console.Clear();
                        Console.WriteLine("Announcer - 'Touch gloves and let's get it on'");
                        Console.WriteLine();
                        Console.WriteLine($"You touched gloves with {firstOpponent.OppName}, now throw a punch");
                        Console.WriteLine();
                        Console.WriteLine("(J)ab , (H)ook , or (U)ppercut");
                        Console.WriteLine();
                    }
                    else if (firstOpponent.OppName == "Jacob")
                    {
                        Console.WriteLine();
                        Console.WriteLine("'Nanu nanu weakling, I'm a STAR TREK FAN not a STAR WARS FAN...! '");
                        firstOpponent = new Opponent("Andrew", 1, 6);
                        Console.Clear();
                        Console.WriteLine("Announcer - 'Touch gloves and let's get it on'");
                        Console.WriteLine();
                        Console.WriteLine($"You touched gloves with {firstOpponent.OppName}, now throw a punch");
                        Console.WriteLine();
                        Console.WriteLine("(J)ab , (H)ook , or (U)ppercut");
                        Console.WriteLine();
                    }
                    else if (firstOpponent.OppName == "Andrew")
                    {
                        Console.ForegroundColor = ConsoleColor.Green;
                        Console.WriteLine($"Wow {currentPlayer.MyName}, you should consider yourself lucky to have gotten here! You've taken down EFA's toughest instructors! Congratulations on your victory! Go play the lottery or something because seriously, your luck is insane!");
                        Console.ResetColor();
                        Console.WriteLine();
                        Console.WriteLine("If you want to prove yourself again, reset in the main menu and fight again starting with Nick.");
                    }
                    else
                    {
                    }
                }

                else if (currentPlayer.MyHealth <= 0)
                {
                    Console.Clear();
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine($"{firstOpponent.OppName} gave you a run for your money! That was some nap you took {currentPlayer.MyName}. Better LUCK next time.");
                    Console.ResetColor();
                    Console.WriteLine();
                    Console.WriteLine($"Stand up {currentPlayer.MyName}! He knocked you down but you're still in this fight!!");
                    Console.WriteLine();
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.WriteLine("'Choose Start Fight To Continue'");
                    Console.ResetColor();
                    Console.ReadLine();
                }

                else
                {
                }
            }

            currentPlayer = new Player("", 1, 10);
        }