// If user selects a Feline character, the computer will randomly select a Canine character to play as. public static object ComputerCanine() { Random rand = new Random(); int random = rand.Next(1, 4); if (random == 1) { Console.WriteLine("\n"); Console.BackgroundColor = ConsoleColor.DarkGreen; Console.WriteLine("YOU'RE PLAYING AGAIN HUSKY BOT!"); Console.ResetColor(); Console.WriteLine("\n"); Husky newHusky = new Husky("Husky Bot"); return(newHusky); } else if (random == 2) { Console.WriteLine("\n"); Console.BackgroundColor = ConsoleColor.DarkGreen; Console.WriteLine("YOU'RE PLAYING AGAINST HYENA BOT!"); Console.ResetColor(); Console.WriteLine("\n"); Hyena newHyena = new Hyena("Hyena Bot"); return(newHyena); } else { Console.WriteLine("\n"); Console.BackgroundColor = ConsoleColor.DarkGreen; Console.WriteLine("YOU'RE PLAYING AGAINST WOLF BOT!"); Console.ResetColor(); Console.WriteLine("\n"); Wolf newWolf = new Wolf("Wolf Bot"); return(newWolf); } }
// Ask user for their character and name choice. public static object CreateUser() { Console.ForegroundColor = ConsoleColor.DarkYellow; Console.WriteLine("What class do you want to be?"); Console.WriteLine("SELECT (CANINE): '1' for Wolf, '2' for Hyena, '3' for Husky."); Console.WriteLine("SELECT (FELINE): '4' for Tiger, '5' for Cheetah, '6' for Feral Cat."); Console.WriteLine("Type 'Quit' to quit game"); Console.ResetColor(); string userClass = Console.ReadLine(); if (userClass == "Quit") { QuitGame(); return(null); } Console.ForegroundColor = ConsoleColor.DarkYellow; Console.WriteLine("What do you want your character's name to be?"); Console.ResetColor(); string userName = Console.ReadLine(); if (userName == "Quit") { QuitGame(); return(null); } switch (userClass) { case "1": Wolf newWolf = new Wolf(userName); return(newWolf); case "2": Hyena newHyena = new Hyena(userName); return(newHyena); case "3": Husky newHusky = new Husky(userName); return(newHusky); case "4": Tiger newTiger = new Tiger(userName); return(newTiger); case "5": Cheetah newCheetah = new Cheetah(userName); return(newCheetah); case "6": FeralCat newFeralCat = new FeralCat(userName); return(newFeralCat); default: Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("NOT AN OPTION."); Console.ResetColor(); StartGame(); return(null); } }