Advertisement
Guest User

Pirate game

a guest
Jul 23rd, 2012
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.80 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <stdlib.h>
  4. #include <windows.h>
  5. #include <cstdlib>
  6. #include <fstream>
  7. #include <string>
  8. #include <MMSystem.h>
  9.  
  10.  
  11. using namespace std;
  12.  
  13. int main()
  14. {
  15. string name, respond, zero, one, two, three, four, five, six, seven;
  16. int hp, hpmax, atk1, atk2, shiphp, shiphpmax, shipatk1, shipatk2, cb1, cb2, sloopcb1, sloopcb2, sloophp, sloopatk1, sloopatk2, sloophpmax, tshp, tshpmax, tscb1, tscb2, tsatk1, tsatk2, carvelhp, carvelhpmax, carvelcb1, carvelcb2, carvelatk1, carvelatk2;
  17. int sloop, galleon;
  18. int holder1, holder2, holder3, holder4, holder5, holder6, holder7, random, doubloons;
  19. int bucatk1, bucatk2, buchp, buchpmax, cutatk1, cutatk2, cuthp, cuthpmax;
  20. int eng, fren, dut, span, pr, nev;
  21. zero = "0";
  22. one = "1";
  23. two = "2";
  24. three = "3";
  25. four = "4";
  26. five = "5";
  27. six = "6";
  28. seven = "7";
  29. doubloons = 1000;
  30. eng = 0;
  31. fren = 0;
  32. dut = 0;
  33. span = 0;
  34. nev = 0;
  35. pr = 0;
  36. galleon = 0;
  37. sloop = 1;
  38. atk1 = 10;
  39. atk2 = 20;
  40. hp = 100;
  41. hpmax = 100;
  42. shiphp = 550;
  43. shiphpmax = 550;
  44. cb1 = 0;
  45. cb2 = 12;
  46. shipatk1 = 6;
  47. shipatk2 = 25;
  48. sloophp = 500;
  49. sloophpmax = 500;
  50. sloopcb1 = 0;
  51. sloopcb2 = 12;
  52. sloopatk1 = 6;
  53. sloopatk2 = 15;
  54. tshp = 2875;
  55. tshpmax = 2875;
  56. tscb1 = 0;
  57. tscb2 = 56;
  58. tsatk1 = 6;
  59. tsatk2 = 37;
  60. carvelhp = 900;
  61. carvelhpmax = 900;
  62. carvelcb1 = 0;
  63. carvelcb2 = 20;
  64. carvelatk1 = 9;
  65. carvelatk2 = 27;
  66. bucatk1 = 10;
  67. bucatk2 = 20;
  68. buchp = 100;
  69. buchpmax = 100;
  70. cutatk1 = 10;
  71. cutatk2 = 20;
  72. cuthp = 100;
  73. cuthpmax = 100;
  74. cout << "\n\n Welcome swashbuckler!\n\n ";
  75. cout << "(1) Start New Game\n\n (2) Load Game\n\n ";
  76. cin >> respond;
  77. if (respond.compare(one) == 0)
  78. {
  79. goto game;
  80. }
  81. if (respond.compare(two) == 0)
  82. {
  83. goto load;
  84. }
  85.  
  86. game:
  87. {
  88. system("cls");
  89. cout << "\n\n To Start Off, Give Me Your Name and Head to Port Royal Over There\n\n ";
  90. cout << "Name: "; cin >> name;
  91. }
  92. portroyal:
  93. {
  94. system("cls");
  95. pr += 1;
  96. cout << "\n\n Welcome to Port Royal\n\n (1) Ship Wright\n\n (2) Explore By Sea\n\n (3) Explore By Land\n\n (4) Locations\n\n (5) Stats\n\n (6) Rest\n\n (7) Save\n\n\n Doubloons: " << doubloons <<"\n\n ";
  97. cin >> respond;
  98. if (respond.compare(one) == 0)
  99. {
  100. goto shipwright;
  101. }
  102. if (respond.compare(two) == 0)
  103. {
  104. goto exploresea;
  105. }
  106. if (respond.compare(three) == 0)
  107. {
  108. goto exploreland;
  109. }
  110. if (respond.compare(four) == 0)
  111. {
  112. goto locations;
  113. }
  114. if (respond.compare(five) == 0)
  115. {
  116. goto stats;
  117. }
  118. if (respond.compare(six) == 0)
  119. {
  120. goto rest;
  121. }
  122. if (respond.compare(seven) == 0)
  123. {
  124. goto save;
  125. }
  126. else;
  127. goto portroyal;
  128. }
  129. shipwright:
  130. {
  131. system("cls");
  132. holder1 = shiphpmax - shiphp;
  133. holder2 = 2;
  134. holder3 = holder1 * holder2;
  135. cout << "\n\n We fix your ships and upgrade 'em too.\n\n Ship Health: " << shiphp << "/" << shiphpmax << "\n\n (1) Repair Your Ship. Price: " << holder3 << "\n\n (2) Buy New Ship\n\n (3) Sell Your Ship\n\n (0) Go Back To Town\n\n ";
  136. cin >> respond;
  137. if (respond.compare(zero) == 0)
  138. {
  139. goto portroyal;
  140. }
  141. if (respond.compare(one) == 0 && doubloons < holder3)
  142. {
  143. system("cls");
  144. cout << "\n\n You Don't Have Enough Doubloons!\n\n ";
  145. system("pause");
  146. goto shipwright;
  147. }
  148. if (respond.compare(one) == 0 && doubloons >= holder3)
  149. {
  150. doubloons -= holder3;
  151. shiphp = shiphpmax;
  152. goto shipwright;
  153. }
  154. if (respond.compare(two) == 0)
  155. {
  156. goto buyship;
  157. }
  158. if (respond.compare(three) == 0)
  159. {
  160. goto sellship;
  161. }
  162. else;
  163. goto shipwright;
  164. }
  165. buyship:
  166. {
  167. system ("cls");
  168. cout << "\n\n Buy A New Ship!\n\n (1) Sloop: 5,000 Doubloons\n\n (2) Galleon: 10,000 Doubloons\n\n (0) Go Back To Town\n\n ";
  169. cin >> respond;
  170. if (respond.compare(one) == 0 && sloop == 1 || galleon == 1)
  171. {
  172. system("cls");
  173. cout << "\n\n You Must Sell Your Ship In Order To Get A New Ship!\n\n ";
  174. system("pause");
  175. goto shipwright;
  176. }
  177. if (respond.compare(one) == 0 && sloop == 0 && galleon == 0 && doubloons <= 4999)
  178. {
  179. system("cls");
  180. cout << "\n\n You Do Not Have Enough Doubloons For A Sloop!\n\n ";
  181. system("pause");
  182. goto shipwright;
  183. }
  184. if (respond.compare(one) == 0 && sloop == 0 && galleon == 0 && doubloons >= 5000)
  185. {
  186. system("cls");
  187. cout << "\n\n You Have Bought A Sloop!\n\n ";
  188. doubloons -= 5000;
  189. sloop = 1;
  190. shiphp = 500;
  191. shiphpmax = 550;
  192. cb1 = 0;
  193. cb2 = 12;
  194. shipatk1 = 6;
  195. shipatk2 = 25;
  196. system("pause");
  197. goto shipwright;
  198. }
  199. if (respond.compare(two) == 0 && sloop == 1 || galleon == 1)
  200. {
  201. system("cls");
  202. cout << "\n\n You Must Sell Your Ship In Order To Get A New Ship!\n\n ";
  203. system("pause");
  204. goto shipwright;
  205. }
  206. if (respond.compare(two) == 0 && sloop == 0 && galleon == 0 && doubloons <= 9999)
  207. {
  208. system("cls");
  209. cout << "\n\n You Do Not Have Enough Doubloons For A Galleon!\n\n ";
  210. system("pause");
  211. goto shipwright;
  212. }
  213. if (respond.compare(two) == 0 && sloop == 0 && galleon == 0 && doubloons >= 10000)
  214. {
  215. system("cls");
  216. cout << "\n\n You Have Bought A Galleon!\n\n ";
  217. doubloons -= 10000;
  218. galleon = 1;
  219. shiphp = 1500;
  220. shiphpmax = 1500;
  221. cb1 = 0;
  222. cb2 = 37;
  223. shipatk1 = 12;
  224. shipatk2 = 34;
  225. system("pause");
  226. goto shipwright;
  227. }
  228. if (respond.compare(zero) == 0)
  229. {
  230. goto locations;
  231. }
  232. else;
  233. goto shipwright;
  234. }
  235. sellship:
  236. {
  237. system("cls");
  238. cout << "\n\n Sell Your Current Ship For Doubloons!\n\n (1) Sloop For 1000 Doubloons\n\n (2) Galleon For 3000 Doubloons\n\n ";
  239. cin >> respond;
  240. if (respond.compare(one) == 0 && sloop == 0)
  241. {
  242. system("cls");
  243. cout << "\n\n You Dont Have A Ship To Sell!\n\n ";
  244. system("pause");
  245. goto shipwright;
  246. }
  247. if (respond.compare(one) == 0 && sloop == 1)
  248. {
  249. system("cls");
  250. cout << "\n\n You Have Sold Your Sloop And Gained 1,000 Doubloons\n\n ";
  251. sloop = 0;
  252. doubloons += 1000;
  253. shiphp = 0;
  254. shiphpmax = 0;
  255. cb1 = 0;
  256. cb2 = 0;
  257. shipatk1 = 0;
  258. shipatk2 = 0;
  259. system("pause");
  260. goto shipwright;
  261. }
  262. if (respond.compare(two) == 0 && galleon == 0)
  263. {
  264. system("cls");
  265. cout << "\n\n You Dont Have A Ship To Sell!\n\n ";
  266. system("pause");
  267. goto shipwright;
  268. }
  269. if (respond.compare(one) == 0 && galleon == 1)
  270. {
  271. system("cls");
  272. cout << "\n\n You Have Sold Your Galleon And Gained 10,000 Doubloons\n\n ";
  273. galleon = 0;
  274. doubloons += 10000;
  275. shiphp = 0;
  276. shiphpmax = 0;
  277. cb1 = 0;
  278. cb2 = 0;
  279. shipatk1 = 0;
  280. shipatk2 = 0;
  281. system("pause");
  282. goto shipwright;
  283. }
  284. else;
  285. goto sellship;
  286. }
  287. exploresea:
  288. {
  289. random = rand()% 50+1;
  290. if (random <= 10)
  291. {
  292. goto sloop;
  293. }
  294. if (random <= 20 && random >= 10)
  295. {
  296. goto ts;
  297. }
  298. if (random <= 23 && random >= 20)
  299. {
  300. system("cls");
  301. cout << "\n\n " << name << " Finds A Wrecked Ship And Explores It\n\n ";
  302. system("pause");
  303. goto wreckedship;
  304. }
  305. if (random <= 33 && random >= 23)
  306. {
  307. goto carvel;
  308. }
  309. if (random <= 35 && random >= 33)
  310. {
  311. goto town;
  312. }
  313. if (random >= 35)
  314. {
  315. system("cls");
  316. cout << "\n\n You Found Nothing!\n\n (1) Go Head To Port\n\n (2) Keep Exploring\n\n ";
  317. cin >> respond;
  318. if (respond.compare(one) == 0)
  319. {
  320. goto locations;
  321. }
  322. if (respond.compare(two) == 0)
  323. {
  324. goto exploresea;
  325. }
  326. }
  327. else;
  328. goto exploresea;
  329. }
  330.  
  331. exploreland:
  332. {
  333. random = rand()% 50+1;
  334. if (random <= 10)
  335. {
  336. system("cls");
  337. cout << "\n\n You Have Encountered A Cut Throat!\n\n (1) Draw Your Sword!\n\n (2) Run Like Hell!\n\n ";
  338. cin >> respond;
  339. if (respond.compare(one) == 0)
  340. {
  341. goto cutthroat;
  342. }
  343. if (respond.compare(two) == 0)
  344. {
  345. goto locations;
  346. }
  347. }
  348. if (random <= 20 && random >= 10)
  349. {
  350. system("cls");
  351. cout << "\n\n You Have Encountered A Buccaneer!\n\n (1) Draw Your Sword!\n\n (2) Run Like Hell!\n\n ";
  352. cin >> respond;
  353. if (respond.compare(one) == 0)
  354. {
  355. goto buccaneer;
  356. }
  357. if (respond.compare(two) == 0)
  358. {
  359. goto locations;
  360. }
  361. }
  362. if (random <= 23 && random >= 20)
  363. {
  364. holder1 = 500;
  365. holder2 = 3500;
  366. holder3 = rand()% (holder2-holder1)+holder1;
  367. cout << "\n\n You Found Buried Treasure!\n\n In It Is " << holder3 << " Doubloons\n\n ";
  368. doubloons += holder3;
  369. }
  370. if (random >= 23)
  371. {
  372. system("cls");
  373. cout << "\n\n You Found Nothing!\n\n (1) Go Head To Town\n\n (2) Keep Exploring\n\n ";
  374. cin >> respond;
  375. if (respond.compare(one) == 0)
  376. {
  377. goto locations;
  378. }
  379. }
  380. if (respond.compare(two) == 0)
  381. {
  382. goto exploreland;
  383. }
  384. else;
  385. goto exploreland;
  386. }
  387.  
  388. locations:
  389. {
  390. system("cls");
  391. cout << "\n\n Known locations ";
  392. cout << "\n\n (1) Port Royal\n\n";
  393. if (nev == 1)
  394. {
  395. cout << " (2) Nevis\n\n";
  396. }
  397. cin >> respond;
  398. if (respond.compare(two) == 0 && nev == 1)
  399. {
  400. goto nevis;
  401. }
  402. if (respond.compare(one) == 0)
  403. {
  404. goto portroyal;
  405. }
  406. else
  407. goto portroyal;
  408. }
  409. town:
  410. {
  411. system("cls");
  412. cout << "\n\n " << name << "'s Crew Spots A Distant Town\n\n (1) Explore\n\n (2) Sail Away\n\n ";
  413. cin >> respond;
  414. if (respond.compare(two) == 0)
  415. {
  416. goto locations;
  417. }
  418. if (respond.compare(one) == 0)
  419. {
  420. goto nevis;
  421. }
  422. }
  423. nevis:
  424. {
  425. system("cls");
  426. cout << "\n\n Welcome to Nevis!\n\n (1) Ship Wright\n\n (2) Explore By Sea\n\n (3) Explore By Land\n\n (4) Locations\n\n (5) Stats\n\n (6) Rest\n\n\n Doubloons: " << doubloons <<"\n\n ";
  427. if (nev == 0)
  428. {
  429. nev = 1;
  430. }
  431. cin >> respond;
  432. if (respond.compare(one) == 0)
  433. {
  434. goto shipwright;
  435. }
  436. if (respond.compare(two) == 0)
  437. {
  438. goto exploresea;
  439. }
  440. if (respond.compare(three) == 0)
  441. {
  442. goto exploreland;
  443. }
  444. if (respond.compare(four) == 0)
  445. {
  446. goto locations;
  447. }
  448. if (respond.compare(five) == 0)
  449. {
  450. goto stats;
  451. }
  452. if (respond.compare(six) == 0)
  453. {
  454. goto rest;
  455. }
  456. else;
  457. goto portroyal;
  458. }
  459.  
  460. stats:
  461. {
  462. system("cls");
  463. cout << "\n\n " << name << "'s Stats:\n\n Health: " << hp << "/" << hpmax<< "\n\n Damage: " << atk1 << "-" << atk2 << "\n\n\n " << name << "'s Ship Stats:\n\n Cannons: " << cb2 << "\n\n Damage: " << shipatk1 << "-" << shipatk2 << "\n\n ";
  464. system("pause");
  465. goto portroyal;
  466. }
  467.  
  468. rest:
  469. {
  470. system("cls");
  471. cout << "\n\n " << name << " Goes To Sleep And Their Health Is Restored\n\n ";
  472. hp = hpmax;
  473. system("pause");
  474. goto locations;
  475. }
  476.  
  477. save:
  478. {
  479. system("cls");
  480. ofstream dataFile;
  481. dataFile.open("data.txt");
  482. dataFile << name << endl;
  483. dataFile.close();
  484. cout << "\n" << name << "'s Game Saved\n\n";
  485. system("pause");
  486. goto portroyal;
  487. }
  488. load:
  489. {
  490. system("cls");
  491. ifstream dataFile;
  492. dataFile.open("data.txt");
  493. dataFile >> name;
  494. dataFile.close();
  495. cout << "\n" << name << "'s Game Loaded\n\n";
  496. system("pause");
  497. goto portroyal;
  498. }
  499.  
  500. sloop:
  501. {
  502. system("cls");
  503. cout << "\n\n Sloop's Current State: Attack: " << sloopatk1 << "-" << sloopatk2 << ", HP: " << sloophp << "/" << sloophpmax << "!\n Your Current State: Attack: " << shipatk1 << "-" << shipatk2 << ", HP: " << shiphp << "/" << shiphpmax << "!\n\n\n";
  504. cout << " (1) Attack\n\n (2) Run!\n\n ";
  505. if (shiphp <= 0)
  506. {
  507. goto sink;
  508. }
  509. if (sloophp <= 0)
  510. {
  511. goto sloopwin;
  512. }
  513. cin >> respond;
  514. if (respond.compare(one) == 0)
  515. {
  516. system("cls");
  517. holder1 = rand()% (cb2-cb1)+cb1;
  518. holder2 = rand()% (shipatk1-shipatk2)+shipatk1;
  519. holder3 = rand()% (sloopcb2-sloopcb1)+sloopcb1;
  520. holder4 = rand()% (sloopatk2-sloopatk1)+sloopatk1;
  521. holder6 = holder4 * holder3;
  522. holder5 = holder2 * holder1;
  523. sloophp -= holder5;
  524. shiphp -= holder6;
  525. cout << "\n\n You hit " << holder1 << " times at " << holder2 << " damage each for a total of " << holder5 << "\n\n";
  526. cout << " The sloop hit " << holder3 << " times at " << holder4 << " damage each for a total of " << holder6 << "\n\n\n\n ";
  527. cout << " "; system("pause");
  528. goto sloop;
  529. }
  530. if (respond.compare(two) == 0)
  531. {
  532. goto portroyal;
  533. }
  534. else;
  535. goto sloop;
  536. }
  537.  
  538. sloopwin:
  539. {
  540. system("cls");
  541. sloophp = sloophpmax;
  542. holder1 = 1000;
  543. holder2 = 3000;
  544. holder3 = rand()% (holder2-holder1)+holder1;
  545. doubloons += holder3;
  546. cout << "\n\n you won!\n\n doubloons Scavanged: " << holder3 << "\n\n ";
  547. system("pause");
  548. goto portroyal;
  549. }
  550. carvel:
  551. {
  552. system("cls");
  553. cout << "\n\n Carvel's Current State: Attack: " << carvelatk1 << "-" << carvelatk2 << ", HP: " << carvelhp << "/" << carvelhpmax << "!\n Your Current State: Attack: " << shipatk1 << "-" << shipatk2 << ", HP: " << shiphp << "/" << shiphpmax << "!\n\n\n";
  554. cout << " (1) Attack\n\n (2) Run!\n\n ";
  555. if (shiphp <= 0)
  556. {
  557. goto sink;
  558. }
  559. if (carvelhp <= 0)
  560. {
  561. goto carvelwin;
  562. }
  563. cin >> respond;
  564. if (respond.compare(one) == 0)
  565. {
  566. system("cls");
  567. holder1 = rand()% (cb2-cb1)+cb1;
  568. holder2 = rand()% (shipatk1-shipatk2)+shipatk1;
  569. holder3 = rand()% (carvelcb2-carvelcb1)+carvelcb1;
  570. holder4 = rand()% (carvelatk2-carvelatk1)+carvelatk1;
  571. holder6 = holder4 * holder3;
  572. holder5 = holder2 * holder1;
  573. carvelhp -= holder5;
  574. shiphp -= holder6;
  575. cout << "\n\n You hit " << holder1 << " times at " << holder2 << " damage each for a total of " << holder5 << "\n\n";
  576. cout << " The Carvel hit " << holder3 << " times at " << holder4 << " damage each for a total of " << holder6 << "\n\n\n\n ";
  577. cout << " "; system("pause");
  578. goto carvel;
  579. }
  580. if (respond.compare(two) == 0)
  581. {
  582. goto portroyal;
  583. }
  584. else;
  585. goto carvel;
  586. }
  587. carvelwin:
  588. {
  589. system("cls");
  590. carvelhp = carvelhpmax;
  591. holder1 = 2000;
  592. holder2 = 4000;
  593. holder3 = rand()% (holder2-holder1)+holder1;
  594. doubloons += holder3;
  595. cout << "\n\n you won!\n\n doubloons Scavanged: " << holder3 << "\n\n ";
  596. system("pause");
  597. goto locations;
  598. }
  599.  
  600. ts:
  601. {
  602. system("cls");
  603. cout << "\n\n Treasure Ship's Current State: Attack: " << tsatk1 << "-" << tsatk2 << ", HP: " << tshp << "/" << tshpmax << "!\n Your Current State: Attack: " << shipatk1 << "-" << shipatk2 << ", HP: " << shiphp << "/" << shiphpmax << "!\n\n\n";
  604. cout << " (1) Attack\n\n (2) Run!\n\n ";
  605. if (shiphp <= 0)
  606. {
  607. goto sink;
  608. }
  609. if (tshp <= 0)
  610. {
  611. goto tswin;
  612. }
  613. cin >> respond;
  614. if (respond.compare(one) == 0)
  615. {
  616. system("cls");
  617. holder1 = rand()% (cb2-cb1)+cb1;
  618. holder2 = rand()% (shipatk1-shipatk2)+shipatk1;
  619. holder3 = rand()% (tscb2-tscb1)+tscb1;
  620. holder4 = rand()% (tsatk2-tsatk1)+tsatk1;
  621. holder6 = holder4 * holder3;
  622. holder5 = holder2 * holder1;
  623. tshp -= holder5;
  624. shiphp -= holder6;
  625. cout << "\n\n You hit " << holder1 << " times at " << holder2 << " damage each for a total of " << holder5 << "\n\n";
  626. cout << " The Treasure Ship hit " << holder3 << " times at " << holder4 << " damage each for a total of " << holder6 << "\n\n\n\n ";
  627. cout << " "; system("pause");
  628. goto ts;
  629. }
  630. if (respond.compare(two) == 0)
  631. {
  632. goto portroyal;
  633. }
  634. else;
  635. goto sloop;
  636. }
  637.  
  638. tswin:
  639. {
  640. system("cls");
  641. tshp = tshpmax;
  642. cout << "\n\n you won!\n\n ";
  643. system("pause");
  644. goto portroyal;
  645. }
  646.  
  647. buccaneer:
  648. {
  649. system("cls");
  650. cout << "\n\n Buccaneer's Current State: Attack: " << bucatk1 << "-" << bucatk2 << ", HP: " << buchp << "/" << buchpmax << "!\n\n Your Current State: Attack: " << atk1 << "-" << atk2 << ", HP: " << hp << "/" << hpmax << "!\n\n\n";
  651. cout << " (1) Attack!\n\n (2) Run!\n\n ";
  652. if (buchp <= 0)
  653. {
  654. goto buccaneerwin;
  655. }
  656. if (hp <= 0)
  657. {
  658. goto death;
  659. }
  660. cin >> respond;
  661. if (respond.compare(one) == 0)
  662. {
  663. holder1 = rand()% (atk2-atk1)+atk1;
  664. holder2 = rand()% (bucatk2-bucatk1)+bucatk1;
  665. buchp -= holder1;
  666. hp -= holder2;
  667. goto buccaneer;
  668. }
  669. if (respond.compare(two) == 0)
  670. {
  671. goto locations;
  672. }
  673. }
  674. buccaneerwin:
  675. {
  676. system("cls");
  677. cout << "\n\n You Killed A Buccaneer!\n\n You loot 73 doubloons off his body\n\n (1) Go Back To Town\n\n (2) Keep Exploring\n\n ";
  678. doubloons += 73;
  679. cin >> respond;
  680. if (respond.compare(one) == 0)
  681. {
  682. goto locations;
  683. }
  684. if (respond.compare(two) == 0)
  685. {
  686. goto exploreland;
  687. }
  688. }
  689.  
  690. cutthroat:
  691. {
  692. system("cls");
  693. cout << "\n\n Cut Throat's Current State: Attack: " << cutatk1 << "-" << cutatk2 << ", HP: " << cuthp << "/" << cuthpmax << "!\n\n Your Current State: Attack: " << atk1 << "-" << atk2 << ", HP: " << hp << "/" << hpmax << "!\n\n\n";
  694. cout << " (1) Attack!\n\n (2) Run!\n\n ";
  695. if (cuthp <= 0)
  696. {
  697. goto cutthroatwin;
  698. }
  699. if (hp <= 0)
  700. {
  701. goto death;
  702. }
  703. cin >> respond;
  704. if (respond.compare(one) == 0)
  705. {
  706. holder1 = rand()% (atk2-atk1)+atk1;
  707. holder2 = rand()% (cutatk2-cutatk1)+cutatk1;
  708. cuthp -= holder1;
  709. hp -= holder2;
  710. goto cutthroat;
  711. }
  712. if (respond.compare(two) == 0)
  713. {
  714. goto locations;
  715. }
  716. }
  717. cutthroatwin:
  718. {
  719. system("cls");
  720. cout << "\n\n You Killed A Cut Throat!\n\n You loot 95 doubloons off his body\n\n (1) Go Back To Town\n\n (2) Keep Exploring\n\n ";
  721. doubloons += 95;
  722. cin >> respond;
  723. if (respond.compare(one) == 0)
  724. {
  725. goto locations;
  726. }
  727. if (respond.compare(two) == 0)
  728. {
  729. goto exploreland;
  730. }
  731. }
  732.  
  733. wreckedship:
  734. {
  735. system("cls");
  736. random = rand()% 19+1;
  737. if (random <= 5)
  738. {
  739. holder1 = 500;
  740. holder2 = 3000;
  741. holder3 = rand()% (holder2-holder1)+holder1;
  742. cout << "\n\n " << name << " Finds A Map To Buried Treasure\n\n " << name << " Follows The Map And Finds " << holder3 << "\n\n ";
  743. doubloons += holder3;
  744. system("pause");
  745. goto portroyal;
  746. }
  747. if (random >= 5)
  748. {
  749. cout << "\n\n The Ship Was Empty And " << name << " Sails Back To Town\n\n ";
  750. system("pause");
  751. goto locations;
  752. }
  753. }
  754.  
  755. death:
  756. {
  757. system("cls");
  758. cout << "\n\n You Have Died!\n\n ";
  759. buchp = buchpmax;
  760. cuthp = cuthpmax;
  761. system("pause");
  762. goto locations;
  763. }
  764.  
  765. sink:
  766. {
  767. system("cls");
  768. sloophp = sloophpmax;
  769. tshp = tshpmax;
  770. cout << "\n\n You sunk.\n\n ";
  771. shiphp = 0;
  772. system("pause");
  773. goto portroyal;
  774. }
  775. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement