Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. Console.WriteLine("Player VS Monsters: The Epic Game!\n");
  2. Console.WriteLine();
  3.  
  4. int choice= 0;
  5.  
  6. Random rand = new Random();
  7.  
  8. while(choice !=3 )
  9. {
  10. Console.WriteLine("[1]. Create Player");
  11. Console.WriteLine("[2]. Create Monster");
  12. Console.WriteLine("[3]. Fight in the arena");
  13. Console.WriteLine("[4]. Exit\n");
  14. Console.WriteLine($"Current number of monsters is: {Monster.countofMonsters}\n");
  15. Console.Write("Make your choice: ");
  16.  
  17. choice = int.Parse(Console.ReadLine());
  18. Console.WriteLine();
  19.  
  20. switch (choice)
  21. {
  22. case 1:
  23. if(Player.playerCount == 0)
  24. {
  25. Console.Clear();
  26. Console.Write("What is the name of the Player: ");
  27. string playerName = Console.ReadLine();
  28. int playerHealth = rand.Next(50, 100);
  29. Console.WriteLine($"Player {playerName} rolled RNG and received {playerHealth} HP\n\n");
  30. Player Player1 = new Player(playerName, playerHealth);
  31. }
  32. else
  33. {
  34. Console.ForegroundColor = ConsoleColor.Red;
  35. Console.WriteLine("Player already created!\n");
  36. Console.ResetColor();
  37. }
  38. break;
  39. case 2:
  40. Console.Clear();
  41. Console.Write("What is the name of the Monster: ");
  42. string monsterName = Console.ReadLine();
  43. int monsterHealth = rand.Next(30, 50);
  44. Console.WriteLine($"Monster {monsterName} rolled RNG and received {monsterHealth} HP\n\n");
  45. Monster monster1 = new Monster(monsterName, monsterHealth);
  46.  
  47. break;
  48. case 3:
  49. if(Monster.countofMonsters == 0 || Player.playerCount == 0)
  50. {
  51. Console.ForegroundColor = ConsoleColor.Red;
  52. Console.WriteLine("There are not enough combatants in the arena! Why don't you create some?\n");
  53. Console.ResetColor();
  54. choice = 0;
  55. }
  56. else
  57. {
  58. choice = 3;
  59. Console.Clear();
  60. }
  61. break;
  62. case 4:
  63. Environment.Exit(0);
  64. break;
  65. default:
  66. break;
  67. }
  68. }
  69.  
  70. //TODO: Fight in the "arena"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement