Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Console.WriteLine("Player VS Monsters: The Epic Game!\n");
- Console.WriteLine();
- int choice= 0;
- Random rand = new Random();
- while(choice !=3 )
- {
- Console.WriteLine("[1]. Create Player");
- Console.WriteLine("[2]. Create Monster");
- Console.WriteLine("[3]. Fight in the arena");
- Console.WriteLine("[4]. Exit\n");
- Console.WriteLine($"Current number of monsters is: {Monster.countofMonsters}\n");
- Console.Write("Make your choice: ");
- choice = int.Parse(Console.ReadLine());
- Console.WriteLine();
- switch (choice)
- {
- case 1:
- if(Player.playerCount == 0)
- {
- Console.Clear();
- Console.Write("What is the name of the Player: ");
- string playerName = Console.ReadLine();
- int playerHealth = rand.Next(50, 100);
- Console.WriteLine($"Player {playerName} rolled RNG and received {playerHealth} HP\n\n");
- Player Player1 = new Player(playerName, playerHealth);
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine("Player already created!\n");
- Console.ResetColor();
- }
- break;
- case 2:
- Console.Clear();
- Console.Write("What is the name of the Monster: ");
- string monsterName = Console.ReadLine();
- int monsterHealth = rand.Next(30, 50);
- Console.WriteLine($"Monster {monsterName} rolled RNG and received {monsterHealth} HP\n\n");
- Monster monster1 = new Monster(monsterName, monsterHealth);
- break;
- case 3:
- if(Monster.countofMonsters == 0 || Player.playerCount == 0)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine("There are not enough combatants in the arena! Why don't you create some?\n");
- Console.ResetColor();
- choice = 0;
- }
- else
- {
- choice = 3;
- Console.Clear();
- }
- break;
- case 4:
- Environment.Exit(0);
- break;
- default:
- break;
- }
- }
- //TODO: Fight in the "arena"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement