Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include "windows.h"
  4. using namespace std;
  5.  
  6. string classChooser();
  7. string nameChooser();
  8. void introStory(string position, string name);
  9.  
  10. int main()
  11. {
  12. string charPosition = classChooser();
  13. cout << "You chose " << charPosition << " as your class.";
  14. string charName = nameChooser();
  15. introStory(charPosition,charName);
  16.  
  17. return 0;
  18. }
  19.  
  20. string classChooser()
  21. {
  22.  
  23. string position;
  24. while(true)
  25. {
  26. cout << "Choose a class wisely... nn";
  27. cout << "tWarrior: nt Health:75nt Attack:25nn";
  28. cout << "tWizard: nt Health:25nt Attack:75nn";
  29. cout << "tRogue: nt Health:50nt Attack:50n";
  30.  
  31. cout << "nWhich class do you want to select? : ";
  32. cin >> position;
  33. if(position == "wizard" ||position == "warrior" ||position == "rogue" ||position == "Wizard" ||position == "Warrior" ||position == "Rogue")
  34. {
  35. system("cls");
  36. return position;
  37. }
  38. else
  39. {
  40. cout << "nnMake sure you typed in the word correctly, and used appropriate capitalization.";
  41. Sleep(3200);
  42. system("cls");
  43. continue;
  44. }
  45. }
  46. }
  47.  
  48. string nameChooser()
  49. {
  50. string name;
  51. cout << "nPlease choose a name for your hero: ";
  52. cin >> name;
  53. cout << "nYour name is now " << name;
  54. return name;
  55. }
  56. void introStory(string position, string name)
  57. {
  58. cout << "nLet the story begin...";
  59. Sleep(2100);
  60. system("cls");
  61. cout << "Once upon a time in a poor village, a young kid named " << name << " was digging a hole.";
  62. Sleep(4000);
  63. cout << "After digging for a couple hours he came across a chest.";
  64. Sleep(3200);
  65. string weapon;
  66. if(position == "Warrior" || position == "warrior")
  67. weapon = "sword";
  68. else if(position == "Wizard" || position == "wizard")
  69. weapon = "wand";
  70. else
  71. weapon = "dagger";
  72. cout << "When he opened it, he found a " << weapon;
  73. Sleep(2000);
  74. cout << "That was exactly what he had been wanting for the past couple of months.";
  75. Sleep(3000);
  76. cout << "You see, " << name << " wanted to be a " << position;
  77. Sleep(2700);
  78. cout << "So a " << weapon << " was the perfect choice.";
  79. Sleep(2100);
  80. cout << "With his new " << weapon << " he could finally explore the dark cave his father was lossed in.";
  81. Sleep(4000);
  82. cout << "He could slay the monsters in there everyone was so terrified of.";
  83. Sleep(3200);
  84. cout << "He headed toward the cave.";
  85. Sleep(2000);
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement