944,033 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2157
  • C++ RSS
You are currently viewing page 1 of this multi-page discussion thread
Nov 2nd, 2009
0

Text based rpg source code.

Expand Post »
This is something that I made a while back during thanksgiving 2007. If you want to add on to it you can, it's not very well made as in the organization sucks. But it is pretty cool in the fact that you can navigate your acii environ with color and fight people on the road. It contains 1 random battle, 6 weapons, 2 towns, 1 quest that doesn't work, a cool map, a 5x5 map navigation system, and a battle system that is kinda cool, a level up sequence that happens only once, and some other unfinished stuff. It's pretty cool overall.
C++ Syntax (Toggle Plain Text)
  1. #include <cstdlib>
  2. #include <cstdio>
  3. #include <iostream>
  4. #include <stdlib.h>
  5. #include <ctime>
  6. #include <conio.h>
  7. #include <fstream>
  8. using namespace std;
  9. int main(int argc, char *argv[])
  10. {
  11. string line;
  12. ofstream dragtxt;
  13. HANDLE hConsole; int k; hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
  14. // you can loop k higher to see more color choices
  15. string MAP[34][34] = {
  16. {"|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|" },
  17. {"|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|" },
  18. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|F|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  19. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|T|", "|R|", "|F|", "|F|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  20. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|G|", "|R|", "|R|", "|F|", "|F|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|B|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  21. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|F|", "|F|", "|R|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|B|", "|P|", "|B|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  22. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|B|", "|W|", "|F|", "|R|", "|B|", "|B|", "|B|", "|B|", "|W|", "|W|", "|B|", "|B|", "|G|", "|B|", "|B|", "|W|", "|W|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  23. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|B|", "|B|", "|B|", "|R|", "|R|", "|R|", "|G|", "|B|", "|B|", "|B|", "|B|", "|G|", "|G|", "|G|", "|B|", "|B|", "|W|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  24. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|B|", "|B|", "|G|", "|G|", "|R|", "|P|", "|R|", "|R|", "|R|", "|R|", "|R|", "|R|", "|R|", "|G|", "|G|", "|R|", "|R|", "|T|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  25. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|B|", "|B|", "|G|", "|G|", "|R|", "|R|", "|F|", "|F|", "|F|", "|F|", "|G|", "|F|", "|G|", "|R|", "|R|", "|R|", "|R|", "|B|", "|B|", "|B|", "|W|", "|W|", "|I|", "|I|" },
  26. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|G|", "|G|", "|R|", "|R|", "|R|", "|G|", "|R|", "|G|", "|F|", "|F|", "|F|", "|G|", "|G|", "|G|", "|G|", "|G|", "|F|", "|F|", "|R|", "|B|", "|W|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  27. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|M|", "|G|", "|G|", "|R|", "|F|", "|F|", "|R|", "|R|", "|G|", "|G|", "|G|", "|G|", "|G|", "|W|", "|W|", "|G|", "|G|", "|G|", "|F|", "|R|", "|R|", "|W|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  28. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|M|", "|M|", "|M|", "|G|", "|R|", "|F|", "|M|", "|R|", "|P|", "|G|", "|G|", "|G|", "|G|", "|W|", "|W|", "|W|", "|W|", "|F|", "|F|", "|F|", "|F|", "|R|", "|T|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  29. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|R|", "|R|", "|R|", "|R|", "|R|", "|G|", "|G|", "|W|", "|W|", "|F|", "|F|", "|F|", "|F|", "|F|", "|R|", "|W|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  30. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|M|", "|M|", "|P|", "|M|", "|M|", "|M|", "|M|", "|M|", "|B|", "|B|", "|B|", "|P|", "|F|", "|F|", "|W|", "|W|", "|W|", "|F|", "|P|", "|F|", "|F|", "|R|", "|W|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  31. {"|I|", "|I|", "|W|", "|W|", "|W|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|B|", "|B|", "|W|", "|B|", "|B|", "|F|", "|F|", "|G|", "|W|", "|F|", "|F|", "|F|", "|F|", "|F|", "|R|", "|G|", "|G|", "|G|", "|G|", "|I|", "|I|" },
  32. {"|I|", "|I|", "|W|", "|F|", "|F|", "|F|", "|F|", "|M|", "|F|", "|F|", "|M|", "|M|", "|M|", "|W|", "|B|", "|W|", "|W|", "|B|", "|G|", "|G|", "|R|", "|T|", "|F|", "|F|", "|F|", "|F|", "|R|", "|R|", "|G|", "|G|", "|G|", "|W|", "|I|", "|I|" },
  33. {"|I|", "|I|", "|W|", "|F|", "|F|", "|F|", "|F|", "|R|", "|R|", "|R|", "|T|", "|M|", "|M|", "|W|", "|W|", "|W|", "|W|", "|W|", "|G|", "|G|", "|R|", "|F|", "|F|", "|F|", "|F|", "|F|", "|R|", "|G|", "|G|", "|G|", "|P|", "|G|", "|I|", "|I|" },
  34. {"|I|", "|I|", "|G|", "|F|", "|F|", "|P|", "|F|", "|R|", "|G|", "|G|", "|W|", "|M|", "|W|", "|W|", "|W|", "|W|", "|B|", "|G|", "|G|", "|R|", "|R|", "|F|", "|F|", "|F|", "|F|", "|R|", "|R|", "|G|", "|G|", "|G|", "|G|", "|G|", "|I|", "|I|" },
  35. {"|I|", "|I|", "|G|", "|G|", "|T|", "|R|", "|R|", "|R|", "|G|", "|B|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|G|", "|R|", "|R|", "|F|", "|F|", "|F|", "|F|", "|F|", "|R|", "|T|", "|G|", "|W|", "|G|", "|W|", "|W|", "|I|", "|I|" },
  36. {"|I|", "|I|", "|W|", "|G|", "|G|", "|G|", "|G|", "|B|", "|B|", "|B|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|G|", "|R|", "|F|", "|F|", "|F|", "|F|", "|F|", "|P|", "|R|", "|R|", "|G|", "|W|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  37. {"|I|", "|I|", "|W|", "|G|", "|G|", "|G|", "|B|", "|B|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|B|", "|B|", "|G|", "|R|", "|F|", "|F|", "|F|", "|F|", "|F|", "|F|", "|F|", "|R|", "|G|", "|G|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  38. {"|I|", "|I|", "|W|", "|W|", "|G|", "|B|", "|B|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|G|", "|R|", "|F|", "|F|", "|F|", "|F|", "|F|", "|F|", "|F|", "|R|", "|G|", "|W|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  39. {"|I|", "|I|", "|W|", "|W|", "|W|", "|P|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|B|", "|T|", "|R|", "|R|", "|R|", "|F|", "|F|", "|F|", "|F|", "|R|", "|R|", "|F|", "|F|", "|F|", "|W|", "|W|", "|I|", "|I|" },
  40. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|B|", "|G|", "|R|", "|R|", "|R|", "|R|", "|R|", "|R|", "|F|", "|F|", "|F|", "|F|", "|W|", "|W|", "|I|", "|I|" },
  41. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|B|", "|B|", "|G|", "|G|", "|G|", "|G|", "|G|", "|G|", "|R|", "|F|", "|F|", "|F|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  42. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|B|", "|B|", "|B|", "|B|", "|F|", "|F|", "|F|", "|P|", "|G|", "|G|", "|G|", "|R|", "|F|", "|F|", "|M|", "|M|", "|W|", "|W|", "|I|", "|I|" },
  43. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|B|", "|B|", "|B|", "|F|", "|F|", "|F|", "|F|", "|F|", "|F|", "|R|", "|R|", "|R|", "|F|", "|F|", "|M|", "|M|", "|M|", "|W|", "|I|", "|I|" },
  44. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|B|", "|F|", "|F|", "|M|", "|M|", "|F|", "|F|", "|M|", "|F|", "|R|", "|F|", "|F|", "|F|", "|M|", "|M|", "|M|", "|M|", "|W|", "|I|", "|I|" },
  45. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|B|", "|B|", "|B|", "|B|", "|B|", "|F|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|R|", "|F|", "|M|", "|P|", "|M|", "|M|", "|P|", "|M|", "|W|", "|I|", "|I|" },
  46. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|P|", "|W|", "|W|", "|W|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|T|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|W|", "|W|", "|I|", "|I|" },
  47. {"|I|", "|I|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|W|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|M|", "|W|", "|W|", "|W|", "|I|", "|I|" },
  48. {"|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|" },
  49. {"|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|", "|I|" }
  50. };
  51. //NEW MAP TOWN PAWS//
  52. string TerraCityLevel1[15][20] = {
  53. {" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "},
  54. {" ","|~|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|~|"," "},
  55. {" ","|W|","|H|"," "," "," ","|H|","|P|","|T|","|H|","|H|","|W|"," "," "," "," "," "," ","|W|"," "},
  56. {" ","|W|","|H|"," ","|H|"," ","|H|"," "," "," "," ","|X|"," ","|W|","|W|","|W|","|W|"," ","|W|"," "},
  57. {" ","|W|","|H|"," ","|M|"," ","|H|"," "," ","|H|"," ","|W|"," ","|W|","|P|","|P|","|W|"," ","|W|"," "},
  58. {" ","|W|"," "," ","|H|"," ","|H|"," "," ","|H|"," ","|W|"," ","|W|","|P|","|P|","|W|"," ","|W|"," "},
  59. {" ","|W|","|B|"," ","|A|"," ","|C|"," "," ","|H|"," ","|W|"," ","|W|","|G|","|P|","|W|"," ","|W|"," "},
  60. {" ","|E|"," "," "," "," ","|H|"," "," ","|F|"," ","|W|"," "," "," ","|P|","|W|"," ","|W|"," "},
  61. {" ","|W|"," "," ","|H|"," ","|H|"," "," ","|H|"," ","|W|"," ","|W|","|G|","|P|","|W|"," ","|W|"," "},
  62. {" ","|W|","|M|"," ","|V|"," ","|H|","|H|"," ","|H|","|H|","|W|"," ","|W|","|P|","|P|","|W|"," ","|W|"," "},
  63. {" ","|W|","|H|"," ","|H|"," ","|H|","|H|"," ","|H|","|H|","|W|"," ","|W|","|P|","|P|","|W|"," ","|W|"," "},
  64. {" ","|W|","|H|"," ","|H|"," ","|H|","|H|"," ","|H|","|H|","|W|"," ","|W|","|W|","|W|","|W|"," ","|W|"," "},
  65. {" ","|W|","|H|"," "," "," "," "," "," ","|H|","|H|","|W|"," "," "," "," "," "," ","|W|"," "},
  66. {" ","|~|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|W|","|~|"," "},
  67. {" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "}
  68. };
  69. string Graveyardlvl1[12][9]= {
  70. {" "," "," "," "," "," "," "," "," "},
  71. {" ","|~|","|=|","|=|","|E|","|=|","|=|","|~|"," "},
  72. {" ","|-|","|G|"," "," ","|G|"," |","|-|"," "},
  73. {" ","|-|","| ","|G|"," ","|G|"," |","|-|"," "},
  74. {" ","|-|","| "," "," "," "," |","|-|"," "},
  75. {" ","|-|","| ","|G|","|G|"," ","|G|","|-|"," "},
  76. {" ","|-|","| "," "," "," "," |","|-|"," "},
  77. {" ","|-|","|G|","|G|"," ","|G|"," |","|-|"," "},
  78. {" ","|-|","| "," "," "," "," |","|-|"," "},
  79. {" ","|-|","|L|"," ","|G|"," ","|G|","|-|"," "},
  80. {" ","|~|","|=|","|=|","|=|","|=|","|=|","|~|"," "},
  81. {" "," "," "," "," "," "," "," "," "}
  82. };
  83. int q;
  84. q = 7;
  85. int u;
  86. u = 2;
  87. int z;
  88. z = 7;
  89. int w;
  90. w = 4;
  91. string commandpaws;
  92.  
  93.  
  94. //Inaccessable parts of PAWS//
  95. // 0 1 2 3 4 5 6 //
  96. //0 |~||=||=||=||=||=||~|//
  97. //1 | ||B| |P| | |//
  98. //2 | | |G| | |//
  99. //3 | ||A| |M|| |//
  100. //4 | ||H| |F| |H| | |//
  101. //5 | ||H| | |//
  102. //6 |~||=||=||E||=||=||~|//
  103. string tpaws[10][10]= {
  104. {" "," "," "," "," "," "," "," "," "},
  105. {" ","|~|","|=|","|=|","|=|","|=|","|=|","|~|"," "},
  106. {" ","| |","|B|"," "," ","|P|"," |","| |"," "},
  107. {" ","| |"," ","|H|","|H|"," ","|H|","| |"," "},
  108. {" ","| |"," "," "," "," "," |","| |"," "},
  109. {" ","| |","|H|","|G|"," ","|M|"," |","| |"," "},
  110. {" ","| |","|H|","|F|"," "," "," |","| |"," "},
  111. {" ","| |","|H|"," "," "," ","|H|","| |"," "},
  112. {" ","|~|","|=|","|=|","|E|","|=|","|=|","|~|"," "},
  113. {" "," "," "," "," "," "," "," "," "}
  114. };
  115.  
  116. int x;
  117. x = 22;
  118. int y;
  119. y = 20;
  120. string commandmpdir;
  121. srand(time(0));
  122. string name;
  123. int potionleft;
  124. potionleft = 0;
  125. cout<<"Welcome..."<<endl;
  126. system("PAUSE");
  127. system("cls");
  128. cout<<"Mighty Adventurer..."<<endl;
  129. system("PAUSE");
  130. system("cls");
  131. cout<<" ______________ "<<endl;
  132. cout<<" ________ |I am Memnon. | "<<endl;
  133. cout<<" / |Surely You | "<<endl;
  134. cout<<" | <o> <o> | |Have Heard Of | "<<endl;
  135. cout<<" | || | |Me... | "<<endl;
  136. cout<<" | ~~ | |I am a master | "<<endl;
  137. cout<<" | ____ | |spirt guide. | "<<endl;
  138. cout<<" / |I shall guide | "<<endl;
  139. cout<<" -------- |you... | "<<endl;
  140. cout<<" ---------------- "<<endl;
  141. system("PAUSE");
  142. system("cls");
  143. cout<<"You find a scroll on the ground... You pick it up and read it..."<<endl;
  144. system("pause");
  145. system("cls");
  146. {
  147. // pick the colorattribute k you want
  148. SetConsoleTextAttribute(hConsole, 12);
  149. }
  150. cout<<" /-------/"<<endl;
  151. cout<<" / Death / "<<endl;
  152. cout<<" / Is In / "<<endl;
  153. cout<<" / Your / "<<endl;
  154. cout<<" / Blood / "<<endl;
  155. cout<<"/-------/ "<<endl;
  156. system("pause");
  157. system("cls");
  158. {
  159. SetConsoleTextAttribute(hConsole, 2);
  160. }
  161. cout<<"You: Memnon... What is this?"<<endl;
  162. cout<<"Memnon: That is a Scroll of Signs... I though that that i had seen the last of \nthose..."<<endl;
  163. cout<<"Memnon: The Scroll of Signs is now bound to you because you picked it up... The\nlast user must have died..."<<endl;
  164. cout<<"You: So what does it do Memnon?"<<endl;
  165. cout<<"Memnon: It switches worlds... Now you are in Kamada... Which is not a \nplace you want to be in..."<<endl;
  166. cout<<"You: So what do i do... and why is is not a good place?"<<endl;
  167. cout<<"Memnon: You will soon find out..."<<endl;
  168. system("PAUSE");
  169. system("CLS");
  170. cout<<"Memnon: You are now in the character creation screen."<<endl;
  171. //Item LooT: Class//
  172. int bndtcape;
  173. bndtcape = 0;
  174. int ogreshld;
  175. ogreshld = 0;
  176. int bndtswrd;
  177. bndtswrd = 0;
  178. int centaleg;
  179. centaleg = 0;
  180. int goldpeic;
  181. goldpeic = 0;
  182. int ogrebelt;
  183. ogrebelt = 0;
  184. int leathert;
  185. leathert = 0;
  186. int pixedust;
  187. pixedust = 0;
  188. int ogremuck;
  189. ogremuck = 0;
  190. int evilesse;
  191. evilesse = 0;
  192. int centanec;
  193. centanec = 0;
  194. {
  195. SetConsoleTextAttribute(hConsole, 10);
  196. }
  197. int level;
  198. level = 0;
  199. //Non-Usable Character Screen//
  200. cout<<"________________________________________________________________________________"<<endl;
  201. cout<<"|Name: |Number |Bonus |Saves |Equipment |Sell Price |"<<endl;
  202. cout<<"|------------|-----------|-------|-------|--------------------|----------------|"<<endl;
  203. cout<<"|Srength |10 |0 |none |Scroll of Signs |Souldbound |"<<endl;
  204. cout<<"|------------|-----------|-------|-------|--------------------|----------------|"<<endl;
  205. cout<<"|Dexterity |10 |0 |0 RFLX |Cotton Shirt +1AC |5 gold |"<<endl;
  206. cout<<"|------------|-----------|-------|-------|--------------------|----------------|"<<endl;
  207. cout<<"|Constitution|10 |0 |0 FORT |Woven Legs +1AC |7 gold |"<<endl;
  208. cout<<"|------------|-----------|-------|-------|--------------------|----------------|"<<endl;
  209. cout<<"|Wisdom |10 |0 |0 WILL |Leather Shoes +1AC |6 gold |"<<endl;
  210. cout<<"|------------|-----------|-------|-------|--------------------|----------------|"<<endl;
  211. cout<<"|Intellect |10 |0 |0 |Watch |25 gold |"<<endl;
  212. cout<<"|------------|-----------|-------|-------|--------------------|----------------|"<<endl;
  213. cout<<"|Charisma |10 |0 |0 | | |"<<endl;
  214. cout<<"|------------|-----------|-------|-------|--------------------|----------------|"<<endl;
  215. cout<<" Health Mana "<<endl;
  216. cout<<" ----------------------- 100/100 ----------------------- 100/100"<<endl;
  217. cout<<" |/////////////////////| |/////////////////////| "<<endl;
  218. cout<<" ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ "<<endl;
  219. cout<<" Experience "<<endl;
  220. cout<<" --------------------------------------------------------- 0/100 "<<endl;
  221. cout<<" | | "<<endl;
  222. cout<<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "<<endl;
  223. cout<<"Armour Class"<<endl;
  224. cout<<"|----------|"<<endl;
  225. cout<<"|//////////|"<<endl;
  226. cout<<"|////10////|"<<endl;
  227. cout<<"|//////////|"<<endl;
  228. cout<<"|----------|"<<endl;
  229. system("PAUSE");
  230. {
  231. SetConsoleTextAttribute(hConsole, 2);
  232. }
  233. cout<<"Memnon: By the way, What is your name?"<<endl;
  234. cin.ignore();
  235. cin>>name;
  236. system("cls");
  237. int str;
  238. str = 10;
  239. int dex;
  240. dex = 10;
  241. int con;
  242. con = 10;
  243. int wis;
  244. wis = 10;
  245. int intel;
  246. intel = 10;
  247. int charis;
  248. charis = 10;
  249. int math400;
  250. int math401;
  251. int math402;
  252. int maxhp;
  253. maxhp = 100 + ((con - 10)/2)*10;
  254. int rflx;
  255. int fort;
  256. int will;
  257. math400 = dex/2;
  258. rflx = math400;
  259. math401 = con/2;
  260. fort = math401;
  261. math402 = wis/2;
  262. will = math402;
  263. int ac;
  264. ac = (dex - 10)/2 + 10;
  265. int atkbonus;
  266. atkbonus = (str - 10)/2;
  267. int dmgbonusgg;
  268. dmgbonusgg = 0;
  269. {
  270. SetConsoleTextAttribute(hConsole, 10);
  271. }
  272.  
  273. //Non-Usable Character Screen//
  274. cout<<"________________________________________________________________________________"<<endl;
  275. cout<<"|Name:";cout<<name;cout<<" |Number |Bonus |Saves |Equipment |Sell Price |"<<endl;
  276. cout<<"|------------|-----------|-------|-------|--------------------|----------------|"<<endl;
  277. cout<<"|Srength |10 |0 |none |Scroll of Signs |souldbound |"<<endl;
  278. cout<<"|------------|-----------|-------|-------|--------------------|----------------|"<<endl;
  279. cout<<"|Dexterity |10 |0 |0 RFLX |Cotton Shirt +1AC |5 gold |"<<endl;
  280. cout<<"|------------|-----------|-------|-------|--------------------|----------------|"<<endl;
  281. cout<<"|Constitution|10 |0 |0 FORT |Woven Legs +1AC |7 gold |"<<endl;
  282. cout<<"|------------|-----------|-------|-------|--------------------|----------------|"<<endl;
  283. cout<<"|Wisdom |10 |0 |0 WILL |Leather Shoes +1AC |6 gold |"<<endl;
  284. cout<<"|------------|-----------|-------|-------|--------------------|----------------|"<<endl;
  285. cout<<"|Intellect |10 |0 |0 |Watch |25 gold |"<<endl;
  286. cout<<"|------------|-----------|-------|-------|--------------------|----------------|"<<endl;
  287. cout<<"|Charisma |10 |0 |0 | | |"<<endl;
  288. cout<<"|------------|-----------|-------|-------|--------------------|----------------|"<<endl;
  289. cout<<" Health Mana "<<endl;
  290. cout<<" ----------------------- 100/100 ----------------------- 100/100"<<endl;
  291. cout<<" |/////////////////////| |/////////////////////| "<<endl;
  292. cout<<" ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ "<<endl;
  293. cout<<" Experience "<<endl;
  294. cout<<" --------------------------------------------------------- 0/100"<<endl;
  295. cout<<" | | "<<endl;
  296. cout<<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "<<endl;
  297. cout<<"Armour Class"<<endl;
  298. cout<<"|----------|"<<endl;
  299. cout<<"|//////////|"<<endl;
  300. cout<<"|////10////|"<<endl;
  301. cout<<"|//////////|"<<endl;
  302. cout<<"|----------|"<<endl;
  303. system("PAUSE");
  304. system("cls");
  305. string command;
  306. int Rand_Num;
  307. int math1;
  308. int math2;
  309. int math3;
  310. int math4;
  311. int math5;
  312. int math6;
  313. int math7;
  314. int math8;
  315. int math9;
  316. int math10;
  317. int Health;
  318. Health = 100;
  319. int EnDamage;
  320. EnDamage = 0;
  321. int Mana;
  322. int HealthPotion;
  323. HealthPotion = 0;
  324. string buything;
  325. int h;
  326. h = 0;
  327. int a;
  328. int b;
  329. int c;
  330. int item;
  331. int xgp;
  332. xgp = 0;
  333. int dgp;
  334. dgp = 15;
  335. int quest1active;
  336. quest1active = 0;
  337. int sgp;
  338. sgp = 30;
  339. string itemquip;
  340. int lgp;
  341. lgp = 50;
  342. int mgp;
  343. mgp = 60;
  344. int bgp;
  345. bgp = 115;
  346. int ManaPotion;
  347. ManaPotion = 0;
  348. Mana = 100;
  349. int magicor;
  350. magicor = 0;
  351. int exp1;
  352. exp1 = 100;
  353. string attackcommand;
  354. int monhp;
  355. monhp = 0;
  356. int monac;
  357. monac = 0;
  358. int mondmg;
  359. mondmg = 0;
  360. string mon;
  361. int atkac;
  362. int equip;
  363. int dmg1;
  364. dmg1 = 0;
  365. int monhp1;
  366. int monac1;
  367. int bluntforceimpact;
  368. bluntforceimpact = 0;
  369. int reputation;
  370. reputation = 0;
  371. string mon1;
  372. int daysleft1;
  373. daysleft1 = 25;
  374. int exp;
  375. exp = 0;
  376. string response;
  377. int detstart;
  378. detstart = 1;
  379. //blacksmith-partially implemented for time being
  380. int wepequip;
  381. int dagst;
  382. dagst = 0;
  383. int swordst;
  384. swordst = 0;
  385. int lngswst;
  386. lngswst = 0;
  387. int macest;
  388. macest = 0;
  389. int bastst;
  390. bastst = 0;
  391. int axest;
  392. axest = 0;
  393. //2hd
  394. int gretst;
  395. gretst = 0;
  396. int halbst;
  397. halbst = 0;
  398. int grtaxest;
  399. grtaxest = 0;
  400. //armoursmith-paritally implemented for time being
  401. int helmst;
  402. helmst = 0;
  403.  
  404. goto start;
  405. {
  406. HPSTASIS:
  407. math10 = Health - EnDamage;
  408. Health = math10;
  409. if (Health <= 0) {cout<<"You have died.";system("PAUSE");goto jumpto;}
  410. else if (Health > 0){
  411. goto CHECKPOINT;
  412. }
  413. }
  414. {
  415. //Palace Paws Quest//
  416. PQUEST:
  417. z = 2;
  418. w = 4;
  419. cout<<"You are in the Palace of Paws."<<endl;
  420. cin.get();
  421. if (quest1active >= 0){
  422. PQUESTOVERDO:
  423. cout<<"You are approached by a man dressed in robes."<<endl;
  424. cin.get();
  425. cout<<"Strange Man: I need your help!"<<endl;
  426. cout<<"What do you say?"<<endl;
  427. cout<<"1. What do you need help with?"<<endl;
  428. cout<<"2. Who are you?"<<endl;
  429. cout<<"3. Why are you so scared?"<<endl;
  430. cout<<"4. Get lost."<<endl;
  431. cin>>response;
  432. cin.ignore();
  433. if (response == "1" or "2" or "3"){reputation = reputation +5;
  434. goto talk1v1;}
  435. else if (response == "4"){reputation = reputation - 5;
  436. goto endq1erly;}
  437. else if (response != "1" or "2" or "3" or "4")
  438. {cout<<"This is not a correct response item."<<endl;
  439. cin.get();
  440. system("CLS");
  441. goto PQUESTOVERDO;}
  442. talk1v1:
  443. cout<<"I am Sharideth, a mage of the west sector. I came to Paws looking for an ammulet of power.But all I found was an old cursed almulet. The dead are now rising from their gaves to kill me. You look strong, If you would go to the graveyards not far from here, kill the banshee lord, and retreive the the stone of divinity, I would be able to break free of this curse. I might, be able to teach you a trick or two from my spell book, and maybe give you some gold in return."<<endl;
  444. cout<<"I need you to do this right away. Please help me!"<<endl<<endl;
  445. cout<<"What should you do?"<<endl;
  446. cout<<"1. I will help you Sharideth, I will try my hardest."<<endl;
  447. cout<<"2. I fear I am not worthy of this quest Sharideth."<<endl;
  448. cout<<"3. Nuh, uh. No Graveyards or Banshee Lords for me."<<endl;
  449. cout<<"4. I don't really care about this. You have no use to me."<<endl;
  450. cin>>response;
  451. if (response == "1"){reputation = reputation + 5;
  452. goto talk1v2;}
  453. else if (response == "2"){goto talk1v2;}
  454. else if (response == "3"){goto endq1erly;}
  455. else if (response == "4"){reputation = reputation - 5;goto endq1erly;}
  456. else if (response != "1" or "2" or "3" or "4")
  457. {cout<<"This is not a correct response item."<<endl;
  458. cin.get();
  459. system("CLS");
  460. goto talk1v1;}
  461. talk1v2:
  462. cout<<"You have 25 days to complete this quest."<<endl;
  463. cin.get();
  464. quest1active = 1;
  465. goto tpawsmp;
  466. endq1erly:
  467. cout<<"You see the old man. Then in an instant he is attacked by a pack of ghoul lords."<<endl;
  468. cout<<"You have lost 25 reputation points."<<endl;
  469. reputation = reputation - 25;
  470. cout<<"Quest Failed!"<<endl;
  471. quest1active = 2;
  472. cin.get();
  473. goto tpawsmp;
  474. }
  475. goto tpawsmp;
  476. }
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488. {
  489. //For the beginning fight//
  490. COMBATSTASIS:
  491. CHECKPOINT:
  492. {
  493. SetConsoleTextAttribute(hConsole, 14);
  494. }
  495. cout<<"Here are you options ==>"<<endl;
  496. cout<<"1. Attack"<<endl;
  497. cout<<"2. Magic"<<endl;
  498. cout<<"3. Item"<<endl;
  499. cout<<"Health Points"<<endl;
  500. cout<<Health<<endl<<endl;
  501. cout<<"Magic Points"<<endl;
  502. cout<<Mana<<endl<<endl;
  503. cout<<"Type the number of what you want to use and press enter!"<<endl;
  504. cin.ignore();
  505. cin >>command;
  506. system("CLS");
  507. if (command == "1"){goto attack;}
  508. else if (command == "2"){goto magic;}
  509. else if (command == "3"){goto inventory;}
  510. else if (command != "1" or "2" or "3"){goto CHECKPOINT;}
  511.  
  512. }
  513. //For the Beginning fight//
  514. {
  515. attack:
  516.  
  517. cout<<"You are attacking, Which type of attack will you use?"<<endl<<endl;
  518. cout<<"1. Attack"<<endl;
  519. cout<<"2. Defend"<<endl;
  520. cout<<"Choose the number you wish to select"<<endl;
  521. cin.ignore();
  522. cin>>attackcommand;
  523. if (attackcommand == "1"){
  524. Rand_Num = (rand() % 50) + atkbonus;
  525. if (Rand_Num > monac){goto Hit;}
  526. else if (Rand_Num < monac) {cout<<"You missed the ";cout<<mon1;cout<<"."<<endl;system("PAUSE"); goto EmAttack;}}
  527. else if (attackcommand == "2"){
  528. ac = ac + 5;cout<<"You are defending agianst ";cout<<mon1;cout<<"."<<endl;system("PAUSE");system("CLS"); goto EmAttack;}
  529. else if (attackcommand != "1" or "2"){system("CLS");goto attack;}
  530. Hit:
  531. system("CLS");
  532. Rand_Num = (rand() % 50) + 1;
  533. if (Rand_Num <= 4){dmg1 = Rand_Num + atkbonus + dmgbonusgg;cout<<"You hit the ";cout<<mon1;cout<<" for ";cout<<dmg1;cout<<" Damage!"<<endl;
  534. monhp = monhp - dmg1;
  535. cout<<"The ";cout<<mon1;cout<<" has ";cout<<monhp;cout<<" health left"<<endl;
  536. if (monhp <= 0){
  537. if (detstart == 1){goto Endfight;}
  538. else if (detstart == 0){goto cong;}}
  539. else if (monhp > 0){
  540. system("Pause");
  541. system("cls");
  542. goto EmAttack;
  543. }
  544. }
  545. else if (Rand_Num > 4) {goto Hit;}
  546. }
  547. {
  548. inventory:
  549. cout<<"Here are your items."<<endl;
  550. cout<<"Heath Potions:";cout<<HealthPotion<<endl;
  551. cout<<"Mana Potions:";cout<<ManaPotion<<endl;
  552. system("PAUSE");
  553. if (HealthPotion or ManaPotion > 0){goto chow;}
  554. else if (HealthPotion,ManaPotion == 0){cout<<"You have nothing, Returing to battle menu."<<endl;system("PAUSE");system("CLS");goto CHECKPOINT;
  555. chow:
  556. cout<<"Would you like to use a Health Potion?"<<endl;
  557. cout<<"1. Yes"<<endl;
  558. cout<<"2. No"<<endl;
  559. cin>>command;
  560. if (command == "1"){Health = Health + 25;if (Health > maxhp){Health = maxhp;}cout<<"You have ";cout<<Health;cout<<" now!"<<endl;
  561. HealthPotion = HealthPotion - 1;goto EmAttack;}
  562. else if (command != "1"){
  563. if(ManaPotion >= 0){goto chow1;}
  564. else if (ManaPotion ==0){cout<<"You don't have any Mana Potions."<<endl;goto CHECKPOINT;}}
  565. chow1:
  566. cout<<"Would you like to use a Mana Potion?"<<endl;
  567. cout<<"1. Yes"<<endl;
  568. cout<<"2. No"<<endl;
  569. cin>>command;
  570. if (command == "1"){Mana = Mana + 25;ManaPotion = ManaPotion - 1;goto EmAttack;}
  571. else if (command != "1"){goto CHECKPOINT;}
  572. }
  573. }
  574. {
  575. magic:
  576. cout<<"Here is the list of magic that is available to you:"<<endl;
  577. if (magicor == 0){cout<<"You have no magic. Returing to battle menu."<<endl;system("PAUSE");system("CLS");goto CHECKPOINT;}
  578. }
  579.  
  580. {
  581. EmAttack:
  582. {
  583. SetConsoleTextAttribute(hConsole, 12);
  584. }
  585. cout<<"The ";cout<<mon1;cout<<" is attacking you"<<endl;
  586. system("PAUSE");
  587. Rand_Num = (rand() % 50) + 0;
  588. if (Rand_Num < ac){cout<<"The ";cout<<mon1;cout<<" missed you."<<endl;system("PAUSE");system("CLS"); goto CHECKPOINT;}
  589. else if (Rand_Num >= ac){goto monhit;}
  590. monhit:
  591. Rand_Num = (rand() % 50) + 1;
  592. if (Rand_Num <= mondmg){EnDamage = Rand_Num;math5=Health - Rand_Num;cout<<"The ";cout<<mon1;cout<<" Hit you for ";cout<<Rand_Num;cout<<" damage!"<<endl;
  593. cout<<"You have ";cout<<math5;cout<<" Health Left!"<<endl;
  594. cout<<"It is now your time to attack."<<endl;system("PAUSE");system("CLS");
  595. if (attackcommand == "2"){
  596. ac = ac -5;}
  597. goto HPSTASIS;}
  598. else if (Rand_Num > mondmg){goto monhit;}
  599. }
  600.  
  601. start:
  602. {
  603. SetConsoleTextAttribute(hConsole, 12);
  604. }
  605. cout<<"Wait! Here comes a goblin! Ready your fists. Battle is calling!"<<endl;
  606. system("PAUSE");
  607. {
  608. ifstream myfile ("gobling.txt");
  609. if (myfile.is_open())
  610. {
  611. while (! myfile.eof() )
  612. {
  613. getline (myfile,line);
  614. cout << line << endl;
  615. }
  616. system("PAUSE");
  617. system("CLS");
  618. myfile.close();
  619. }
  620. }
  621.  
  622. cout<<"You see a little goblin in front of you. It looks mad. But why? It has a knife! It starts to charge!"<<endl;
  623. mondmg = mondmg + 5;
  624. monhp = monhp + 8;
  625. monac1 = monac + 10;
  626. mon1 = "goblin";
  627. goto COMBATSTASIS;
  628. Endfight:
  629. {
  630. SetConsoleTextAttribute(hConsole, 14);
  631. }
  632. cout<<"You have defeated the evil goblin, congradulations."<<endl;
  633. cout<<"You have gained 5 experience points."<<endl;
  634. cout<<"You have found a Health Potion on the goblin"<<endl;
  635. cout<<"You have taken the dagger you found on the goblin, and equip it"<<endl;
  636. {
  637. ifstream myfile ("daggerfind.txt");
  638. if (myfile.is_open())
  639. {
  640. while (! myfile.eof() )
  641. {
  642. getline (myfile,line);
  643. cout << line << endl;
  644. }
  645. system("PAUSE");
  646. system("CLS");
  647. myfile.close();
  648. }
  649. }
  650. HealthPotion = HealthPotion + 1;
  651. exp = exp + 5;
  652. int goblindag;
  653. goblindag = 1;
  654. dmgbonusgg = dmgbonusgg + 2;
  655. wepequip = 1;
  656. system("PAUSE");
  657. system("CLS");
  658. detstart = 0;
  659. cout<<"Memnon: I don't have a clue where you are. Judging by the trees, You must be in a forest. But where?"<<endl;
  660. cout<<"Memnon: I don't remember any forests in Kamada. Maybe you should look around"<<endl;
  661. cout<<name;cout<<": I'll scout around for a bit."<<endl;
  662. system("PAUSE");
  663. system("CLS");
  664. goto maptest;
  665.  
  666. {
  667.  
  668. Blacksmith:
  669. cout<<"You are at the blacksmith's shop."<<endl;
  670. cout<<"Blacksmith: Hey what can I get for you today?"<<endl;
  671. cout<<"Here is the list of available things that you can buy:"<<endl;
  672. cout<<"1. Dagger (+1Atkbonus,+2Dmgbonus) 15gp"<<endl;
  673. cout<<"2. Sword (+2Atkbonus,+4Dmgbonus) 30gp"<<endl;
  674. cout<<"3. Long Sword(+6Dmgbonus) 50gp"<<endl;
  675. cout<<"4. Mace (+2Atkbonus,+3Dmgbonus,+5Impact) 60gp"<<endl;
  676. cout<<"5. ******* Sword (+3Atkbonus,+8Dmgbonus) 115gp"<<endl;
  677. cin>>buything;
  678. if (buything == "1")
  679. {xgp = 15; h = 2; a = 1; b = 0, c = 2;
  680. if (goldpeic >= xgp)
  681. {;itemquip == "Dagger"; goto equipthing;}
  682. else if (goldpeic < xgp)
  683. {cout<<"You can't afford that."<<endl;goto tpawsmp;}
  684. }
  685. if (buything == "2")
  686. {xgp = 30; h = 3; a = 2; b = 0, c = 4;
  687. if (goldpeic >= xgp)
  688. {;itemquip == "Sword"; goto equipthing;}
  689. else if (goldpeic < xgp)
  690. {cout<<"You can't afford that."<<endl;goto tpawsmp;}
  691. }
  692. if (buything == "3")
  693. {xgp = 50; h = 5; a = 0; b = 0, c = 6;
  694. if (goldpeic >= xgp)
  695. {;itemquip == "Long_Sword"; goto equipthing;}
  696. else if (goldpeic < xgp)
  697. {cout<<"You can't afford that."<<endl;goto tpawsmp;}
  698. }
  699. if (buything == "4")
  700. {xgp = 60; h = 6; a = 2; b = 5, c = 3;
  701. if (goldpeic >= xgp)
  702. {;itemquip == "Mace"; goto equipthing;}
  703. else if (goldpeic < xgp)
  704. {cout<<"You can't afford that."<<endl;goto tpawsmp;}
  705. }
  706. if (buything == "5")
  707. {xgp = 115; h = 7; a = 3; b = 0, c = 8;
  708. if (goldpeic >= xgp)
  709. {;itemquip == "*******_Sword"; goto equipthing;}
  710. else if (goldpeic < xgp)
  711. {cout<<"You can't afford that."<<endl;goto tpawsmp;}
  712. }
  713. else if (buything != "1" or "2" or "3" or "4" or "5"){
  714. cout<<"There is nothing that you can buy that is that."<<endl;
  715. system("PAUSE");
  716. system("CLS");
  717. goto Blacksmith;
  718. }
  719.  
  720. {
  721. equipthing:
  722. cout<<"Would you like to equip ";cout<<itemquip;cout<<"?"<<endl;
  723. cout<<"1. Yes"<<endl;
  724. cout<<"2. No"<<endl;
  725. cin>>equip;
  726. if (equip == 1){
  727. if (wepequip == h)
  728. {
  729. cout<<"You already have a ";cout<<itemquip;cout<<" Equiped"<<endl;
  730. system("PAUSE");
  731. system("CLS");
  732. goto tpawsmp;
  733. }
  734. else if (wepequip == 2)
  735. {
  736. dmgbonusgg = dmgbonusgg - 2;
  737. goto bgs;
  738. }
  739. else if (wepequip == 4)
  740. {
  741. dmgbonusgg = dmgbonusgg - 5;
  742. atkbonus = atkbonus - 2;
  743. goto bgs;
  744. }
  745. else if (wepequip == 1)
  746. {
  747. dmgbonusgg = dmgbonusgg - 2;
  748. atkbonus = atkbonus - 1;
  749. goto bgs;
  750. }
  751. else if (wepequip == 3)
  752. {
  753. dmgbonusgg = dmgbonusgg - 4;
  754. atkbonus = atkbonus - 2;
  755. goto bgs;
  756. }
  757. else if (wepequip == 5)
  758. {
  759. dmgbonusgg = dmgbonusgg - 6;
  760. goto bgs;
  761. }
  762. else if (wepequip == 6)
  763. {
  764. dmgbonusgg = dmgbonusgg - 3;
  765. bluntforceimpact = bluntforceimpact - 5;
  766. atkbonus = atkbonus - 2;
  767. goto bgs;
  768. }
  769. else if (wepequip == 7)
  770. {
  771. dmgbonusgg = dmgbonusgg - 8;
  772. atkbonus = atkbonus - 3;
  773. goto bgs;
  774. }
  775. {
  776. bgs:
  777. wepequip = h;
  778. dmgbonusgg = dmgbonusgg +c;
  779. atkbonus = atkbonus + a;
  780. bluntforceimpact = bluntforceimpact + b;
  781. h = item;
  782. }
  783. }
  784. else if (equip >= 2){
  785. goto tpawsmp;
  786. }
  787. }
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795. {
  796. cong:
  797.  
  798. if (monhp = 32){
  799. Rand_Num = (rand() % 50) + 0;
  800. if (Rand_Num <= 100){goto branditems;}
  801. else if (Rand_Num > 100){goto cong;}
  802. branditems:
  803. {
  804. SetConsoleTextAttribute(hConsole, 13);
  805. }
  806. if (Rand_Num == 23 or 45 or 87){goldpeic = goldpeic + 15;bndtswrd = bndtswrd + 1;exp = exp + 25; HealthPotion = HealthPotion + 1;
  807. cout<<"Congradulations! You have defeated the bandit. You have earned 25 exp. You have looted one bandit sword, 15 gold peices, and one Health Potion"<<endl;
  808.  
  809. {
  810. ifstream myfile ("bswordfind.txt");
  811. if (myfile.is_open())
  812. {
  813. while (! myfile.eof() )
  814. {
  815. getline (myfile,line);
  816. cout << line << endl;
  817. }
  818. system("PAUSE");
  819. system("CLS");
  820. myfile.close();
  821. }
  822. }
  823. int equip;
  824. cout<<"Would you like to equip bandit sword?"<<endl;
  825. cout<<"Stats are: +2Atkbonus,+5dmgbonus"<<endl;
  826. cout<<"1. Yes"<<endl;
  827. cout<<"2. No"<<endl;
  828. cin>>equip;
  829. if (equip == 1){
  830. if (wepequip == 4)
  831. {
  832. cout<<"You already have a Bandit Sword Equiped"<<endl;
  833. system("PAUSE");
  834. system("CLS");
  835. goto Levelup;
  836. }
  837. else if (wepequip == 2)
  838. {
  839. dmgbonusgg = dmgbonusgg - 2;
  840. goto bndtsorequip;
  841. }
  842. else if (wepequip == 1)
  843. {
  844. dmgbonusgg = dmgbonusgg - 2;
  845. atkbonus = atkbonus - 1;
  846. goto bndtsorequip;
  847. }
  848. else if (wepequip == 3)
  849. {
  850. dmgbonusgg = dmgbonusgg - 4;
  851. atkbonus = atkbonus - 2;
  852. goto bndtsorequip;
  853. }
  854. else if (wepequip == 5)
  855. {
  856. dmgbonusgg = dmgbonusgg - 6;
  857. goto bndtsorequip;
  858. }
  859. else if (wepequip == 6)
  860. {
  861. dmgbonusgg = dmgbonusgg - 3;
  862. bluntforceimpact = bluntforceimpact - 5;
  863. atkbonus = atkbonus - 2;
  864. goto bndtsorequip;
  865. }
  866. else if (wepequip == 7)
  867. {
  868. dmgbonusgg = dmgbonusgg - 8;
  869. atkbonus = atkbonus - 3;
  870. goto bndtsorequip;
  871. }
  872. {
  873. bndtsorequip:
  874. wepequip = 4;
  875. dmgbonusgg = dmgbonusgg +5;
  876. atkbonus = atkbonus + 2;
  877. }
  878. }
  879. else if (equip >= 2)
  880. {
  881. goto Levelup;
  882. }
  883.  
  884. goto Levelup;}
  885. else if (Rand_Num == 64 or 20 or 52 or 79 or 92 or 01 or 06 or 31){goldpeic = goldpeic + 50;bndtcape = bndtcape + 1;exp = exp + 25;
  886. cout<<"Congradulations! You have defeated the bandit. You have earned 25 exp. You have looted one bandit cape, and 50 gold peices!"<<endl;
  887. goto Levelup;}
  888. else if (Rand_Num != 23 or 45 or 87 or 64 or 20 or 52 or 79 or 92 or 01 or 06 or 31){exp = exp + 25;
  889. cout<<"Congradulations! You have defeated the bandit. You have earned 25exp. There was no loot."<<endl;
  890. goto Levelup;}
  891. }
  892.  
  893.  
  894. Bandit:
  895. {
  896. SetConsoleTextAttribute(hConsole, 12);
  897. }
  898.  
  899. mondmg = 11;
  900. monhp = 32;
  901. monac1 = 15;
  902. mon1 = "bandit";
  903. goto COMBATSTASIS;
  904. }
  905. {
  906. Ogre:
  907. mondmg = 36;
  908. monhp = 166;
  909. monac1 = 24;
  910. mon1 = "ogre";
  911. goto COMBATSTASIS;
  912. }
  913. {
  914. FCentaur:
  915. mondmg = 7;
  916. monhp = 18;
  917. monac1 = 13;
  918. mon1 = "forest centaur";
  919. goto COMBATSTASIS;
  920. }
  921. {
  922. Nymph:
  923. mondmg = 2;
  924. monhp = 4;
  925. monac1 = 7;
  926. mon1 = "forest nymph";
  927. goto COMBATSTASIS;
  928. }
  929. //Level up sequence;//
  930. {
  931. Levelup:
  932. int levelcom;
  933. if (level == 0)
  934. {
  935. if (exp >= exp1)
  936. {
  937. level = level + 1;
  938. exp1 = exp1 * 1.5;-
  939. statchoose:
  940. cout<<"You have just Leveled up! You are now level ";cout<<level;cout<<"!"<<endl;
  941. cout<<"You can choose between these options to improve,"<<endl;
  942. cout<<"1. Improve Strength by one"<<endl;
  943. cout<<"2. Improve Dexterity by one"<<endl;
  944. cout<<"3. Improve Constitution by one"<<endl;
  945. cout<<"4. Improve Intellegence by one"<<endl;
  946. cout<<"5. Improve Wisdom by one"<<endl;
  947. cout<<"6. Improve Charisma by one"<<endl;
  948. cin>>levelcom;
  949. if (levelcom == 1)
  950. {str == str + 1;
  951. cout<<"You have increased strength."<<endl;
  952. system("PAUSE");
  953. system("CLS");
  954. goto endingfight;
  955. }
  956. else if (levelcom == 2)
  957. {dex == dex + 1;
  958. cout<<"You have increased dexterity."<<endl;
  959. system("PAUSE");
  960. system("CLS");
  961. goto endingfight;
  962. }
  963. else if (levelcom == 3)
  964. {con == con + 1;
  965. cout<<"You have increased constitution."<<endl;
  966. system("PAUSE");
  967. system("CLS");
  968. goto endingfight;
  969. }
  970. else if (levelcom == 4)
  971. {intel == intel + 1;
  972. cout<<"You have increased intellegence."<<endl;
  973. system("PAUSE");
  974. system("CLS");
  975. goto endingfight;
  976. }
  977. else if (levelcom == 5)
  978. {wis == wis + 1;
  979. cout<<"You have increased wisdom."<<endl;
  980. system("PAUSE");
  981. system("CLS");
  982. goto endingfight;
  983. }
  984. else if (levelcom == 6)
  985. {charis == charis + 1;
  986. cout<<"You have increased charisma."<<endl;
  987. system("PAUSE");
  988. system("CLS");
  989. goto endingfight;
  990. }
  991. else if (levelcom > 6)
  992. {
  993. goto statchoose;
  994. }
  995. }
  996. else if (exp < exp1)
  997. {
  998. goto endingfight;
  999. }
  1000.  
  1001.  
  1002.  
  1003. goto endingfight;
  1004. }
  1005. }
  1006. //
  1007. int commands;
  1008. goto maptest;
  1009. {
  1010. maptest:
  1011. if (quest1active <= 1){
  1012. daysleft1 = daysleft1 - 1;
  1013. cout<<"You have ";cout<<daysleft1;cout<<" days left to finish the quest."<<endl;
  1014. if (daysleft1 >= 0){
  1015. quest1active = 3;}
  1016. }
  1017.  
  1018.  
  1019. if (MAP[y][x]=="|F|"){
  1020. ifstream myfile ("trees.txt");
  1021. if (myfile.is_open())
  1022. {
  1023. while (! myfile.eof() )
  1024. {
  1025. getline (myfile,line);
  1026. cout << line << endl;
  1027. }
  1028. cout<<"You are walking through the forest."<<endl;
  1029. myfile.close();
  1030. }
  1031. }
  1032. else if (y != 16 or x != 20){goto endingfight;}
  1033. else if (y == 18, x == 22)
  1034. {
  1035. ifstream myfile ("example.txt");
  1036. if (myfile.is_open())
  1037. {
  1038. while (! myfile.eof() )
  1039. {
  1040. getline (myfile,line);
  1041. cout << line << endl;
  1042. }
  1043. system("PAUSE");
  1044. system("CLS");
  1045. myfile.close();
  1046. }
  1047. }
  1048. //
  1049. if (MAP[y-1][x-1]=="|F|"){
  1050. SetConsoleTextAttribute(hConsole, 2);
  1051. }
  1052. else if (MAP[y-1][x-1]=="|W|"){
  1053. SetConsoleTextAttribute(hConsole, 9);
  1054. }
  1055. else if (MAP[y-1][x-1]=="|P|"){
  1056. SetConsoleTextAttribute(hConsole, 12);
  1057. }
  1058. else if (MAP[y-1][x-1]=="|G|"){
  1059. SetConsoleTextAttribute(hConsole, 10);
  1060. }
  1061. else if (MAP[y-1][x-1]=="|M|"){
  1062. SetConsoleTextAttribute(hConsole, 8);
  1063. }
  1064. else if (MAP[y-1][x-1]=="|I|"){
  1065. SetConsoleTextAttribute(hConsole, 7);
  1066. }
  1067. else if (MAP[y-1][x-1]=="|R|"){
  1068. SetConsoleTextAttribute(hConsole, 13);
  1069. }
  1070. else if (MAP[y-1][x-1]=="|B|"){
  1071. SetConsoleTextAttribute(hConsole, 14);
  1072. }
  1073. else if (MAP[y-1][x-1]=="|T|"){
  1074. SetConsoleTextAttribute(hConsole, 21);
  1075. }
  1076. //[y-2][x-2] [y-2][x-1] [y-2][x] [y-2][x+1] [y-2][x+2]
  1077. //[y-1][x-2] [y-1][x-1] [y-1][x] [y-1][x+1] [y-1][x+2]
  1078. //[y][x-2] [y][x-1] [y][x] [y][x+1] [y][x+2]
  1079. //[y+1][x-2] [y+1][x-1] [y+1][x] [y+1][x+1] [y+1][x+2]
  1080. //[y+2][x-2] [y+2][x-1] [y+2][x] [y+2][x+1] [y+2][x+2]
  1081. //
  1082. //
  1083. //
  1084. endingfight:
  1085. {
  1086. SetConsoleTextAttribute(hConsole, 10);
  1087. }
  1088. cout<<"You are at the coordinates ";cout<<x;cout<<"x ";cout<<y;cout<<"y."<<endl;
  1089. //Changing clolors for Posions on MAP//
  1090. if (MAP[y-2][x-2]=="|F|"){
  1091. SetConsoleTextAttribute(hConsole, 2);
  1092. }
  1093. else if (MAP[y-2][x-2]=="|W|"){
  1094. SetConsoleTextAttribute(hConsole, 9);
  1095. }
  1096. else if (MAP[y-2][x-2]=="|P|"){
  1097. SetConsoleTextAttribute(hConsole, 12);
  1098. }
  1099. else if (MAP[y-2][x-2]=="|G|"){
  1100. SetConsoleTextAttribute(hConsole, 10);
  1101. }
  1102. else if (MAP[y-2][x-2]=="|M|"){
  1103. SetConsoleTextAttribute(hConsole, 8);
  1104. }
  1105. else if (MAP[y-2][x-2]=="|I|"){
  1106. SetConsoleTextAttribute(hConsole, 7);
  1107. }
  1108. else if (MAP[y-2][x-2]=="|R|"){
  1109. SetConsoleTextAttribute(hConsole, 13);
  1110. }
  1111. else if (MAP[y-2][x-2]=="|B|"){
  1112. SetConsoleTextAttribute(hConsole, 14);
  1113. }
  1114. else if (MAP[y-2][x-2]=="|T|"){
  1115. SetConsoleTextAttribute(hConsole, 21);
  1116. }
  1117. cout<<MAP[y-2][x-2];
  1118. if (MAP[y-2][x-1]=="|F|"){
  1119. SetConsoleTextAttribute(hConsole, 2);
  1120. }
  1121. else if (MAP[y-2][x-1]=="|W|"){
  1122. SetConsoleTextAttribute(hConsole, 9);
  1123. }
  1124. else if (MAP[y-2][x-1]=="|P|"){
  1125. SetConsoleTextAttribute(hConsole, 12);
  1126. }
  1127. else if (MAP[y-2][x-1]=="|G|"){
  1128. SetConsoleTextAttribute(hConsole, 10);
  1129. }
  1130. else if (MAP[y-2][x-1]=="|M|"){
  1131. SetConsoleTextAttribute(hConsole, 8);
  1132. }
  1133. else if (MAP[y-2][x-1]=="|I|"){
  1134. SetConsoleTextAttribute(hConsole, 7);
  1135. }
  1136. else if (MAP[y-2][x-1]=="|R|"){
  1137. SetConsoleTextAttribute(hConsole, 13);
  1138. }
  1139. else if (MAP[y-2][x-1]=="|B|"){
  1140. SetConsoleTextAttribute(hConsole, 14);
  1141. }
  1142. else if (MAP[y-2][x-1]=="|T|"){
  1143. SetConsoleTextAttribute(hConsole, 21);
  1144. }
  1145. cout<<MAP[y-2][x-1];
  1146. if (MAP[y-2][x]=="|F|"){
  1147. SetConsoleTextAttribute(hConsole, 2);
  1148. }
  1149. else if (MAP[y-2][x]=="|W|"){
  1150. SetConsoleTextAttribute(hConsole, 9);
  1151. }
  1152. else if (MAP[y-2][x]=="|P|"){
  1153. SetConsoleTextAttribute(hConsole, 12);
  1154. }
  1155. else if (MAP[y-2][x]=="|G|"){
  1156. SetConsoleTextAttribute(hConsole, 10);
  1157. }
  1158. else if (MAP[y-2][x]=="|M|"){
  1159. SetConsoleTextAttribute(hConsole, 8);
  1160. }
  1161. else if (MAP[y-2][x]=="|I|"){
  1162. SetConsoleTextAttribute(hConsole, 7);
  1163. }
  1164. else if (MAP[y-2][x]=="|R|"){
  1165. SetConsoleTextAttribute(hConsole, 13);
  1166. }
  1167. else if (MAP[y-2][x]=="|B|"){
  1168. SetConsoleTextAttribute(hConsole, 14);
  1169. }
  1170. else if (MAP[y-2][x]=="|T|"){
  1171. SetConsoleTextAttribute(hConsole, 21);
  1172. }
  1173. cout<<MAP[y-2][x];
  1174. if (MAP[y-2][x+1]=="|F|"){
  1175. SetConsoleTextAttribute(hConsole, 2);
  1176. }
  1177. else if (MAP[y-2][x+1]=="|W|"){
  1178. SetConsoleTextAttribute(hConsole, 9);
  1179. }
  1180. else if (MAP[y-2][x+1]=="|P|"){
  1181. SetConsoleTextAttribute(hConsole, 12);
  1182. }
  1183. else if (MAP[y-2][x+1]=="|G|"){
  1184. SetConsoleTextAttribute(hConsole, 10);
  1185. }
  1186. else if (MAP[y-2][x+1]=="|M|"){
  1187. SetConsoleTextAttribute(hConsole, 8);
  1188. }
  1189. else if (MAP[y-2][x+1]=="|I|"){
  1190. SetConsoleTextAttribute(hConsole, 7);
  1191. }
  1192. else if (MAP[y-2][x+1]=="|R|"){
  1193. SetConsoleTextAttribute(hConsole, 13);
  1194. }
  1195. else if (MAP[y-2][x+1]=="|B|"){
  1196. SetConsoleTextAttribute(hConsole, 14);
  1197. }
  1198. else if (MAP[y-2][x+1]=="|T|"){
  1199. SetConsoleTextAttribute(hConsole, 21);
  1200. }
  1201. cout<<MAP[y-2][x+1];
  1202. if (MAP[y-2][x+2]=="|F|"){
  1203. SetConsoleTextAttribute(hConsole, 2);
  1204. }
  1205. else if (MAP[y-2][x+2]=="|W|"){
  1206. SetConsoleTextAttribute(hConsole, 9);
  1207. }
  1208. else if (MAP[y-2][x+2]=="|P|"){
  1209. SetConsoleTextAttribute(hConsole, 12);
  1210. }
  1211. else if (MAP[y-2][x+2]=="|G|"){
  1212. SetConsoleTextAttribute(hConsole, 10);
  1213. }
  1214. else if (MAP[y-2][x+2]=="|M|"){
  1215. SetConsoleTextAttribute(hConsole, 8);
  1216. }
  1217. else if (MAP[y-2][x+2]=="|I|"){
  1218. SetConsoleTextAttribute(hConsole, 7);
  1219. }
  1220. else if (MAP[y-2][x+2]=="|R|"){
  1221. SetConsoleTextAttribute(hConsole, 13);
  1222. }
  1223. else if (MAP[y-2][x+2]=="|B|"){
  1224. SetConsoleTextAttribute(hConsole, 14);
  1225. }
  1226. else if (MAP[y-2][x+2]=="|T|"){
  1227. SetConsoleTextAttribute(hConsole, 21);
  1228. }
  1229. cout<<MAP[y-2][x+2]<<endl;
  1230. if (MAP[y-1][x-2]=="|F|"){
  1231. SetConsoleTextAttribute(hConsole, 2);
  1232. }
  1233. else if (MAP[y-1][x-2]=="|W|"){
  1234. SetConsoleTextAttribute(hConsole, 9);
  1235. }
  1236. else if (MAP[y-1][x-2]=="|P|"){
  1237. SetConsoleTextAttribute(hConsole, 12);
  1238. }
  1239. else if (MAP[y-1][x-2]=="|G|"){
  1240. SetConsoleTextAttribute(hConsole, 10);
  1241. }
  1242. else if (MAP[y-1][x-2]=="|M|"){
  1243. SetConsoleTextAttribute(hConsole, 8);
  1244. }
  1245. else if (MAP[y-1][x-2]=="|I|"){
  1246. SetConsoleTextAttribute(hConsole, 7);
  1247. }
  1248. else if (MAP[y-1][x-2]=="|R|"){
  1249. SetConsoleTextAttribute(hConsole, 13);
  1250. }
  1251. else if (MAP[y-1][x-2]=="|B|"){
  1252. SetConsoleTextAttribute(hConsole, 14);
  1253. }
  1254. else if (MAP[y-1][x-2]=="|T|"){
  1255. SetConsoleTextAttribute(hConsole, 21);
  1256. }
  1257. cout<<MAP[y-1][x-2];
  1258. if (MAP[y-1][x-1]=="|F|"){
  1259. SetConsoleTextAttribute(hConsole, 2);
  1260. }
  1261. else if (MAP[y-1][x-1]=="|W|"){
  1262. SetConsoleTextAttribute(hConsole, 9);
  1263. }
  1264. else if (MAP[y-1][x-1]=="|P|"){
  1265. SetConsoleTextAttribute(hConsole, 12);
  1266. }
  1267. else if (MAP[y-1][x-1]=="|G|"){
  1268. SetConsoleTextAttribute(hConsole, 10);
  1269. }
  1270. else if (MAP[y-1][x-1]=="|M|"){
  1271. SetConsoleTextAttribute(hConsole, 8);
  1272. }
  1273. else if (MAP[y-1][x-1]=="|I|"){
  1274. SetConsoleTextAttribute(hConsole, 7);
  1275. }
  1276. else if (MAP[y-1][x-1]=="|R|"){
  1277. SetConsoleTextAttribute(hConsole, 13);
  1278. }
  1279. else if (MAP[y-1][x-1]=="|B|"){
  1280. SetConsoleTextAttribute(hConsole, 14);
  1281. }
  1282. else if (MAP[y-1][x-1]=="|T|"){
  1283. SetConsoleTextAttribute(hConsole, 21);
  1284. }
  1285. cout<<MAP[y-1][x-1];
  1286. if (MAP[y-1][x]=="|F|"){
  1287. SetConsoleTextAttribute(hConsole, 2);
  1288. }
  1289. else if (MAP[y-1][x]=="|W|"){
  1290. SetConsoleTextAttribute(hConsole, 9);
  1291. }
  1292. else if (MAP[y-1][x]=="|P|"){
  1293. SetConsoleTextAttribute(hConsole, 12);
  1294. }
  1295. else if (MAP[y-1][x]=="|G|"){
  1296. SetConsoleTextAttribute(hConsole, 10);
  1297. }
  1298. else if (MAP[y-1][x]=="|M|"){
  1299. SetConsoleTextAttribute(hConsole, 8);
  1300. }
  1301. else if (MAP[y-1][x]=="|I|"){
  1302. SetConsoleTextAttribute(hConsole, 7);
  1303. }
  1304. else if (MAP[y-1][x]=="|R|"){
  1305. SetConsoleTextAttribute(hConsole, 13);
  1306. }
  1307. else if (MAP[y-1][x]=="|B|"){
  1308. SetConsoleTextAttribute(hConsole, 14);
  1309. }
  1310. else if (MAP[y-1][x]=="|T|"){
  1311. SetConsoleTextAttribute(hConsole, 21);
  1312. }
  1313. cout<<MAP[y-1][x];
  1314. if (MAP[y-1][x+1]=="|F|"){
  1315. SetConsoleTextAttribute(hConsole, 2);
  1316. }
  1317. else if (MAP[y-1][x+1]=="|W|"){
  1318. SetConsoleTextAttribute(hConsole, 9);
  1319. }
  1320. else if (MAP[y-1][x+1]=="|P|"){
  1321. SetConsoleTextAttribute(hConsole, 12);
  1322. }
  1323. else if (MAP[y-1][x+1]=="|G|"){
  1324. SetConsoleTextAttribute(hConsole, 10);
  1325. }
  1326. else if (MAP[y-1][x+1]=="|M|"){
  1327. SetConsoleTextAttribute(hConsole, 8);
  1328. }
  1329. else if (MAP[y-1][x+1]=="|I|"){
  1330. SetConsoleTextAttribute(hConsole, 7);
  1331. }
  1332. else if (MAP[y-1][x+1]=="|R|"){
  1333. SetConsoleTextAttribute(hConsole, 13);
  1334. }
  1335. else if (MAP[y-1][x+1]=="|B|"){
  1336. SetConsoleTextAttribute(hConsole, 14);
  1337. }
  1338. else if (MAP[y-1][x+1]=="|T|"){
  1339. SetConsoleTextAttribute(hConsole, 21);
  1340. }
  1341. cout<<MAP[y-1][x+1];
  1342. if (MAP[y-1][x+2]=="|F|"){
  1343. SetConsoleTextAttribute(hConsole, 2);
  1344. }
  1345. else if (MAP[y-1][x+2]=="|W|"){
  1346. SetConsoleTextAttribute(hConsole, 9);
  1347. }
  1348. else if (MAP[y-1][x+2]=="|P|"){
  1349. SetConsoleTextAttribute(hConsole, 12);
  1350. }
  1351. else if (MAP[y-1][x+2]=="|G|"){
  1352. SetConsoleTextAttribute(hConsole, 10);
  1353. }
  1354. else if (MAP[y-1][x+2]=="|M|"){
  1355. SetConsoleTextAttribute(hConsole, 8);
  1356. }
  1357. else if (MAP[y-1][x+2]=="|I|"){
  1358. SetConsoleTextAttribute(hConsole, 7);
  1359. }
  1360. else if (MAP[y-1][x+2]=="|R|"){
  1361. SetConsoleTextAttribute(hConsole, 13);
  1362. }
  1363. else if (MAP[y-1][x+2]=="|B|"){
  1364. SetConsoleTextAttribute(hConsole, 14);
  1365. }
  1366. else if (MAP[y-1][x+2]=="|T|"){
  1367. SetConsoleTextAttribute(hConsole, 21);
  1368. }
  1369. cout<<MAP[y-1][x+2]<<endl;
  1370. if (MAP[y][x-2]=="|F|"){
  1371. SetConsoleTextAttribute(hConsole, 2);
  1372. }
  1373. else if (MAP[y][x-2]=="|W|"){
  1374. SetConsoleTextAttribute(hConsole, 9);
  1375. }
  1376. else if (MAP[y][x-2]=="|P|"){
  1377. SetConsoleTextAttribute(hConsole, 12);
  1378. }
  1379. else if (MAP[y][x-2]=="|G|"){
  1380. SetConsoleTextAttribute(hConsole, 10);
  1381. }
  1382. else if (MAP[y][x-2]=="|M|"){
  1383. SetConsoleTextAttribute(hConsole, 8);
  1384. }
  1385. else if (MAP[y][x-2]=="|I|"){
  1386. SetConsoleTextAttribute(hConsole, 7);
  1387. }
  1388. else if (MAP[y][x-2]=="|R|"){
  1389. SetConsoleTextAttribute(hConsole, 13);
  1390. }
  1391. else if (MAP[y][x-2]=="|B|"){
  1392. SetConsoleTextAttribute(hConsole, 14);
  1393. }
  1394. else if (MAP[y][x-2]=="|T|"){
  1395. SetConsoleTextAttribute(hConsole, 21);
  1396. }
  1397. cout<<MAP[y][x-2];
  1398. if (MAP[y][x-1]=="|F|"){
  1399. SetConsoleTextAttribute(hConsole, 2);
  1400. }
  1401. else if (MAP[y][x-1]=="|W|"){
  1402. SetConsoleTextAttribute(hConsole, 9);
  1403. }
  1404. else if (MAP[y][x-1]=="|P|"){
  1405. SetConsoleTextAttribute(hConsole, 12);
  1406. }
  1407. else if (MAP[y][x-1]=="|G|"){
  1408. SetConsoleTextAttribute(hConsole, 10);
  1409. }
  1410. else if (MAP[y][x-1]=="|M|"){
  1411. SetConsoleTextAttribute(hConsole, 8);
  1412. }
  1413. else if (MAP[y][x-1]=="|I|"){
  1414. SetConsoleTextAttribute(hConsole, 7);
  1415. }
  1416. else if (MAP[y][x-1]=="|R|"){
  1417. SetConsoleTextAttribute(hConsole, 13);
  1418. }
  1419. else if (MAP[y][x-1]=="|B|"){
  1420. SetConsoleTextAttribute(hConsole, 14);
  1421. }
  1422. else if (MAP[y][x-1]=="|T|"){
  1423. SetConsoleTextAttribute(hConsole, 21);
  1424. }
  1425. cout<<MAP[y][x-1];
  1426. {
  1427. SetConsoleTextAttribute(hConsole, 7);
  1428. }
  1429. cout<<"|*|";
  1430. if (MAP[y][x+1]=="|F|"){
  1431. SetConsoleTextAttribute(hConsole, 2);
  1432. }
  1433. else if (MAP[y][x+1]=="|W|"){
  1434. SetConsoleTextAttribute(hConsole, 9);
  1435. }
  1436. else if (MAP[y][x+1]=="|P|"){
  1437. SetConsoleTextAttribute(hConsole, 12);
  1438. }
  1439. else if (MAP[y][x+1]=="|G|"){
  1440. SetConsoleTextAttribute(hConsole, 10);
  1441. }
  1442. else if (MAP[y][x+1]=="|M|"){
  1443. SetConsoleTextAttribute(hConsole, 8);
  1444. }
  1445. else if (MAP[y][x+1]=="|I|"){
  1446. SetConsoleTextAttribute(hConsole, 7);
  1447. }
  1448. else if (MAP[y][x+1]=="|R|"){
  1449. SetConsoleTextAttribute(hConsole, 13);
  1450. }
  1451. else if (MAP[y][x+1]=="|B|"){
  1452. SetConsoleTextAttribute(hConsole, 14);
  1453. }
  1454. else if (MAP[y][x+1]=="|T|"){
  1455. SetConsoleTextAttribute(hConsole, 21);
  1456. }
  1457. cout<<MAP[y][x+1];
  1458. if (MAP[y][x+2]=="|F|"){
  1459. SetConsoleTextAttribute(hConsole, 2);
  1460. }
  1461. else if (MAP[y][x+2]=="|W|"){
  1462. SetConsoleTextAttribute(hConsole, 9);
  1463. }
  1464. else if (MAP[y][x+2]=="|P|"){
  1465. SetConsoleTextAttribute(hConsole, 12);
  1466. }
  1467. else if (MAP[y][x+2]=="|G|"){
  1468. SetConsoleTextAttribute(hConsole, 10);
  1469. }
  1470. else if (MAP[y][x+2]=="|M|"){
  1471. SetConsoleTextAttribute(hConsole, 8);
  1472. }
  1473. else if (MAP[y][x+2]=="|I|"){
  1474. SetConsoleTextAttribute(hConsole, 7);
  1475. }
  1476. else if (MAP[y][x+2]=="|R|"){
  1477. SetConsoleTextAttribute(hConsole, 13);
  1478. }
  1479. else if (MAP[y][x+2]=="|B|"){
  1480. SetConsoleTextAttribute(hConsole, 14);
  1481. }
  1482. else if (MAP[y][x+2]=="|T|"){
  1483. SetConsoleTextAttribute(hConsole, 21);
  1484. }
  1485. cout<<MAP[y][x+2]<<endl;
  1486. if (MAP[y+1][x-2]=="|F|"){
  1487. SetConsoleTextAttribute(hConsole, 2);
  1488. }
  1489. else if (MAP[y+1][x-2]=="|W|"){
  1490. SetConsoleTextAttribute(hConsole, 9);
  1491. }
  1492. else if (MAP[y+1][x-2]=="|P|"){
  1493. SetConsoleTextAttribute(hConsole, 12);
  1494. }
  1495. else if (MAP[y+1][x-2]=="|G|"){
  1496. SetConsoleTextAttribute(hConsole, 10);
  1497. }
  1498. else if (MAP[y+1][x-2]=="|M|"){
  1499. SetConsoleTextAttribute(hConsole, 8);
  1500. }
  1501. else if (MAP[y+1][x-2]=="|I|"){
  1502. SetConsoleTextAttribute(hConsole, 7);
  1503. }
  1504. else if (MAP[y+1][x-2]=="|R|"){
  1505. SetConsoleTextAttribute(hConsole, 13);
  1506. }
  1507. else if (MAP[y+1][x-2]=="|B|"){
  1508. SetConsoleTextAttribute(hConsole, 14);
  1509. }
  1510. else if (MAP[y+1][x-2]=="|T|"){
  1511. SetConsoleTextAttribute(hConsole, 21);
  1512. }
  1513. cout<<MAP[y+1][x-2];
  1514. if (MAP[y+1][x-1]=="|F|"){
  1515. SetConsoleTextAttribute(hConsole, 2);
  1516. }
  1517. else if (MAP[y+1][x-1]=="|W|"){
  1518. SetConsoleTextAttribute(hConsole, 9);
  1519. }
  1520. else if (MAP[y+1][x-1]=="|P|"){
  1521. SetConsoleTextAttribute(hConsole, 12);
  1522. }
  1523. else if (MAP[y+1][x-1]=="|G|"){
  1524. SetConsoleTextAttribute(hConsole, 10);
  1525. }
  1526. else if (MAP[y+1][x-1]=="|M|"){
  1527. SetConsoleTextAttribute(hConsole, 8);
  1528. }
  1529. else if (MAP[y+1][x-1]=="|I|"){
  1530. SetConsoleTextAttribute(hConsole, 7);
  1531. }
  1532. else if (MAP[y+1][x-1]=="|R|"){
  1533. SetConsoleTextAttribute(hConsole, 13);
  1534. }
  1535. else if (MAP[y+1][x-1]=="|B|"){
  1536. SetConsoleTextAttribute(hConsole, 14);
  1537. }
  1538. else if (MAP[y+1][x-1]=="|T|"){
  1539. SetConsoleTextAttribute(hConsole, 21);
  1540. }
  1541. cout<<MAP[y+1][x-1];
  1542. if (MAP[y+1][x]=="|F|"){
  1543. SetConsoleTextAttribute(hConsole, 2);
  1544. }
  1545. else if (MAP[y+1][x]=="|W|"){
  1546. SetConsoleTextAttribute(hConsole, 9);
  1547. }
  1548. else if (MAP[y+1][x]=="|P|"){
  1549. SetConsoleTextAttribute(hConsole, 12);
  1550. }
  1551. else if (MAP[y+1][x]=="|G|"){
  1552. SetConsoleTextAttribute(hConsole, 10);
  1553. }
  1554. else if (MAP[y+1][x]=="|M|"){
  1555. SetConsoleTextAttribute(hConsole, 8);
  1556. }
  1557. else if (MAP[y+1][x]=="|I|"){
  1558. SetConsoleTextAttribute(hConsole, 7);
  1559. }
  1560. else if (MAP[y+1][x]=="|R|"){
  1561. SetConsoleTextAttribute(hConsole, 13);
  1562. }
  1563. else if (MAP[y+1][x]=="|B|"){
  1564. SetConsoleTextAttribute(hConsole, 14);
  1565. }
  1566. else if (MAP[y+1][x]=="|T|"){
  1567. SetConsoleTextAttribute(hConsole, 21);
  1568. }
  1569. cout<<MAP[y+1][x];
  1570. if (MAP[y+1][x+1]=="|F|"){
  1571. SetConsoleTextAttribute(hConsole, 2);
  1572. }
  1573. else if (MAP[y+1][x+1]=="|W|"){
  1574. SetConsoleTextAttribute(hConsole, 9);
  1575. }
  1576. else if (MAP[y+1][x+1]=="|P|"){
  1577. SetConsoleTextAttribute(hConsole, 12);
  1578. }
  1579. else if (MAP[y+1][x+1]=="|G|"){
  1580. SetConsoleTextAttribute(hConsole, 10);
  1581. }
  1582. else if (MAP[y+1][x+1]=="|M|"){
  1583. SetConsoleTextAttribute(hConsole, 8);
  1584. }
  1585. else if (MAP[y+1][x+1]=="|I|"){
  1586. SetConsoleTextAttribute(hConsole, 7);
  1587. }
  1588. else if (MAP[y+1][x+1]=="|R|"){
  1589. SetConsoleTextAttribute(hConsole, 13);
  1590. }
  1591. else if (MAP[y+1][x+1]=="|B|"){
  1592. SetConsoleTextAttribute(hConsole, 14);
  1593. }
  1594. else if (MAP[y+1][x+1]=="|T|"){
  1595. SetConsoleTextAttribute(hConsole, 21);
  1596. }
  1597. cout<<MAP[y+1][x+1];
  1598. if (MAP[y+1][x+2]=="|F|"){
  1599. SetConsoleTextAttribute(hConsole, 2);
  1600. }
  1601. else if (MAP[y+1][x+2]=="|W|"){
  1602. SetConsoleTextAttribute(hConsole, 9);
  1603. }
  1604. else if (MAP[y+1][x+2]=="|P|"){
  1605. SetConsoleTextAttribute(hConsole, 12);
  1606. }
  1607. else if (MAP[y+1][x+2]=="|G|"){
  1608. SetConsoleTextAttribute(hConsole, 10);
  1609. }
  1610. else if (MAP[y+1][x+2]=="|M|"){
  1611. SetConsoleTextAttribute(hConsole, 8);
  1612. }
  1613. else if (MAP[y+1][x+2]=="|I|"){
  1614. SetConsoleTextAttribute(hConsole, 7);
  1615. }
  1616. else if (MAP[y+1][x+2]=="|R|"){
  1617. SetConsoleTextAttribute(hConsole, 13);
  1618. }
  1619. else if (MAP[y+1][x+2]=="|B|"){
  1620. SetConsoleTextAttribute(hConsole, 14);
  1621. }
  1622. else if (MAP[y+1][x+2]=="|T|"){
  1623. SetConsoleTextAttribute(hConsole, 21);
  1624. }
  1625. cout<<MAP[y+1][x+2]<<endl;
  1626. if (MAP[y+2][x-2]=="|F|"){
  1627. SetConsoleTextAttribute(hConsole, 2);
  1628. }
  1629. else if (MAP[y+2][x-2]=="|W|"){
  1630. SetConsoleTextAttribute(hConsole, 9);
  1631. }
  1632. else if (MAP[y+2][x-2]=="|P|"){
  1633. SetConsoleTextAttribute(hConsole, 12);
  1634. }
  1635. else if (MAP[y+2][x-2]=="|G|"){
  1636. SetConsoleTextAttribute(hConsole, 10);
  1637. }
  1638. else if (MAP[y+2][x-2]=="|M|"){
  1639. SetConsoleTextAttribute(hConsole, 8);
  1640. }
  1641. else if (MAP[y+2][x-2]=="|I|"){
  1642. SetConsoleTextAttribute(hConsole, 7);
  1643. }
  1644. else if (MAP[y+2][x-2]=="|R|"){
  1645. SetConsoleTextAttribute(hConsole, 13);
  1646. }
  1647. else if (MAP[y+2][x-2]=="|B|"){
  1648. SetConsoleTextAttribute(hConsole, 14);
  1649. }
  1650. else if (MAP[y+2][x-2]=="|T|"){
  1651. SetConsoleTextAttribute(hConsole, 21);
  1652. }
  1653. cout<<MAP[y+2][x-2];
  1654. if (MAP[y+2][x-1]=="|F|"){
  1655. SetConsoleTextAttribute(hConsole, 2);
  1656. }
  1657. else if (MAP[y+2][x-1]=="|W|"){
  1658. SetConsoleTextAttribute(hConsole, 9);
  1659. }
  1660. else if (MAP[y+2][x-1]=="|P|"){
  1661. SetConsoleTextAttribute(hConsole, 12);
  1662. }
  1663. else if (MAP[y+2][x-1]=="|G|"){
  1664. SetConsoleTextAttribute(hConsole, 10);
  1665. }
  1666. else if (MAP[y+2][x-1]=="|M|"){
  1667. SetConsoleTextAttribute(hConsole, 8);
  1668. }
  1669. else if (MAP[y+2][x-1]=="|I|"){
  1670. SetConsoleTextAttribute(hConsole, 7);
  1671. }
  1672. else if (MAP[y+2][x-1]=="|R|"){
  1673. SetConsoleTextAttribute(hConsole, 13);
  1674. }
  1675. else if (MAP[y+2][x-1]=="|B|"){
  1676. SetConsoleTextAttribute(hConsole, 14);
  1677. }
  1678. else if (MAP[y+2][x-1]=="|T|"){
  1679. SetConsoleTextAttribute(hConsole, 21);
  1680. }
  1681. cout<<MAP[y+2][x-1];
  1682. if (MAP[y+2][x]=="|F|"){
  1683. SetConsoleTextAttribute(hConsole, 2);
  1684. }
  1685. else if (MAP[y+2][x]=="|W|"){
  1686. SetConsoleTextAttribute(hConsole, 9);
  1687. }
  1688. else if (MAP[y+2][x]=="|P|"){
  1689. SetConsoleTextAttribute(hConsole, 12);
  1690. }
  1691. else if (MAP[y+2][x]=="|G|"){
  1692. SetConsoleTextAttribute(hConsole, 10);
  1693. }
  1694. else if (MAP[y+2][x]=="|M|"){
  1695. SetConsoleTextAttribute(hConsole, 8);
  1696. }
  1697. else if (MAP[y+2][x]=="|I|"){
  1698. SetConsoleTextAttribute(hConsole, 7);
  1699. }
  1700. else if (MAP[y+2][x]=="|R|"){
  1701. SetConsoleTextAttribute(hConsole, 13);
  1702. }
  1703. else if (MAP[y+2][x]=="|B|"){
  1704. SetConsoleTextAttribute(hConsole, 14);
  1705. }
  1706. else if (MAP[y+2][x]=="|T|"){
  1707. SetConsoleTextAttribute(hConsole, 21);
  1708. }
  1709. cout<<MAP[y+2][x];
  1710. if (MAP[y+2][x+1]=="|F|"){
  1711. SetConsoleTextAttribute(hConsole, 2);
  1712. }
  1713. else if (MAP[y+2][x+1]=="|W|"){
  1714. SetConsoleTextAttribute(hConsole, 9);
  1715. }
  1716. else if (MAP[y+2][x+1]=="|P|"){
  1717. SetConsoleTextAttribute(hConsole, 12);
  1718. }
  1719. else if (MAP[y+2][x+1]=="|G|"){
  1720. SetConsoleTextAttribute(hConsole, 10);
  1721. }
  1722. else if (MAP[y+2][x+1]=="|M|"){
  1723. SetConsoleTextAttribute(hConsole, 8);
  1724. }
  1725. else if (MAP[y+2][x+1]=="|I|"){
  1726. SetConsoleTextAttribute(hConsole, 7);
  1727. }
  1728. else if (MAP[y+2][x+1]=="|R|"){
  1729. SetConsoleTextAttribute(hConsole, 13);
  1730. }
  1731. else if (MAP[y+2][x+1]=="|B|"){
  1732. SetConsoleTextAttribute(hConsole, 14);
  1733. }
  1734. else if (MAP[y+2][x+1]=="|T|"){
  1735. SetConsoleTextAttribute(hConsole, 21);
  1736. }
  1737. cout<<MAP[y+2][x+1];
  1738. if (MAP[y+2][x+2]=="|F|"){
  1739. SetConsoleTextAttribute(hConsole, 2);
  1740. }
  1741. else if (MAP[y+2][x+2]=="|W|"){
  1742. SetConsoleTextAttribute(hConsole, 9);
  1743. }
  1744. else if (MAP[y+2][x+2]=="|P|"){
  1745. SetConsoleTextAttribute(hConsole, 12);
  1746. }
  1747. else if (MAP[y+2][x+2]=="|G|"){
  1748. SetConsoleTextAttribute(hConsole, 10);
  1749. }
  1750. else if (MAP[y+2][x+2]=="|M|"){
  1751. SetConsoleTextAttribute(hConsole, 8);
  1752. }
  1753. else if (MAP[y+2][x+2]=="|I|"){
  1754. SetConsoleTextAttribute(hConsole, 7);
  1755. }
  1756. else if (MAP[y+2][x+2]=="|R|"){
  1757. SetConsoleTextAttribute(hConsole, 13);
  1758. }
  1759. else if (MAP[y+2][x+2]=="|B|"){
  1760. SetConsoleTextAttribute(hConsole, 14);
  1761. }
  1762. else if (MAP[y+2][x+2]=="|T|"){
  1763. SetConsoleTextAttribute(hConsole, 21);
  1764. }
  1765. cout<<MAP[y+2][x+2]<<endl;
  1766.  
  1767.  
  1768.  
  1769.  
  1770. {
  1771. SetConsoleTextAttribute(hConsole, 14);
  1772. }
  1773. cout<<"Which Direction do you want to go in? N,S,E,W?"<<endl;
  1774. cout<<"F = Forest"<<endl;
  1775. cout<<"T = Town //Only one town"<<endl;
  1776. cout<<"W = Water //Not implemented yet"<<endl;
  1777. cout<<"G = Grasslands"<<endl;
  1778. cout<<"R = Roads, Chance of bandits"<<endl;
  1779. cout<<"P = Point of interest //Not implemented yet"<<endl;
  1780. cout<<"I = Inaccessable"<<endl;
  1781. cout<<"M = Mountian //Not implemented yet"<<endl;
  1782. cout<<"Type 1 for north, 2 for south, 3 for west, 4 for east."<<endl;
  1783. cin>>commandmpdir;
  1784. if (commandmpdir == "1"){y = y - 1;if (MAP[y][x]=="|I|" or MAP[y][x]=="|W|"){y = y + 1;cout<<"That way is inaccessable!"<<endl;goto maptest;}
  1785. else
  1786. cout<<"You are going North!"<<endl;system("CLS");
  1787. if (MAP[y][x]=="|R|"){Rand_Num = (rand() % 50) + 0;
  1788. if (Rand_Num <= 5){cout<<"You encounter a bandit on the road!\n";goto Bandit;}
  1789. else if (Rand_Num <=100,Rand_Num > 5){goto maptest;}}
  1790. if (MAP[y][x]=="|T|"){if (y == 12,x == 28){goto Terracitylvl1;}
  1791. if (y == 16,x == 21){goto tpawsmp;}
  1792. goto maptest;}
  1793.  
  1794. else
  1795. goto maptest;}
  1796.  
  1797. else if (commandmpdir == "2"){y = y + 1;if (MAP[y][x]=="|I|" or MAP[y][x]=="|W|"){y = y - 1;cout<<"That way is inaccessable!"<<endl;goto maptest;}
  1798. else
  1799. cout<<"You are going South!"<<endl;system("CLS");
  1800. if (MAP[y][x]=="|R|"){Rand_Num = (rand() % 50) + 0;
  1801. if (Rand_Num <= 5){cout<<"You encounter a bandit on the road!\n";goto Bandit;}
  1802. else if (Rand_Num <=100,Rand_Num > 5){goto maptest;}}
  1803. if (MAP[y][x]=="|T|"){if (y == 12,x == 28){goto Terracitylvl1;}
  1804. if (y == 16,x == 21){goto tpawsmp;}
  1805. goto maptest;}
  1806.  
  1807. else
  1808. goto maptest;}
  1809.  
  1810. else if (commandmpdir == "3"){x = x - 1;if (MAP[y][x]=="|I|" or MAP[y][x]=="|W|"){x = x + 1;cout<<"That way is inaccessable!"<<endl;goto maptest;}
  1811. else
  1812. cout<<"You are going West!"<<endl;system("CLS");if (MAP[y][x]=="|R|"){Rand_Num = (rand() % 50) + 0;
  1813. if (Rand_Num <= 5){cout<<"You encounter a bandit on the road!\n";goto Bandit;}
  1814. else if (Rand_Num <=100,Rand_Num > 5){goto maptest;}}
  1815. if (MAP[y][x]=="|T|"){if (y == 12,x == 28){goto Terracitylvl1;}
  1816. if (y == 16,x == 21){goto tpawsmp;}
  1817. goto maptest;}
  1818.  
  1819. else
  1820. goto maptest;}
  1821.  
  1822. else if (commandmpdir == "4"){x = x + 1;if (MAP[y][x]=="|I|" or MAP[y][x]=="|W|"){x = x - 1;cout<<"That way is inaccessable!"<<endl;goto maptest;}
  1823. else
  1824. cout<<"You are going East!"<<endl;system("CLS");
  1825. if (MAP[y][x]=="|R|"){Rand_Num = (rand() % 50) + 0;
  1826. if (Rand_Num <= 5){cout<<"You encounter a bandit on the road!\n";goto Bandit;}
  1827. else if (Rand_Num <=100,Rand_Num > 5){goto maptest;}}
  1828. if (MAP[y][x]=="|T|"){if (y == 12,x == 28){goto Terracitylvl1;}
  1829. if (y == 16,x == 21){goto tpawsmp;}
  1830. goto maptest;}
  1831.  
  1832. else
  1833. goto maptest;}
  1834. else if (commandmpdir != "1" or "2" or "3" or "4"){
  1835. cout<<"These are invalid directions."<<endl;system("PAUSE");system("CLS");goto maptest;
  1836. }
  1837.  
  1838. goto jumpto;
  1839. }
  1840.  
  1841. {
  1842. tpawsmp:
  1843. if (tpaws[z][w]=="|P|"){goto PQUEST;}
  1844. if (tpaws[z][w]=="|B|"){z = 3; w = 2;cout<<"You are at the blacksmiths shop."<<endl;system("PAUSE");system("CLS");goto Blacksmith;}
  1845. if (tpaws[z][w]=="|E|"){z = 7; w = 4;cout<<"You are Exiting Paws."<<endl;system("PAUSE");system("CLS");x = 21;y = 16;goto endingfight;}
  1846. else
  1847. cout<<"You are at the coordinates ";cout<<w;cout<<"x ";cout<<z;cout<<"y."<<endl;
  1848. cout<<tpaws[z-2][w-2];cout<<tpaws[z-2][w-1];cout<<tpaws[z-2][w];cout<<tpaws[z-2][w+1];cout<<tpaws[z-2][w+2]<<endl;
  1849. cout<<tpaws[z-1][w-2];cout<<tpaws[z-1][w-1];cout<<tpaws[z-1][w];cout<<tpaws[z-1][w+1];cout<<tpaws[z-1][w+2]<<endl;
  1850. cout<<tpaws[z][w-2];cout<<tpaws[z][w-1];cout<<"|*|";cout<<tpaws[z][w+1];cout<<tpaws[z][w+2]<<endl;
  1851. cout<<tpaws[z+1][w-2];cout<<tpaws[z+1][w-1];cout<<tpaws[z+1][w];cout<<tpaws[z+1][w+1];cout<<tpaws[z+1][w+2]<<endl;
  1852. cout<<tpaws[z+2][w-2];cout<<tpaws[z+2][w-1];cout<<tpaws[z+2][w];cout<<tpaws[z+2][w+1];cout<<tpaws[z+2][w+2]<<endl;
  1853. cout<<"Which Direction do you want to go in? N,S,E,W?"<<endl;
  1854. cout<<"Type 1 for north, 2 for south, 3 for west, 4 for east."<<endl;
  1855. cin>>commandpaws;
  1856. if (commandpaws == "1"){z = z - 1;if (tpaws[z][w]=="|=|"){z = z + 1;cout<<"That way is inaccessable!"<<endl;goto tpawsmp;}
  1857. cout<<"You are going North!"<<endl;system("CLS");goto tpawsmp;}
  1858. //problemPAWS//
  1859. else if (commandpaws == "2"){z = z + 1; if (tpaws[z][w]=="|=|"){z = z - 1;cout<<"That way is inaccessable!"<<endl;goto tpawsmp;}
  1860. cout<<"You are going South!"<<endl;system("CLS");goto tpawsmp;}
  1861.  
  1862. else if (commandpaws == "3"){w = w - 1;if (tpaws[z][w]=="| |"){w = w + 1;cout<<"That way is inaccessable!"<<endl;goto tpawsmp;}
  1863. cout<<"You are going West!"<<endl;system("CLS");goto tpawsmp;}
  1864.  
  1865. else if (commandpaws == "4"){w = w + 1;if (tpaws[z][w]=="| |"){w = w - 1;cout<<"That way is inaccessable!"<<endl;goto tpawsmp;}
  1866. cout<<"You are going East!"<<endl;system("CLS");goto tpawsmp;}
  1867. else
  1868. cin.get();
  1869. system("CLS");
  1870. goto tpawsmp;
  1871. }
  1872. {
  1873. Terracitylvl1:
  1874. string cmmandtc;
  1875. if (TerraCityLevel1[q][u]=="|E|"){q = 7; u = 2;cout<<"You are Exiting Terra City."<<endl;system("PAUSE");system("CLS");y = 12;x = 27;goto maptest;}
  1876. else
  1877. cout<<"You are at the coordinates ";cout<<u;cout<<"x ";cout<<q;cout<<"y."<<endl;
  1878. cout<<TerraCityLevel1[q-2][u-2];cout<<TerraCityLevel1[q-2][u-1];cout<<TerraCityLevel1[q-2][u];cout<<TerraCityLevel1[q-2][u+1];cout<<TerraCityLevel1[q-2][u+2]<<endl;
  1879. cout<<TerraCityLevel1[q-1][u-2];cout<<TerraCityLevel1[q-1][u-1];cout<<TerraCityLevel1[q-1][u];cout<<TerraCityLevel1[q-1][u+1];cout<<TerraCityLevel1[q-1][u+2]<<endl;
  1880. cout<<TerraCityLevel1[q][u-2];cout<<TerraCityLevel1[q][u-1];cout<<"|*|";cout<<TerraCityLevel1[q][u+1];cout<<TerraCityLevel1[q][u+2]<<endl;
  1881. cout<<TerraCityLevel1[q+1][u-2];cout<<TerraCityLevel1[q+1][u-1];cout<<TerraCityLevel1[q+1][u];cout<<TerraCityLevel1[q+1][u+1];cout<<TerraCityLevel1[q+1][u+2]<<endl;
  1882. cout<<TerraCityLevel1[q+2][u-2];cout<<TerraCityLevel1[q+2][u-1];cout<<TerraCityLevel1[q+2][u];cout<<TerraCityLevel1[q+2][u+1];cout<<TerraCityLevel1[q+2][u+2]<<endl;
  1883. cout<<"Which Direction do you want to go in? N,S,E,W?"<<endl;
  1884. cout<<"Type 1 for north, 2 for south, 3 for west, 4 for east."<<endl;
  1885. cin>>cmmandtc;
  1886. if (cmmandtc == "1"){q = q - 1;if (TerraCityLevel1[q][u]=="|W|"){u = u + 1;cout<<"That way is inaccessable!"<<endl;goto Terracitylvl1;}
  1887. cout<<"You are going North!"<<endl;system("CLS");goto Terracitylvl1;}
  1888. //problemPAWS//
  1889. else if (cmmandtc == "2"){q = q + 1; if (TerraCityLevel1[q][u]=="|W|"){u = u - 1;cout<<"That way is inaccessable!"<<endl;goto Terracitylvl1;}
  1890. cout<<"You are going South!"<<endl;system("CLS");goto Terracitylvl1;}
  1891.  
  1892. else if (cmmandtc == "3"){u = u - 1;if (TerraCityLevel1[q][u]=="|W|"){u = u + 1;cout<<"That way is inaccessable!"<<endl;goto Terracitylvl1;}
  1893. cout<<"You are going West!"<<endl;system("CLS");goto Terracitylvl1;}
  1894.  
  1895. else if (cmmandtc == "4"){u = u + 1;if (TerraCityLevel1[q][u]=="|W|"){u = u - 1;cout<<"That way is inaccessable!"<<endl;goto Terracitylvl1;}
  1896. cout<<"You are going East!"<<endl;system("CLS");goto Terracitylvl1;}
  1897. else
  1898. cout<<"Invalid directions."<<endl;
  1899. cin.get();
  1900. system("CLS");
  1901. goto Terracitylvl1;
  1902. }
  1903.  
  1904.  
  1905. jumpto:
  1906.  
  1907. cout<<"You have Finished this demo."<<endl;
  1908. system("PAUSE");
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914. }
  1915. return 0;
  1916. }
Attached Files
File Type: cpp LongTimeProgV1.008.cpp (63.5 KB, 61 views)
Similar Threads
Reputation Points: 8
Solved Threads: 4
Junior Poster in Training
Shinedevil is offline Offline
71 posts
since Nov 2008
Nov 2nd, 2009
0
Re: Text based rpg source code.
woah thats epic! How long did it take for you to make it?
xka
Reputation Points: 10
Solved Threads: 0
Newbie Poster
xka is offline Offline
7 posts
since Oct 2009
Nov 2nd, 2009
0
Re: Text based rpg source code.
Pretty long, ALMOST twice as long as the rpg I made a little while back.

Sadly it does not work in VC++, did you use Dev? (102 errors)
Last edited by restrictment; Nov 2nd, 2009 at 6:34 pm.
Reputation Points: 102
Solved Threads: 17
Posting Whiz in Training
restrictment is offline Offline
228 posts
since Oct 2009
Nov 2nd, 2009
-7
Re: Text based rpg source code.
oh god..... non standards-compliant c++

Would be much better if you had it loading the world data from text file, and seperated that particular game and the core engine in terms of code. Could use inheritance and polymorphesism for the items and monsters. If you used OOP it would make your code juch cleaner.

Not a bad effort, just poor design.
Last edited by jbennet; Nov 2nd, 2009 at 8:27 pm.
Moderator
Featured Poster
Reputation Points: 1800
Solved Threads: 575
Moderator
jbennet is offline Offline
16,526 posts
since Apr 2005
Nov 3rd, 2009
0
Re: Text based rpg source code.
It took me about 1 week to make it. Again, I know that structure is important now, and this had absolutely no structure. Yea I made this in Dev-Cpp.
Reputation Points: 8
Solved Threads: 4
Junior Poster in Training
Shinedevil is offline Offline
71 posts
since Nov 2008
Nov 3rd, 2009
0
Re: Text based rpg source code.
I think this is quite good program. Some could say that redundancy is an issue but I don't think so. This program is quite good, however a bit redundant. Redundancy isn't so bad, it can be useful sometimes. Redundancy in this example isn't bad, it's important that this program is good. If the program is working you shouldn't care about redundancy. I don't know why people don't like redundancy in programming.
Reputation Points: 20
Solved Threads: 18
Junior Poster in Training
Zjarek is offline Offline
79 posts
since Oct 2009
Nov 3rd, 2009
-7
Re: Text based rpg source code.
Quote ...
I don't know why people don't like redundancy in programming.
because it makes for poor maintainability.
Moderator
Featured Poster
Reputation Points: 1800
Solved Threads: 575
Moderator
jbennet is offline Offline
16,526 posts
since Apr 2005
Nov 3rd, 2009
-7
Re: Text based rpg source code.
Oh my god, i just noticed you used a GOTO........
Moderator
Featured Poster
Reputation Points: 1800
Solved Threads: 575
Moderator
jbennet is offline Offline
16,526 posts
since Apr 2005
Nov 3rd, 2009
0
Re: Text based rpg source code.
I never understood why people are always so jumpy when I say I use GOTO? Other than poor structure, why is it so bad?
Reputation Points: 8
Solved Threads: 4
Junior Poster in Training
Shinedevil is offline Offline
71 posts
since Nov 2008
Nov 3rd, 2009
0
Re: Text based rpg source code.
I downloaded Dev-C++, and the code still deosn't work. It has a problem with your color settings.
Reputation Points: 102
Solved Threads: 17
Posting Whiz in Training
restrictment is offline Offline
228 posts
since Oct 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Help? Stuck.
Next Thread in C++ Forum Timeline: need help with for loop?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC