Advertisement
Guest User

Untitled

a guest
Nov 25th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.78 KB | None | 0 0
  1. #include <iostream>
  2. #include <limits>
  3. #include <Windows.h>
  4. #include "MMSystem.h"
  5. #include <thread>
  6.  
  7. using namespace std;
  8.  
  9. //////////////////////// List of variables
  10.  
  11. int race;
  12. string name;
  13. int profession;
  14. int gender;
  15. int attributesp=20;
  16. string advready;
  17. bool advreadybl;
  18. bool dogesong;
  19. bool dogesongapr;
  20. bool cont;
  21.  
  22. /////////////////////////List of variables
  23.  
  24.  
  25.  
  26. ////////////////////////////// List of attribute
  27.  
  28. int attributes;
  29. int strength=10;
  30. int dextrity=10;
  31. int intelligence=10;
  32. int constitution=10;
  33. int charisma=10;
  34.  
  35. ////////////////////////////// List of variables
  36.  
  37.  
  38.  
  39. void music()
  40. {
  41. while (dogesong==0)
  42. {
  43. dogesongapr=1;
  44. }
  45. if (dogesongapr=1) PlaySound(TEXT("dogsong.wav"), NULL, SND_SYNC);
  46. }
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. int main()
  54. {
  55.  
  56.  
  57.  
  58. thread first (music);
  59.  
  60. ////////////////////////////////////////// List of genders
  61.  
  62. cout << "Choose gender" << endl;
  63. cout << "1. Male" << endl;
  64. cout << "2. Female" << endl;
  65. cout << endl;
  66.  
  67. ////////////////////////////////////////// List of genders
  68.  
  69. ////////////////////// Inputting value into variable for gender
  70.  
  71. cin >> gender;
  72. cout << endl;
  73.  
  74. ////////////////////// Inputting value into variable for gender
  75.  
  76. ////////////////////////////////////////////////////////////////////// Checking gender
  77.  
  78. while(gender < 1 || gender > 2)
  79. {
  80. cout << "Choose correct gender!" << endl;
  81. cout << "Choose gender" << endl;
  82. cout << "1. Male" << endl;
  83. cout << "2. Female" << endl;
  84. cout << endl;
  85. if(!cin)
  86. {
  87. cin.clear();
  88. cin.ignore(numeric_limits<streamsize>::max(), '\n');
  89. }
  90. cin >> gender;
  91. cout << endl;
  92. }
  93. ////////////////////////////////////////////////////////////////////// Checking gender
  94.  
  95.  
  96.  
  97. ////////////////////////////////////////// List of races
  98.  
  99. cout << "Choose race" << endl;
  100. cout << "1. Human" << endl;
  101. cout << "2. Elf" << endl;
  102. cout << "3. Orc" << endl;
  103. cout << endl;
  104.  
  105. ////////////////////////////////////////// List of races
  106.  
  107. //////////////////// Inputting value into variable for race
  108.  
  109. cin >> race;
  110. cout << endl;
  111.  
  112. //////////////////// Inputting value into variable for race
  113.  
  114.  
  115. //////////////////////////////////////////////////////////////////// Checking race
  116.  
  117. while(race < 1 || race > 3)
  118. {
  119. cout << "Choose correct race!" << endl;
  120. cout << "Choose race" << endl;
  121. cout << "1. Human" << endl;
  122. cout << "2. Elf" << endl;
  123. cout << "3. Orc" << endl;
  124. cout << endl;
  125. if(!cin)
  126. {
  127. cin.clear();
  128. cin.ignore(numeric_limits<streamsize>::max(), '\n');
  129. }
  130. cin >> race;
  131. cout << endl;
  132. }
  133. //////////////////////////////////////////////////////////////////// Checking race
  134.  
  135. /////////////////////////////////////
  136. //
  137. switch (race) //
  138. { //
  139. //
  140. /////////////////////////////////////
  141. //
  142. case '1': //
  143. cout << "You chosed human" << endl; //
  144. break; //
  145. //
  146. ///////////////////////////////////// Description and info about chosing race.
  147. //
  148. case '2': //
  149. cout << "You chosed elf" << endl; //
  150. break; //
  151. //
  152. /////////////////////////////////////
  153. //
  154. case '3': //
  155. cout << "You chosed orc" << endl; //
  156. break; //
  157. } //
  158. //
  159. /////////////////////////////////////
  160.  
  161. ///////////////////////
  162. //
  163. //
  164. cout << endl; // End line
  165. //
  166. //
  167. ///////////////////////
  168.  
  169. ////////////////////////////////////////////
  170. //
  171. cout << "Choose profession" << endl; //
  172. cout << "1. Warrior" << endl; //
  173. cout << "2. Archer" << endl; // List of professions
  174. cout << "3. Mage" << endl; //
  175. cout << endl; //
  176. //
  177. ////////////////////////////////////////////
  178.  
  179. //////////////////////
  180. //
  181. cin >> profession; //
  182. cout << endl; // Inputting value into variable for profession
  183. //
  184. //////////////////////
  185.  
  186. //////////////////////////////////////////////////////////////////
  187. //
  188. while(profession < 1 || profession > 3) //
  189. { //
  190. cout << "Chose correct profession!" << endl; //
  191. cout << "Choose profession" << endl; //
  192. cout << "1. Warrior" << endl; //
  193. cout << "2. Archer" << endl; //
  194. cout << "3. Mage" << endl; // Checking profession
  195. cout << endl; //
  196. if(!cin) //
  197. { //
  198. cin.clear(); //
  199. cin.ignore(numeric_limits<streamsize>::max(), '\n'); //
  200. } //
  201. cin >> profession; //
  202. cout << endl; //
  203. } //
  204. //////////////////////////////////////////////////////////////////
  205.  
  206. /////////////////////////////////////
  207. //
  208. switch (profession) //
  209. { //
  210. //
  211. /////////////////////////////////////
  212. //
  213. case 1: //
  214. cout << "You chosed warrior" << endl; //
  215. break; //
  216. //
  217. ///////////////////////////////////// Description and info about chosing profession.
  218. //
  219. case 2: //
  220. cout << "You chosed archer" << endl; //
  221. break; //
  222. //
  223. /////////////////////////////////////
  224. //
  225. case 3: //
  226. cout << "You chosed mage" << endl; //
  227. break; //
  228. } //
  229. //
  230. /////////////////////////////////////
  231.  
  232. ///////////////////////
  233. //
  234. //
  235. cout << endl; // End line
  236. //
  237. //
  238. ///////////////////////
  239.  
  240. cout << "Choose your name: "; cin >> name; cout << endl;
  241.  
  242. /////////////////////////////////////////////////////////////////////////
  243.  
  244. //
  245. while(!(attributesp<1)) //
  246. { //
  247. cout << "Please manage your attribute points" << endl; //
  248. cout << endl; //
  249. cout << "Remaining attribute points: " << attributesp; //
  250. cout << endl; //
  251. cout << "Attributes: " << endl; //
  252. cout << "1. (101) Strength: " << strength << endl; //
  253. cout << "2. (202) Constitution: " << constitution << endl; //
  254. cout << "3. (303) Charisma: " << charisma << endl; // Attribute managment
  255. cout << "4. (404) Dextrity: " << dextrity << endl; //
  256. cout << "5. (505) Intelligence: " << intelligence << endl; //
  257. cout << endl; //
  258. cout << "If you want to know anything about any attribute type" << endl; cout << endl; cout << "( 101 / 202 / 303 / 404 / 505 ) " << endl;
  259. cout << endl;
  260. cout << "If you want to upgrade attribute select numer" << endl; cout << endl; cout << "( 1 / 2 / 3 / 4 / 5 )" << endl;
  261. cout << endl;
  262. cout << "Choose: ";
  263. cin >> attributes;
  264. cout << endl;
  265.  
  266.  
  267.  
  268.  
  269. /////////////////////////////////////////////////////////////////////////
  270. //
  271. switch(attributes) //
  272. { //
  273. case 1: //
  274. strength=strength+2;
  275. attributesp=attributesp-2; //
  276. break; //
  277. //
  278. case 2: //
  279. constitution=constitution+2;
  280. attributesp=attributesp-2; //
  281. break; //
  282. //
  283. case 3: //
  284. charisma=charisma+2;
  285. attributesp=attributesp-2; //
  286. break; //
  287. //
  288. case 4: //
  289. dextrity=dextrity+2;
  290. attributesp=attributesp-2;
  291. //
  292. break; //
  293. //
  294. case 5: //
  295. intelligence=intelligence+2;
  296. attributesp=attributesp-2; //
  297. break;
  298.  
  299. case 101:
  300. cout << "Strength makes your character hit harder," << endl;
  301. cout << "dealing more damage to enemies." << endl;
  302. cout << " "<< endl;
  303. system ("pause"); cout << endl;
  304. break;
  305.  
  306. case 202:
  307. cout << "Constitution makes your character healther," << endl;
  308. cout << "increasing amount of damage he can take." << endl;
  309. cout << " "<< endl;
  310. system ("pause"); cout << endl;
  311. break;
  312.  
  313. case 303:
  314. cout << "Charisma makes your character move convincing," << endl;
  315. cout << "increasing his speech and allowing him to buy items for less gold." << endl;
  316. cout << " "<< endl;
  317. system ("pause"); cout << endl;
  318. break;
  319.  
  320. case 404:
  321. cout << "Dextrity makes your character more agile," << endl;
  322. cout << "increasing amount of damage dealt with bows." << endl;
  323. cout << " "<< endl;
  324. system ("pause"); cout << endl;
  325. break;
  326.  
  327. case 505:
  328. cout << "Intelligence makes your character more intelligent," << endl;
  329. cout << "increaces amount of damage dealt with magic." << endl;
  330. cout << " "<< endl;
  331. system ("pause"); cout << endl;
  332. break;
  333.  
  334. default:
  335. cout << endl;
  336. break;
  337. }
  338. cout << endl;
  339.  
  340. }
  341.  
  342.  
  343.  
  344. cout << "Your attributes are: " << endl;
  345. cout << "STR: " << strength << endl;
  346. cout << "CON: " << constitution << endl;
  347. cout << "CHA: " << charisma << endl;
  348. cout << "DEX: " << dextrity << endl;
  349. cout << "INT: " << intelligence << endl;
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356. /////////////////////////////////////////////////////////////////////////
  357.  
  358.  
  359.  
  360. cout << "You chosed "; if (gender==1) cout << "male "; else cout << "female ";
  361.  
  362. switch(profession)
  363. {
  364. case 1:
  365. cout <<"warrior ";
  366. break;
  367.  
  368. case 2:
  369. cout <<"archer ";
  370. break;
  371.  
  372. case 3:
  373. cout <<"mage ";
  374. break;
  375. }
  376.  
  377.  
  378.  
  379. switch(race)
  380. {
  381. case 1:
  382. cout <<"human ";
  383. cout << endl;
  384. break;
  385.  
  386. case 2:
  387. cout <<"elf ";
  388. cout << endl;
  389. break;
  390.  
  391. case 3:
  392. cout <<"orc ";
  393. cout << endl;
  394. break;
  395. }
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404. cout << endl;
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412. cout << "Now, tell me, " << name << " are you ready to begin your adventure? ";
  413. cout << "(Yes / No)"; cout << endl;
  414. cout << "Choose "; cin >> advready; cout << endl;
  415. if (advready=="Yes") advreadybl=1; else if (advready=="yes") advreadybl=1;
  416.  
  417.  
  418. if (advreadybl==0) dogesong=1;
  419.  
  420. while (advreadybl==0)
  421. {
  422.  
  423. cout << endl;
  424. cout << "Please write 'Yes if you're ready to begin your adventure. " << endl;
  425. cout << "Whilist you're struggling with your choice, listen to this dog song." << endl;
  426. cout << endl;
  427. cout << "Choose "; cin >> advready; cout << endl;
  428. if (advready=="Yes") advreadybl=1; else if (advready=="yes") advreadybl=1;
  429.  
  430. }
  431.  
  432. dogesong=1;
  433.  
  434. cout << "Enter first room: ";
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442. system ("Pause");
  443. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement