Advertisement
skitzFist

Untitled

Nov 24th, 2015
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.06 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <windows.h>
  4.  
  5. using namespace std;
  6.  
  7. //funktion för text på dialog
  8. void txtDia(){
  9.  
  10. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED | FOREGROUND_GREEN);
  11. }
  12.  
  13.  
  14. //funktion för att återställa färg på text
  15. void* txtNorm(){
  16. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
  17. }
  18.  
  19.  
  20. //Function for Highligting choices in colour
  21. void txtChoice(){
  22. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED | FOREGROUND_BLUE);
  23. }
  24.  
  25. //Function for txt magic
  26.  
  27. void txtMagic(){
  28. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED);
  29. }
  30.  
  31. //Funktion för UI input
  32. void uiInput(){
  33. cout << "--> ";
  34. }
  35.  
  36.  
  37. //Klass för att skapa en karaktär, hålla koll på stats och inventory.
  38. class Hero{
  39. public:
  40. string name;
  41. int str;
  42. int dex;
  43. int inte;
  44.  
  45. int gold;
  46.  
  47. int sword;
  48. int knife;
  49. int magic;
  50. int health;
  51. //Hero (string _name, int _str, int _dex, int _inte, int _gold, int _sword, int _knife, int _magic);
  52.  
  53. void createHero(string _name, int _str, int _dex, int _inte, int _gold, int _sword, int _knife, int _magic, int _health);
  54. void statsScr(string _name, int _str, int _dex, int _inte, int _gold, int _sword, int _knife, int _magic, int _health);
  55. };
  56.  
  57.  
  58. //Konstruktor till klassen Hero
  59. /*Hero::Hero(string _name, int _str, int _dex, int _inte, int _gold, int _sword, int _knife, int _magic){
  60.  
  61. name = _name;
  62. str = _str;
  63. dex = _dex;
  64. inte = _inte;
  65. gold = _gold;
  66. sword = _sword;
  67. knife = _knife;
  68. magic = _magic;
  69. } */
  70.  
  71. void Hero::createHero(string _name, int _str, int _dex, int _inte, int _gold, int _sword, int _knife, int _magic, int _health){
  72.  
  73.  
  74. cout << "Your goal is to survive one day in this crazy and messed up world.\n"
  75. "In order to survive you must know that every action has a consequence. Choose\nwisely who you are,"
  76. " your life depends on it...\n\n\n";
  77.  
  78. cout << "Your name: "; cin >> _name;
  79.  
  80. string choice1;
  81. string choice2;
  82.  
  83. do{
  84. cout << "\nYour parents died a long time ago, they left you with a small hut\nin the poorer districts of the city, but they also left you something else.\n\n"
  85. "A) Your father, whom was a soldier, left you his "; txtChoice(); cout << "sword.\n\n"; txtNorm();
  86. cout << "B) Your mother was a fierce rogue while alive, she left you her beloved "; txtChoice(); cout << "dagger"; txtNorm(); cout << ".\n\n";
  87. cout << "C) Your parents were always poor while alive, but they managed to save up a\nsmall pile of "; txtChoice(); cout << "gold"; txtNorm(); cout << " for you.\n\n";
  88. cout << "D) A dusty"; txtChoice(); cout << " book"; txtNorm(); cout << " that your mother always hid away from your father.\n\n";
  89. uiInput(); cin >> choice1;
  90.  
  91. if (choice1 == "sword" || choice1 == "Sword"){
  92. _sword = 1;
  93. _knife = 0;
  94. _str = 1;
  95. _health = 12;
  96. _dex = 0;
  97. _magic = 0;
  98. _gold = 7;
  99. _inte = 0;
  100.  
  101.  
  102. cout << "\n\nYour fathers sword is still sharp, but your arms are not used to the weight.\nIt will come of good use to you in the future";
  103. break;
  104. }
  105. else if (choice1 == "Dagger" || choice1 == "dagger"){
  106. _knife = 1;
  107. _sword = 0;
  108. _dex = 1;
  109. _health = 10;
  110. _str = 0;
  111. _inte = 0;
  112. _gold = 10;
  113.  
  114. cout << "\n\nHer dagger has saved you more times than you can remember.\nThe poor district is a harsh place.";
  115. break;
  116. }
  117. else if (choice1 == "gold" || choice1 == "Gold"){
  118. _gold = 100;
  119. _health = 10;
  120. _sword = 0;
  121. _knife = 0;
  122. _inte = 0;
  123. _str = 0;
  124. _dex = 0;
  125. _magic = 0;
  126.  
  127. cout << "\n\nAll that remains of the hefty sum they left you is only a hundred gold pieces,\nstill enough money for a years living";
  128. break;
  129. }
  130. else if (choice1 == "book" || choice1 == "Book"){
  131. _inte = 1;
  132. _magic = 1;
  133. _health = 8;
  134. _sword = 0;
  135. _knife = 0;
  136. _gold = 5;
  137. _dex = 0;
  138. _str = 0;
  139.  
  140. cout << "\n\nWhile reading the book for the first time, you realise it's a book \nexplaining the principles and basics of blood magic.\n"
  141. "You're able to do some basic magic from the book, but the cost is always in\nblood. You only use your magic if your life depends on it.";
  142. break;
  143. }
  144. else {
  145. system ("cls");
  146. continue;
  147. }
  148. cout << endl << endl;
  149. }
  150. while(true);
  151.  
  152.  
  153.  
  154. if (_gold < 100){
  155.  
  156. do{
  157. cout << "\n\nAfter your parents death you had to make a living. It's not\n"
  158. "easy for a teenage boy to find his way in a world that\n"
  159. "has abondoned him. But you knew you had to push on, to keep\n"
  160. "being alive no matter what, even if you had to do nasty things.\n\n"
  161. "A) You managed to become an apprentice to the neighbouring "; txtChoice(); cout << "blacksmith."; txtNorm();
  162. cout << "\n\nB) You couldn't find any decent job, neither did you want too\n"
  163. "The streets offer plenty of money, if you have quick\n"
  164. "fingers."; txtChoice(); cout << " Pickpocketing"; txtNorm(); cout << " may not be a glamorous job\n"
  165. "but it kept you alive.\n\n";
  166. cout << "C) You were always drawn to books. When you started to\n"
  167. "hang out in the local "; txtChoice(); cout << "bookstore"; txtNorm(); cout << " more often then your own house\n"
  168. "you kind of melted into the position of helping the shopkeeper\n"
  169. "around the store; one day you just started to get paid.\n\n";
  170. uiInput(); cin >> choice2;
  171.  
  172. if (choice2 == "blacksmith" || choice2 == "Blacksmith"){
  173. _str = _str + 2;
  174. _inte = _inte + 1;
  175. _dex = _dex + 1;
  176. _gold = _gold + 5;
  177.  
  178. cout << "\nAfter working with the blacksmith for several months,\n
  179. "he died and left you unemployed yet again.\n"
  180. "You had become stronger under your apprenticeship, and learned\n"
  181. "a lot. The knowledge would be of great benefit for you.\n";
  182. break;
  183. }
  184.  
  185. else if (choice2 == "pickpocketing" || choice2 == "Pickpocketing"){
  186. _dex = _dex + 2;
  187. _inte = _inte + 1;
  188. _gold = _gold + 3;
  189.  
  190. cout << "\nRunning on the streets had hardened you.\n"
  191. "You became fast and nimble and knew every corner and street \n"
  192. "of the town, an invaluable knowledge\n";
  193. break;
  194.  
  195. }
  196.  
  197. else if (choice2 == "bookstore" || choice2 == "Bookstore"){
  198. _inte = _inte + 3;
  199. _gold = _gold +2;
  200.  
  201. cout << "\nWhile working in the store you had a lot of\n"
  202. "free time, you spent it with reading every single tome\n"
  203. "that interested you. Your mind expanded greatly. Sadly\n"
  204. "Your employer recently died, and yet again you found yourself\n"
  205. "unemployed\n";
  206. break;
  207. }
  208. else {
  209. system ("cls");
  210. continue;
  211. }
  212.  
  213. cout << endl << endl;
  214. }
  215.  
  216. while(true);
  217. }
  218.  
  219. else if (_gold > 20){
  220. cout << "\n\nWith the money you inherited from your parents you\n"
  221. "never had to get a job. you were still worried about the future thou.\n"
  222. "Soon your money would run out, and what would you then do?\n";
  223. }
  224.  
  225.  
  226. system ("PAUSE");
  227.  
  228.  
  229.  
  230. name = _name;
  231. str = _str;
  232. dex = _dex;
  233. inte = _inte;
  234. gold = _gold;
  235. sword = _sword;
  236. knife = _knife;
  237. magic = _magic;
  238. health = _health;
  239. }
  240.  
  241.  
  242. void Hero::statsScr(string _name, int _str, int _dex, int _inte, int _gold, int _sword, int _knife, int _magic, int _health){
  243.  
  244. cout << "_____________________________________\n"
  245. " \n"
  246. "Name: " << name << " \n"
  247. " \n"
  248. "Weapon: ";
  249.  
  250. //För att kontrollera vilket vapen man har
  251. if ( knife > 0){
  252. cout << "Dagger \n";
  253. }
  254. else if (sword > 0 ){
  255. cout << "Sword \n";
  256. }
  257. else {
  258. cout << "No weapon \n";
  259. }
  260.  
  261. // Kontrollerar vilken magi typ man använder.
  262. cout << "Magic: ";
  263.  
  264. if (magic == 1){
  265. cout << "Blood Magic \n";
  266. }
  267. else {
  268. cout << "No magic \n";
  269. }
  270.  
  271. // guld och health
  272. cout << endl << "Gold: " << gold << endl;
  273. cout << endl << "Health: " << health << endl;
  274. cout << "_____________________________________\n";
  275.  
  276. }
  277.  
  278.  
  279. //Funktion för titlescreeen
  280. void titleScr(){
  281.  
  282. cout << "Please extend the console window until it reaches a congenial size\n"
  283. "Choices in this game will be highlighted in"; txtChoice(); cout << " purple"; txtNorm(); cout << ".\nEnjoy:\n";
  284. system ("PAUSE");
  285. system ("cls");
  286.  
  287. cout <<"___________________¶¶¶¶ \n"
  288. "_______________¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ \n"
  289. "___________¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶¶ \n"
  290. "_________¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
  291. "_______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
  292. "______¶¶¶¶¶¶¶¶_______¶¶¶¶¶¶¶¶¶___¶¶¶¶\n"
  293. "_____¶¶¶¶¶¶¶______________________¶¶\n"
  294. "_____¶¶¶¶¶¶___¶¶¶¶¶________________¶\n"
  295. "____¶¶¶¶¶¶___¶¶¶1¶¶¶\n"
  296. "____¶¶¶¶¶¶___¶¶111¶¶\n"
  297. "____¶¶¶¶¶¶___¶¶¶1¶¶¶\n"
  298. "____¶¶¶¶¶¶____¶¶1¶¶\n"
  299. "_____¶¶¶¶¶¶___¶¶1¶¶\n"
  300. "_____¶¶¶¶¶¶¶¶_¶¶¶¶¶\n"
  301. "______¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
  302. "_______¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
  303. "_________¶¶¶¶¶¶¶¶¶¶¶¶\n"
  304. "______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
  305. "__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
  306. "____¶¶¶¶11111111111111111¶¶¶¶¶\n"
  307. "_______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
  308. "______________¶¶_1_¶¶¶¶¶¶¶¶¶\n"
  309. "______________¶¶_1_¶¶¶¶¶¶¶¶¶¶\n"
  310. "______________¶¶_1_¶¶__¶¶¶¶¶¶\n"
  311. "______________¶¶_1_¶¶___¶¶¶¶¶¶\n"
  312. "______________¶¶_1_¶¶___¶¶¶¶¶¶\n"
  313. "______________¶¶_1_¶¶___¶¶¶¶¶¶\n"
  314. "______________¶¶_1_¶¶___¶¶¶¶¶\n"
  315. "______________¶¶_1_¶¶__¶¶¶¶¶¶\n"
  316. "______________¶¶_1_¶¶¶¶¶¶¶¶¶\n"
  317. "______________¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
  318. "______________¶¶¶¶¶¶¶¶¶¶¶\n"
  319. "_____________¶¶¶¶¶¶¶¶¶¶\n"
  320. "____________¶¶¶¶¶¶¶¶¶\n"
  321. "___________¶¶¶¶¶¶¶_¶¶\n"
  322. "__________¶¶¶¶¶¶_1_¶¶\n"
  323. "__________¶¶¶¶¶¶_1_¶¶\n"
  324. "__________¶¶¶¶¶¶_1_¶¶\n"
  325. "__________¶¶¶¶¶¶_1_¶¶\n"
  326. "__________¶¶¶¶¶¶_1_¶¶\n"
  327. "___________¶¶¶¶¶_1_¶¶\n"
  328. "____________¶¶¶¶_1_¶¶\n"
  329. "______________¶¶_1_¶¶¶¶¶¶\n"
  330. "______________¶¶_1_¶¶¶¶¶¶¶¶\n"
  331. "______________¶¶_1_¶¶¶¶¶¶¶¶¶\n"
  332. "______________¶¶_1_¶¶¶_¶¶¶¶¶\n"
  333. "______________¶¶_1_¶¶__¶¶¶¶¶\n"
  334. "______________¶¶___¶¶¶¶¶¶¶¶¶\n"
  335. "______________¶¶___¶¶¶¶¶¶¶¶\n"
  336. "______________¶¶¶¶¶¶¶¶¶¶¶\n"
  337. "______________¶¶¶¶¶¶¶¶¶\n"
  338. "_____________¶¶¶¶¶¶¶¶¶\n"
  339. "____________¶¶¶¶¶¶¶¶¶\n"
  340. "___________¶¶¶¶¶___¶¶\n"
  341. "___________¶¶¶¶¶___¶¶\n"
  342. "___________¶¶¶¶¶___¶¶\n"
  343. "____________¶¶¶¶___¶¶\n"
  344. "____________¶¶¶¶___¶¶\n"
  345. "______________¶¶___¶¶¶¶¶¶\n"
  346. "______________¶¶___¶¶¶¶¶¶¶\n"
  347. "______________¶¶___¶¶_¶¶¶¶¶\n"
  348. "______________¶¶___¶¶___¶¶¶¶\n"
  349. "_______________¶¶_¶¶_____¶¶¶\n"
  350. "________________¶¶¶______¶¶¶\n"
  351. "_________________¶_______¶¶\n"
  352. " _ \n "
  353. "___ _ _ _ __ __ __ (_) __ __ ___ \n"
  354. "/ __| | | | | | '__| \\ \\ / / | | \\ \\ / / / _ \\ \n"
  355. "\\__ \\ | |_| | | | \\ V / | | \\ V / | __/ \n"
  356. "|___/ \\__,_| |_| \\_/ |_| \\_/ \\___| \n";
  357.  
  358. system ("PAUSE");
  359. system ("cls");
  360.  
  361.  
  362.  
  363.  
  364.  
  365. }
  366.  
  367. //Function for death
  368. void deathScr(){
  369. system("cls");
  370. cout <<
  371. "------------------------------¦¦¦--------\n"
  372. "---------------------------¦¦¦¦¦¦¦¦------\n"
  373. "--------------------------¦¦¦¦¦¦¦¦¦¦-----\n"
  374. "-------------------------¦¦¦¦¦¦¦¦¦¦¦¦----\n"
  375. "-------------------------¦¦¦¦¦¦¦¦¦¦¦¦----\n"
  376. "------------------------¦¦¦¦¦¦¦¦¦¦¦¦¦----\n"
  377. "------------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
  378. "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
  379. "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
  380. "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
  381. "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  382. "----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  383. "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  384. "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  385. "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  386. "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  387. "----------¦¦¦---¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  388. "---------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  389. "----------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  390. "----------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  391. "--------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  392. "--------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  393. "--------¦¦¦¦¦¦¦¦¦¦¦----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  394. "--------¦¦¦¦¦¦¦¦¦¦¦-----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  395. "-------¦¦¦¦¦¦¦¦¦¦¦¦¦----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  396. "-------¦¦¦¦¦¦¦¦¦¦¦¦¦----¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
  397. "------¦¦¦¦¦¦¦¦¦¦¦¦¦-----¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
  398. "-----¦¦¦¦¦¦¦¦¦¦¦--------¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
  399. "----¦¦¦¦¦¦¦¦¦¦¦¦---------¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
  400. "---¦¦¦¦¦¦¦¦¦¦¦¦¦---------¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
  401. "---¦¦¦¦¦¦¦¦¦¦¦¦¦----------¦¦¦¦¦¦¦¦¦¦¦¦---\n"
  402. "--¦¦¦¦¦¦¦¦¦¦¦¦¦¦----------¦¦¦¦¦¦¦¦¦¦¦----\n"
  403. "-¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦----------¦¦¦¦¦¦¦¦¦¦¦----\n"
  404. "-¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦----------¦¦¦¦¦¦¦¦¦¦¦----\n"
  405. "¦¦¦¦¦¦¦¦--¦¦¦¦¦¦----------¦¦¦¦¦¦¦¦¦¦-----\n"
  406. "¦¦¦¦¦¦¦¦--¦¦¦¦¦¦---------¦¦¦¦¦¦¦¦¦¦¦-----\n"
  407. "¦¦¦¦¦¦¦¦-----------------¦¦¦¦¦¦¦¦¦¦¦-----\n"
  408. "¦¦¦¦¦¦¦¦----------------¦¦¦¦¦¦¦¦¦¦¦¦¦----\n"
  409. "¦¦¦¦¦¦¦¦---------¦¦¦--¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦----\n"
  410. "¦¦¦¦¦¦¦-----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
  411. "¦¦¦¦¦¦¦----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
  412. "¦¦¦¦¦¦¦----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
  413. "¦¦¦¦¦¦¦----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
  414. "¦¦¦¦¦¦-----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
  415. "¦¦¦¦¦¦----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
  416. "¦¦¦¦¦¦---¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
  417. "¦¦¦¦¦¦---¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
  418. "¦¦¦¦¦--¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
  419. "¦¦¦¦¦-¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
  420. "¦¦¦¦¦-¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
  421. "¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
  422. "¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
  423. "¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n";
  424.  
  425.  
  426.  
  427. cout <<
  428. " ____ ___ \n"
  429. " / ___| __ _ _ __ ___ ___ / _ \\ __ __ ___ _ __ \n"
  430. "| | _ / _` | | '_ ` _ \\ / _ \\ | | | | \\ \\ / / / _ \\ | '__|\n"
  431. "| |_| | | (_| | | | | | | | | __/ | |_| | \\ V / | __/ | | \n"
  432. " \\____| \\__,_| |_| |_| |_| \\___| \\___/ \\_/ \\___| |_| \n\n\n";
  433.  
  434. system("PAUSE");
  435.  
  436.  
  437.  
  438. }
  439.  
  440.  
  441. //if you decide to attack the bandits in your hut.
  442. void attackBandit(Hero& myHero, bool &banditsDead){
  443.  
  444. //if you want to kill the bandits or not.
  445. string choice2;
  446.  
  447.  
  448. //Om du attackerar utan vapen
  449. if (myHero.sword == 0 && myHero.knife == 0){
  450. cout << "As you rush forward to attack the bandits you realise you don't\n"
  451. "have any weapon to attack them with. The fight ends quickly with you\n"
  452. "lying in a pool of blood\n";
  453. system("PAUSE");
  454. deathScr();
  455. }
  456.  
  457. //om du attackerar med svärd
  458. if (myHero.sword == 1){
  459.  
  460. myHero.health = myHero.health - 2;
  461. cout << "\n\nYou always sleep with your fathers sword close by the bed\n"
  462. "A habit that has kept you alive through the years. You quickly pick it\n"
  463. "up and charge the bandits. You suprised them by acting so quickly and \n"
  464. "before they realise what's happened, you draw your bloody sword out of\n"
  465. "one of the bandits and slashes toward the second one. He blocks your slash\n"
  466. "and slashes back with his dagger, it scratches you in the arm.\n"
  467. "You begin circling eachother in the small hut, feeling the eachother out.\n"
  468. "You make a quick attack, and manages to disarm your oppenent.\n"
  469. "One of the bandits are lying on the floor, while bleeding a lot, he's not\n"
  470. "dead. The other bandit stands in front of you, disarmed, with his hands above\n"
  471. "his head asking for mercy.\n\n"
  472. "A) "; txtChoice(); cout <<"Kill"; txtNorm(); cout << " them both\n\n"
  473. "B) Show them "; txtChoice(); cout << "mercy\n\n"; txtNorm();
  474. uiInput(); cin >> choice2;
  475.  
  476. if (choice2 == "Kill" || choice2 == "kill"){
  477. banditsDead = true;
  478. cout << "\n\nYou don't hesitate, with a tight grip on your sword you thrust it\n"
  479. "into the heart of the unarmed bandit. You stride over to the bandit lying\n"
  480. "on your floor, bleeding to death, and kill him.\n"
  481. "In this world there's only survival, it was either you or them.\n"
  482. "Or that is what you keep telling yourself...\n";
  483. }
  484.  
  485. else if (choice2 == "mercy" || choice2 == "mercy"){
  486. cout << "\n\nYou tell the unarmed bandit to grab his friend and get lost.\n"
  487. "you're just hoping they won't seek revenge\n";
  488. }
  489.  
  490. }
  491.  
  492. //om du attackerar med kniv
  493. else if (myHero.knife == 1){
  494. myHero.health = myHero.health - 2;
  495. cout << "\n\nWith your mothers dagger stuffed in your pants behind\n"
  496. "your back, you slowly walks up towards the bandits with your hands\n"
  497. "above your head. They tell you to back off, but you don't listen.\n"
  498. "When in an arms length from a bandit your nimbled fingers quickly \n"
  499. "draws your dagger and slashes towards the closest bandit.\n"
  500. "You feel the warmth of the blood that get's sprayed in your face.\n"
  501. "You feel something slashing at your leg."
  502. "You rush over to the other bandit before he realise what has happened.\n"
  503. "You put your dagger to the bandits throat and tells him to drop his weapon\n\n"
  504. "One bandit is lying on the floor, slowly bleeding to death, the other one is\n"
  505. "standing on his knees with your dagger at his throat, asking for mercy\n\n"
  506. "A) "; txtChoice(); cout <<"Kill"; txtNorm(); cout << " them both\n\n"
  507. "B) Show them "; txtChoice(); cout << "mercy\n\n"; txtNorm();
  508. uiInput(); cin >> choice2;
  509.  
  510. if (choice2 == "Kill" || choice2 == "kill"){
  511. banditsDead = true;
  512. cout << "\n\nYou slit the bandit's throat. His lifeless body falls to the floor.\n"
  513. "The bleeding bandit is struggling to stay conscious and you can see the fear\n"
  514. "that spreads ovr his face as you step closer. You thrust your dagger through his\n"
  515. "heart.\n"
  516. "This is a harsh world, you either kill or get killed. Or that's what you keep\n"
  517. "telling yourself.\n\n";
  518. }
  519. if (choice2 == "mercy" || choice2 == "Mercy"){
  520. cout << "You release your dagger and tell's the pleading bandit to\n"
  521. "get his friend out of here.\n"
  522. "You spared their life, but you keep wondering if they will come back\n";
  523. }
  524. }
  525. }
  526.  
  527.  
  528. //if you decide to give the bandits your gold
  529. void giveBandit(Hero &myHero, string &choice2){
  530.  
  531. if (choice2 == "give" || choice2 == "Give"){
  532. cout << "You decide to give them all of your gold in hope of them to leave\n"
  533. "you alone.\n\n";
  534. if (myHero.gold > 50){
  535. cout << "\nAs you heave out all of you spare gold, you see how\n"
  536. "big the bandits eyes become.\n";
  537. txtDia(); cout << "\"Look Doug...Look at all that gold. HOLY GODS OF ABOVE! We're\n"
  538. "about to get rich!"; txtNorm(); cout << "They look at eachother for a short while, then they get an\n"
  539. "evil grim on their faces.\n";
  540. txtDia(); cout << "\"If words gets to the boss that you had this AMOUNT of gold, we won't\n"
  541. "be able to keep our rightfull part for our own.\" \n"; txtNorm();
  542. cout << "They quickly rush up towards you and grabs your arm and shoves you down on the\n"
  543. "floor. You feel coold steel against your throat, then everything turns black as\n"
  544. "your slowly bleeds to death.\n\n";
  545. system("PAUSE");
  546. deathScr();
  547. }
  548. if (myHero.gold < 50){
  549. cout << "\nThe poor amount of gold you give the bandits doesn't impress them.\n";
  550. txtDia(); cout << "\"Looks like we neeed to do another run before we can return to the boss.\" \n"; txtNorm();
  551. cout << "They grab your gold and leaves through your broken front door\n\n";
  552. myHero.gold = 0;
  553. }
  554.  
  555. }
  556.  
  557. if (choice2 == "half" || choice2 == "Half"){
  558. cout << "\nYou try too fool the bandits by giving them half of your gold.";
  559.  
  560. if (myHero.dex > 2 && myHero.inte >= 1){
  561. cout << "\n\nyou manage too fool the bandits. They take your gold and leave through \n"
  562. "your broken front door.";
  563. myHero.gold = myHero.gold / 2;
  564. }
  565.  
  566. else {
  567. cout << "\n\nYou try to fool the bandits, but they notice your trickery.\n"
  568. "They beat the shit out of you and grabs all of your money. Then they leave\n"
  569. "through your broken front door, laughing, leaving you in a\n"
  570. "pile of blood\n";
  571. myHero.gold = 0;
  572. myHero.health = myHero.health - 7;
  573. }
  574. }
  575.  
  576. }
  577.  
  578.  
  579. //If tou decide to use magic against the invading Bandits
  580. void magicBandit (Hero& myHero, bool &banditsDead){
  581.  
  582. string choice2;
  583. do{
  584.  
  585. cout << "You see the drawn daggers and decide this is no time to joke around\n"
  586. "You know the danger of using magic, but the words from your mothers\n"
  587. "tome recites themselves in your head\n\n"
  588. "A) You aim for "; txtChoice(); cout << "killing"; txtNorm(); cout << " both of them.\n\n"
  589. "B) Even thou you could kill them easily, you decide to show them "; txtChoice(); cout << "mercy\n\n"; txtNorm();
  590. uiInput(); cin >> choice2;
  591.  
  592.  
  593. if (choice2 == "killing" || choice2 == "Killing"){
  594. cout << "\n\nAs you chant the words for the right spell you make a small\n"
  595. "cut in your wrist, the magic demands blood to work properly.\n";
  596. txtMagic(); cout << "\"DEVAR EL INSHAM!\" "; txtNorm(); cout << "The magic fills your body and mind, it's\n"
  597. "the best feeling you could ever imagine, but at the same time you\n"
  598. "feel your body get's weakend and hurt. It's an expensive trick.\n"
  599. "The bandit's drop their daggers and falls down to their knees. Blood is pouring\n"
  600. "from their ears, eyes, nose and mouth. Their expression tells you they want\n"
  601. "to scream. But you know it's impossible for them, they can't move, speak\n"
  602. "or do anything except to feel pain while they're dying in what they will\n"
  603. "experience as an eternity.\n\n";
  604. myHero.health = myHero.health - 2;
  605. banditsDead = true;
  606. break;
  607. }
  608.  
  609. else if (choice2 == "mercy" || choice2 == "Mercy"){
  610.  
  611. cout << "\n\nYou know how dangerous it is to show people magic and let them\n"
  612. "live to tell it. You had thought many times magic was the real reason\n"
  613. "to your parents death. Magic was all but common in this world. Before\n"
  614. "you found the tome of Blood magic, you didn't even know it existed\n"
  615. "and you suspected just a handfull of person knew about its existence.\n"
  616. "But these bandits, even thou they are bandits don't deserve to die such\n"
  617. "a cruel death. Blood magic is no joke.\n\n"
  618. "You make a small cut in your wrist while chanting the words.\n";
  619. txtMagic(); cout << "\"INOM ELS TEL.\" "; txtNorm(); cout << "You can feel the magic enter your mind and body\n"
  620. "It's the best feeling you can ever imagine, but at the same time you can feel\n"
  621. "your body and soul get torned by it. The magic almost works against you, it\n"
  622. "always does when you're not aiming for killing. But manage to controll it.\n"
  623. "And you force the bandits to move by themselves and leave your house,\n"
  624. "leaving the daggers behind ofcourse. You might have spared their life.\n"
  625. "But for which price...?\n";
  626. myHero.health = myHero.health - 3;
  627. break;
  628.  
  629. }
  630. else{
  631. system ("cls");
  632. myHero.statsScr(myHero.name, myHero.str, myHero.dex, myHero.inte, myHero.gold, myHero.sword, myHero.knife, myHero.magic, myHero.health);
  633. continue;
  634. }
  635. }
  636. while (true);
  637. }
  638.  
  639.  
  640. //första delen i spelet.
  641. void chap1(Hero& myHero, bool &banditsDead){
  642. system ("cls");
  643. myHero.statsScr(myHero.name, myHero.str, myHero.dex, myHero.inte, myHero.gold, myHero.sword, myHero.knife, myHero.magic, myHero.health);
  644.  
  645. string choice1;
  646.  
  647. string choice2;
  648.  
  649.  
  650. //from flee option
  651. string choice3;
  652.  
  653. cout << "\n\nYou're lying in your bed, dreaming of another life. A life without poverty\n"
  654. "Even before your parents died, life was harsh. As long as you could remember\n"
  655. "Temolia had always been a cruel city to live in, but when your parents where\n"
  656. "still alive they told you about how it used to be. What seemed like distant\n"
  657. "tales from now, tales about a prosperous small town, with an excellent harbor\n"
  658. "and economy, getting a work would be no problem for almost anyone. But as the \n"
  659. "war with the neighbouring countries went on, Temolia quickly became\n"
  660. "overpopulated. And when the capital was destroyed, rulers decided to make\n"
  661. "Temolia the new capital and move their basis of operation there, things just\n"
  662. "got worse. The city was being expanded in a quick rate, which resulted in\n"
  663. "sloppy work. Nowadays it wasn't unusual for buildings in the poorer district\n"
  664. "to fall in. The city were still being expanded. but only mansions and buildings\n"
  665. "for the rich was being manufactured. The war was over, but no one could really\n"
  666. "tell who won and who lost the war. Temolia was untouched by the battles of the\n"
  667. "war, but the whole as an empire was fundamentally shaken the the bones, the \n"
  668. "economy collapsed and the remaining politicians greedily tried to clutch on\n"
  669. "the last remaining resources for their own use.\n\n";
  670.  
  671.  
  672. do{
  673. txtDia(); cout << "\"There has to be at least something of value in here\"\n";
  674. txtNorm(); cout << "The voice followed by the sound of something breaking woke you\n"
  675. "up from your ill dreams. Your small hut consists of only one room,\n"
  676. "small and coozy as you liked to describe it. As two men enters through your\n"
  677. "front door, you quickly gets out of your bed. The men have daggers drawn.\n"
  678. "You decide too: \n\n"
  679. "A) "; txtChoice(); cout << "Attack"; txtNorm(); cout << " them.\n\n"
  680. "B) "; txtChoice(); cout << "Ask"; txtNorm(); cout << " them what they want.\n\n"
  681. "C) "; txtChoice(); cout << "Flee"; txtNorm(); cout << " through the backdoor\n\n";
  682. if (myHero.magic == 1){
  683. cout << "D) "; txtChoice(); cout << "Magic\n\n"; txtNorm();
  684. }
  685. uiInput(); cin >> choice1;
  686.  
  687. if (choice1 == "Attack" || choice1 == "attack" || choice1 == "A" || choice1 == "a"){
  688. attackBandit(myHero, banditsDead);
  689. break;
  690. }
  691.  
  692. else if (choice1 == "ask" || choice1 == "Ask" || choice1 == "B" || choice1 == "b"){
  693.  
  694. txtDia(); cout << "\n\n \"Isn't that obvious? Are you stupid or something? We want your\n"
  695. "valuables!\" "; txtNorm(); cout << "One of the bandits said in a mocking voice.\n\n"
  696. "A) "; txtChoice(); cout << "Attack"; txtNorm(); cout << " them!\n\n"
  697. "B) "; txtChoice(); cout << "Flee"; txtNorm(); cout << " through the backdoor\n\n"
  698. "C) "; txtChoice(); cout << "Give"; txtNorm(); cout << " them all of your gold\n\n"
  699. "D) Give them "; txtChoice(); cout << "half"; txtNorm(); cout << " of your gold\n\n";
  700.  
  701. if (myHero.magic == 1){
  702. cout << "E) "; txtChoice(); cout << "Magic\n"; txtNorm();
  703. }
  704.  
  705. uiInput(); cin >> choice2;
  706.  
  707. if (choice2 == "Attack" || choice2 == "attack" || choice2 == "A" || choice2 == "a"){
  708. attackBandit(myHero, banditsDead);
  709. break;
  710. }
  711. /*if (choice2 == "Flee" || choice2 == "flee" || choice2 == "B" || choice2 == "b"){
  712. fleeBandit();
  713. }*/
  714.  
  715.  
  716. if (choice2 == "Give" || choice2 == "give" || choice2 == "half" || choice2 == "Half" || choice2 == "C" || choice2 == "c" || choice2 == "D" || choice2 == "d"){
  717. giveBandit (myHero, choice2);
  718. break;
  719. }
  720. if (choice2 == "Magic" || choice2 == "magic" || choice2 == "E" || choice2 == "e"){
  721. magicBandit(myHero, banditDead);
  722. break;
  723. }
  724. else {
  725. system("cls");
  726. continue;
  727. }
  728. }
  729.  
  730.  
  731. if (choice1 == "flee" || choice1 == "Flee" || choice1 == "C" || choice1 == "c"){
  732.  
  733. break;
  734. }
  735. if (choice1 == "magic" || choice1 == "Magic" || choice1 == "D" || choice1 == "d"){
  736. magicBandit(myHero, banditsDead);
  737. break;
  738. }
  739. else{
  740. system ("cls");
  741. myHero.statsScr(myHero.name, myHero.str, myHero.dex, myHero.inte, myHero.gold, myHero.sword, myHero.knife, myHero.magic, myHero.health);
  742. continue;
  743. }
  744. }
  745. while (true);
  746.  
  747.  
  748. }
  749.  
  750.  
  751. int main() {
  752. titleScr();
  753.  
  754. //kontrollerar om man dödade banditerna i chap 1 eller inte.
  755. bool banditsDead = false;
  756.  
  757.  
  758. //Skapa ett objekt av klassen Hero
  759. Hero myHero;
  760.  
  761. //Här skapar man sin karaktär.
  762. myHero.createHero(myHero.name, myHero.str, myHero.dex, myHero.inte, myHero.gold, myHero.sword, myHero.knife, myHero.magic, myHero.health);
  763.  
  764.  
  765. //Spelets egentliga början efter att man skapat sin karaktär.
  766. chap1(myHero, banditsDead);
  767.  
  768.  
  769.  
  770. system ("PAUSE");
  771. return 0;
  772. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement