fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class playerCharacter{
  5. playerCharacter();
  6. playerCharacter(string, int, int, int, int, int, int);
  7. ~playerCharacter();
  8.  
  9. string * name;
  10. int * strength;
  11. int * dex;
  12. int * intellect;
  13. int * luck;
  14. int * maxHp;
  15. int * maxMp;
  16. int * level;
  17. int * experience;
  18. int * toNextLevel;
  19. };
  20.  
  21.  
  22. playerCharacter::playerCharacter(){
  23. *name = "blah";
  24. strength =0;
  25. dex =0;
  26. intellect =0;
  27. luck =0;
  28. maxHp =0;
  29. maxMp =0;
  30. int experience =0;
  31. level = 0;
  32. int toNextLevel = 12345678;
  33.  
  34. }
  35.  
  36. playerCharacter::playerCharacter(string cname, int s, int d, int i, int l , int maxh, int maxm){
  37. *name = cname;
  38. *strength =s;
  39. *dex =d;
  40. *intellect =i;
  41. *luck =l;
  42. *maxHp =maxh;
  43. *maxMp =maxm;
  44. int level = 1;
  45. int experience =0;
  46. int toNextLevel = (1000*level);
  47.  
  48. }
  49.  
  50. playerCharacter::~playerCharacter(){
  51. delete name;
  52. delete strength;
  53. delete dex;
  54. delete intellect;
  55. delete luck;
  56. delete maxHp;
  57. delete maxMp;
  58. delete level;
  59. delete experience;
  60. delete toNextLevel;
  61. }
  62.  
  63. void showClassMenu();
  64.  
  65. int main () {
  66.  
  67. string str ="";
  68. cout << "What would you like to name your character?: ";
  69. getline(cin, str);
  70.  
  71. showClassMenu();
  72.  
  73.  
  74. return 0;
  75. }
  76.  
  77. void showClassMenu(){
  78. cout << "\n\nWarrior, high strength, low intellect, high hp, low mp, a war hardened hero. ";
  79. cout << "\nRanger, med strength, high dex, low intellect, med hp, low mp, a long range hero. ";
  80. cout << "\nMage, low strength, med dex, high intellect, low hp, high mp, an old man wise in the ways of magic. " << endl;
  81. cout << "Press 1 to make a warrior, press 2 to make a ranger, press 3 to make a mage";
  82.  
  83. }
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty