Advertisement
Guest User

Paste

a guest
Jul 23rd, 2012
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 30.73 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdlib.h>
  3. #include <windows.h>
  4. #include <cstdlib>
  5. #include <fstream>
  6. #include <string>
  7. #include <MMSystem.h>
  8.  
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13.  
  14. system("color 0F");
  15.  
  16. string name, clas, respond, one, two, three, four, five, six, seven;
  17. string eight, nine, zero, race, playerchance, enemychance;
  18. int hp, hpmax, mana, manamax, exp, expmax, points, level, gold, place, defense2;
  19. int strength, intellect, vitality, defense1, damage1, damage2, dexterity;
  20. int holder1, holder2, holder3, holder4, holder5, holder6, holder7, holder8, holder9, holder10;
  21. int spellcost, magic1, magic2, healcost, heal1, heal2;
  22. int guard1hp, guard1hpmax, guard1d1, guard1d2, guard1a1, guard1a2;
  23. int gb1hp, gb1hpmax, gb1d1, gb1d2, gb1a1, gb1a2, human;
  24. gb1hp = 300, gb1hpmax = 300, gb1d1 = 15, gb1d2 = 21, gb1a1 = 0, gb1a2 = 4;
  25. guard1hp = 125, guard1hpmax = 125, guard1d1 = 12, guard1d2 = 15, guard1a1 = 0, guard1a2 = 2;
  26. hp = 0, hpmax = 0, mana = 0, manamax = 0, exp = 0, expmax = 1000;
  27. points = 0, level = 1, gold = 0, strength = 0, intellect = 0, dexterity = 0;
  28. vitality = 0, damage1 = 0, damage2 = 0, one = "1", two = "2";
  29. three = "3", four = "4", five = "5", six = "6", seven = "7", eight = "8";
  30. nine = "9", zero = "0", place = 1, defense1 = 0, defense2 = 0, spellcost = 30;
  31. magic1 = 0, magic2 = 0, healcost = 60, heal1 = 0, heal2 = 0;
  32. playerchance = "", enemychance = "", human = 0;
  33.  
  34. /*
  35. Stats that need saving:
  36. hp, hpmax, mana, manamax, exp, expmax, points, level,
  37. gold, strength, intellect, dexterity, vitality, damage1,
  38. damage2, place, defense1, defense2, spellcost, magic1,
  39. magic2, healcost, heal1, heal2, human.
  40. */
  41.  
  42. Beginning:
  43. {
  44. system("cls");
  45. cout << "        |------------|\n";
  46. cout << "        |Slasher Menu|\n";
  47. cout << "        |------------|\n\n";
  48. cout << "Welcome to Slasher, Player!\n\n";
  49. cout << "To play, type the number in the brackets and hit ENTER.\n\n";
  50. cout << "(0) Exit Game\n";
  51. cout << "(1) New Game\n";
  52. cout << "(2) Load Game\n\n";
  53. cin >> respond;
  54. if (respond.compare(zero) == 0)
  55.  {
  56.  goto EGB;
  57.  }
  58. if (respond.compare(one) == 0)
  59.  {
  60.  goto NewGame;
  61.  }
  62. if (respond.compare(two) == 0)
  63.  {
  64.  goto LoadGame;
  65.  }
  66. else
  67. goto Beginning;
  68. }
  69.  
  70. EGB:
  71. {
  72. system("cls");
  73. cout << "        |---------|\n";
  74. cout << "        |Exit Game|\n";
  75. cout << "        |---------|\n\n";
  76. cout << "Are you sure you wish to exit?\n\n";
  77. cout << "(0) Leave\n";
  78. cout << "(1) Exit Game\n\n";
  79. cin >> respond;
  80. if (respond.compare(zero) == 0)
  81.  {
  82.  goto Beginning;
  83.  }
  84. if (respond.compare(one) == 0)
  85.  {
  86.  return 0;
  87.  }
  88. else
  89. goto EGB;
  90. }
  91.  
  92. LoadGame:
  93. {
  94. system("cls");
  95. cout << "        |---------|\n";
  96. cout << "        |Load Game|\n";
  97. cout << "        |---------|\n\n";
  98. cout << "Feature not yet added.\n\n";
  99. system("pause");
  100. goto Beginning;
  101. }
  102.  
  103. NewGame:
  104. {
  105. system("cls");
  106. cout << "        |-----------|\n";
  107. cout << "        |Name Choose|\n";
  108. cout << "        |-----------|\n\n";
  109. cout << "Welcome there, Player, to Slasher.\n\n";
  110. cout << "For future reference, what is your name?\n\n";
  111. cout << "Name: ";
  112. cin >> name;
  113. goto RaceChoose;
  114. }
  115.  
  116. RaceChoose:
  117. {
  118. system("cls");
  119. cout << "        |-----------|\n";
  120. cout << "        |Race Choose|\n";
  121. cout << "        |-----------|\n\n";
  122. cout << "Hello there, " << name << ", please choose a Race.\n\n";
  123. cout << "Statistic Attributes:\n";
  124. cout << "Vitality gives Health.\n";
  125. cout << "Strength gives Damage.\n";
  126. cout << "Intellect gives Mana, Magic Damage and Healing.\n";
  127. cout << "Dexterity gives Defense.\n\n";
  128. cout << "(1) Human [+1 Vitality, +3 Strength, +1 Intellect, +1 Dexterity]\n";
  129. cout << "(2) Gnome [+2 Vitality, +1 Strength, +1 Intellect, +2 Dexterity]\n";
  130. cout << "(3) Dwarf [+2 Vitality, +2 Strength, +1 Intellect, +1 Dexterity]\n";
  131. cout << "(4) Elf [+1 Vitality, +1 Strength, +3 Intellect, +1 Dexterity]\n";
  132. cout << "(5) Troll [+2 Vitality, +1 Strength, +2 Intellect, +1 Dexterity]\n";
  133. cout << "(6) Orc [+1 Vitality, +1 Strength, +1 Intellect, +3 Dexterity]\n\n";
  134. cin >> respond;
  135. if (respond.compare(one) == 0)
  136.  {
  137.  race = "Human";
  138.  hpmax += 6;
  139.  hp += 6;
  140.  mana += 6;
  141.  manamax += 6;
  142.  strength += 3;
  143.  vitality += 1;
  144.  dexterity += 1;
  145.  intellect += 1;
  146.  damage1 += 3;
  147.  damage2 += 3;
  148.  magic1 += 1;
  149.  magic2 += 1;
  150.  heal1 += 2;
  151.  heal2 += 2;
  152.  defense1 += 1;
  153.  defense2 += 1;
  154.  goto ClassChoose;
  155.  }
  156. if (respond.compare(two) == 0)
  157.  {
  158.  race = "Gnome";
  159.  hpmax += 12;
  160.  hp += 12;
  161.  mana += 6;
  162.  manamax += 6;
  163.  strength += 1;
  164.  vitality += 2;
  165.  dexterity += 2;
  166.  intellect += 1;
  167.  damage1 += 1;
  168.  damage2 += 1;
  169.  magic1 += 1;
  170.  magic2 += 1;
  171.  heal1 += 2;
  172.  heal2 += 2;
  173.  defense1 += 2;
  174.  defense2 += 2;
  175.  goto ClassChoose;
  176.  }
  177. if (respond.compare(three) == 0)
  178.  {
  179.  race = "Dwarf";
  180.  hpmax += 12;
  181.  hp += 12;
  182.  mana += 6;
  183.  manamax += 6;
  184.  strength += 2;
  185.  vitality += 2;
  186.  dexterity += 1;
  187.  intellect += 1;
  188.  damage1 += 2;
  189.  damage2 += 2;
  190.  magic1 += 1;
  191.  magic2 += 1;
  192.  heal1 += 2;
  193.  heal2 += 2;
  194.  defense1 += 1;
  195.  defense2 += 1;
  196.  goto ClassChoose;
  197.  }
  198. if (respond.compare(four) == 0)
  199.  {
  200.  race = "Elf";
  201.  hpmax += 6;
  202.  hp += 6;
  203.  mana += 18;
  204.  manamax += 18;
  205.  strength += 1;
  206.  vitality += 1;
  207.  dexterity += 1;
  208.  intellect += 3;
  209.  damage1 += 1;
  210.  damage2 += 1;
  211.  magic1 += 3;
  212.  magic2 += 3;
  213.  heal1 += 6;
  214.  heal2 += 6;
  215.  defense1 += 1;
  216.  defense2 += 1;
  217.  goto ClassChoose;
  218.  }
  219. if (respond.compare(five) == 0)
  220.  {
  221.  race = "Troll";
  222.  hpmax += 12;
  223.  hp += 12;
  224.  mana += 12;
  225.  manamax += 12;
  226.  strength += 1;
  227.  vitality += 2;
  228.  dexterity += 1;
  229.  intellect += 2;
  230.  damage1 += 1;
  231.  damage2 += 1;
  232.  magic1 += 2;
  233.  magic2 += 2;
  234.  heal1 += 4;
  235.  heal2 += 4;
  236.  defense1 += 1;
  237.  defense2 += 1;
  238.  goto ClassChoose;
  239.  }
  240. if (respond.compare(six) == 0)
  241.  {
  242.  race = "Orc";
  243.  hpmax += 6;
  244.  hp += 6;
  245.  mana += 6;
  246.  manamax += 6;
  247.  strength += 1;
  248.  vitality += 1;
  249.  dexterity += 3;
  250.  intellect += 1;
  251.  damage1 += 1;
  252.  damage2 += 1;
  253.  magic1 += 1;
  254.  magic2 += 1;
  255.  heal1 += 1;
  256.  heal2 += 1;
  257.  defense1 += 3;
  258.  defense2 += 3;
  259.  goto ClassChoose;
  260.  }
  261. else
  262. goto RaceChoose;
  263. }
  264.  
  265. ClassChoose:
  266. {
  267. system("cls");
  268. cout << "        |------------|\n";
  269. cout << "        |Class Choose|\n";
  270. cout << "        |------------|\n\n";
  271. cout << "Now then, " << name << " the " << race << ", please choose a Class.\n\n";
  272. cout << "(1) Warrior [Uses mainly Strength and Vitality]\n";
  273. cout << "(2) Archer [Uses Vitality and some Strength and Dexterity]\n";
  274. cout << "(3) Mage [Uses mostly Intellect and some Vitality]\n\n";
  275. cin >> respond;
  276. if (respond.compare(one) == 0)
  277.  {
  278.  clas = "Warrior";
  279.  hpmax += 375;
  280.  hp += 375;
  281.  mana += 175;
  282.  manamax += 175;
  283.  strength += 6;
  284.  vitality += 6;
  285.  dexterity += 3;
  286.  intellect += 3;
  287.  damage1 += 9;
  288.  damage2 += 12;
  289.  magic1 += 7;
  290.  magic2 += 11;
  291.  heal1 += 10;
  292.  heal2 += 30;
  293.  defense1 += 0;
  294.  defense2 += 2;
  295.  goto Continue1;
  296.  }
  297. if (respond.compare(two) == 0)
  298.  {
  299.  clas = "Archer";
  300.  hpmax += 360;
  301.  hp += 360;
  302.  mana += 200;
  303.  manamax += 200;
  304.  strength += 5;
  305.  vitality += 5;
  306.  dexterity += 4;
  307.  intellect += 4;
  308.  damage1 += 8;
  309.  damage2 += 13;
  310.  magic1 += 9;
  311.  magic2 += 12;
  312.  heal1 += 12;
  313.  heal2 += 33;
  314.  defense1 += 0;
  315.  defense2 += 1;
  316.  goto Continue1;
  317.  }
  318. if (respond.compare(three) == 0)
  319.  {
  320.  clas = "Mage";
  321.  hpmax += 345;
  322.  hp += 345;
  323.  mana += 250;
  324.  manamax += 250;
  325.  strength += 4;
  326.  vitality += 4;
  327.  dexterity += 3;
  328.  intellect += 3;
  329.  damage1 += 9;
  330.  damage2 += 11;
  331.  magic1 += 10;
  332.  magic2 += 14;
  333.  heal1 += 13;
  334.  heal2 += 35;
  335.  defense1 += 0;
  336.  defense2 += 0;
  337.  goto Continue1;
  338.  }
  339. else
  340. goto ClassChoose;
  341. }
  342.  
  343. PlayerDead:
  344. {
  345. system("cls");
  346. cout << "        |------------------|\n";
  347. cout << "        |Death Comes To All|\n";
  348. cout << "        |------------------|\n\n";
  349. cout << "You have died during your epic battle against Evil, " << name << ".\n\n";
  350. cout << "The game will now load from your last saved progress...\n\n";
  351. system("pause");
  352. goto LoadGame;
  353. }
  354.  
  355. Continue1:
  356. {
  357. system("cls");
  358. cout << "        |-----------------|\n";
  359. cout << "        |Character Created|\n";
  360. cout << "        |-----------------|\n\n";
  361. cout << "Name: " << name << "\n";
  362. cout << "Race: " << race << "\n";
  363. cout << "Class: " << clas << "\n";
  364. cout << "Gold: " << gold << "\n";
  365. cout << "Level: " << level << "\n";
  366. cout << "Place: " << place << "\n";
  367. cout << "Experience: " << exp << "/" << expmax << "\n";
  368. cout << "Skill Points: " << points << "\n";
  369. cout << "Health: " << hp << "/" << hpmax << "\n";
  370. cout << "Mana: " << mana << "/" << manamax << "\n";
  371. cout << "Damage: " << damage1 << "-" << damage2 << "\n";
  372. cout << "Magic Damage: " << magic1 << "-" << magic2 << "\n";
  373. cout << "Magic Heal: " << heal1 << "-" << heal2 << "\n";
  374. cout << "Defense: " << defense1 << "-" << defense2 << "\n";
  375. cout << "Strength: " << strength << "\n";
  376. cout << "Intellect: " << intellect << "\n";
  377. cout << "Vitality: " << vitality << "\n";
  378. cout << "Dexterity: " << dexterity << "\n\n";
  379. system("pause");
  380. system("cls");
  381. cout << "        |-----------------|\n";
  382. cout << "        |Character Created|\n";
  383. cout << "        |-----------------|\n\n";
  384. cout << "You may now play the game!\n\n";
  385. cout << "Heading to Place 1, Main Menu.\n\n";
  386. system("pause");
  387. human = 1;
  388. goto Place1Menu;
  389. }
  390.  
  391. Place1Menu:
  392. {
  393. system("cls");
  394. cout << "        |------------------|\n";
  395. cout << "        |Place 1, Main Menu|\n";
  396. cout << "        |------------------|\n\n";
  397. cout << "(0) Exit Game\n";
  398. cout << "(1) Save Game\n\n";
  399. cout << "(2) View Statistics\n";
  400. cout << "(3) Skill Points\n";
  401. cout << "(4) Inventory\n\n";
  402. cout << "(5) Explore\n";
  403. cout << "(6) Sleep\n\n";
  404. cin >> respond;
  405. if (respond.compare(zero) == 0)
  406.  {
  407.  goto ExitGame1;
  408.  }
  409. if (respond.compare(one) == 0)
  410.  {
  411.  goto SaveGame1;
  412.  }
  413. if (respond.compare(two) == 0)
  414.  {
  415.  goto Stats1;
  416.  }
  417. if (respond.compare(three) == 0)
  418.  {
  419.  goto Skills1;
  420.  }
  421. if (respond.compare(four) == 0)
  422.  {
  423.  goto Inventory1;
  424.  }
  425. if (respond.compare(five) == 0)
  426.  {
  427.  goto Explore1;
  428.  }
  429. if (respond.compare(six) == 0)
  430.  {
  431.  goto Sleep1;
  432.  }
  433. else
  434. goto Place1Menu;
  435. }
  436.  
  437. Sleep1:
  438. {
  439. system("cls");
  440. cout << "        |-----|\n";
  441. cout << "        |Sleep|\n";
  442. cout << "        |-----|\n\n";
  443. cout << "Here you may sleep and restore your health and mana.\n\n";
  444. cout << "Health: " << hp << "/" << hpmax << "\n";
  445. cout << "Mana: " << mana << "/" << manamax << "\n\n";
  446. cout << "(0) Leave\n";
  447. cout << "(1) Sleep\n\n";
  448. cin >> respond;
  449. if (respond.compare(zero) == 0)
  450.  {
  451.  goto Place1Menu;
  452.  }
  453. if (respond.compare(one) == 0)
  454.  {
  455.  system("cls");
  456.  hp = hpmax;
  457.  mana = manamax;
  458.  cout << "        |-----|\n";
  459.  cout << "        |Slept|\n";
  460.  cout << "        |-----|\n\n";
  461.  cout << "You have slept and regained your health and mana.\n\n";
  462.  system("pause");
  463.  goto Place1Menu;
  464.  }
  465. else
  466. goto Sleep1;
  467. }
  468.  
  469. Explore1:
  470. {
  471. system("cls");
  472. cout << "        |-------|\n";
  473. cout << "        |Explore|\n";
  474. cout << "        |-------|\n\n";
  475. cout << "While exploring you find something...\n\n";
  476. system("pause");
  477. holder1 = rand()% 10 + 1;
  478. if (holder1 == 1)
  479.  {
  480.  goto ExploreGuardBoss1Find;
  481.  }
  482. else
  483. goto ExploreGuard1Find;
  484. }
  485.  
  486. ExitGame1:
  487. {
  488. system("cls");
  489. cout << "        |---------|\n";
  490. cout << "        |Exit Game|\n";
  491. cout << "        |---------|\n\n";
  492. cout << "Are you sure you wish to exit?\n\n";
  493. cout << "(0) Leave\n";
  494. cout << "(1) Exit Game\n\n";
  495. cin >> respond;
  496. if (respond.compare(zero) == 0)
  497.  {
  498.  goto ExitGame1;
  499.  }
  500. if (respond.compare(one) == 0)
  501.  {
  502.  return 0;
  503.  }
  504. else
  505. goto ExitGame1;
  506. }
  507.  
  508. SaveGame1:
  509. {
  510. system("cls");
  511. cout << "        |---------|\n";
  512. cout << "        |Save Game|\n";
  513. cout << "        |---------|\n\n";
  514. cout << "Feature not yet added.\n\n";
  515. system("pause");
  516. goto Place1Menu;
  517. }
  518.  
  519. Stats1:
  520. {
  521. system("cls");
  522. cout << "        |----------|\n";
  523. cout << "        |Statistics|\n";
  524. cout << "        |----------|\n\n";
  525. cout << "Name: " << name << "\n";
  526. cout << "Race: " << race << "\n";
  527. cout << "Class: " << clas << "\n";
  528. cout << "Gold: " << gold << "\n";
  529. cout << "Level: " << level << "\n";
  530. cout << "Place: " << place << "\n";
  531. cout << "Experience: " << exp << "/" << expmax << "\n";
  532. cout << "Skill Points: " << points << "\n";
  533. cout << "Health: " << hp << "/" << hpmax << "\n";
  534. cout << "Mana: " << mana << "/" << manamax << "\n";
  535. cout << "Damage: " << damage1 << "-" << damage2 << "\n";
  536. cout << "Magic Damage: " << magic1 << "-" << magic2 << "\n";
  537. cout << "Magic Heal: " << heal1 << "-" << heal2 << "\n";
  538. cout << "Defense: " << defense1 << "-" << defense2 << "\n";
  539. cout << "Strength: " << strength << "\n";
  540. cout << "Intellect: " << intellect << "\n";
  541. cout << "Vitality: " << vitality << "\n";
  542. cout << "Dexterity: " << dexterity << "\n\n";
  543. system("pause");
  544. goto Place1Menu;
  545. }
  546.  
  547. Skills1:
  548. {
  549. system("cls");
  550. cout << "        |------------|\n";
  551. cout << "        |Skill Points|\n";
  552. cout << "        |------------|\n\n";
  553. cout << "Skill Points: " << points << "\n\n";
  554. cout << "Statistic Attributes:\n";
  555. cout << "Vitality gives Health.\n";
  556. cout << "Strength gives Damage.\n";
  557. cout << "Intellect gives Mana, Magic Damage and Healing.\n";
  558. cout << "Dexterity gives Defense.\n\n";
  559. cout << "(0) Leave\n";
  560. cout << "(1) Vitality (" << vitality << ")\n";
  561. cout << "(2) Strength (" << strength << ")\n";
  562. cout << "(3) Intellect (" << intellect << ")\n";
  563. cout << "(4) Dexterity (" << dexterity << ")\n\n";
  564. cin >> respond;
  565. if (respond.compare(zero) == 0)
  566.  {
  567.  goto Place1Menu;
  568.  }
  569. if (respond.compare(one) == 0 && points >= 1)
  570.  {
  571.  points -= 1;
  572.  vitality += 1;
  573.  hp += 6;
  574.  hpmax += 6;
  575.  goto Skills1;
  576.  }
  577. if (respond.compare(two) == 0 && points >= 1)
  578.  {
  579.  points -= 1;
  580.  strength += 1;
  581.  damage1 += 1;
  582.  damage2 += 1;
  583.  goto Skills1;
  584.  }
  585. if (respond.compare(three) == 0 && points >= 1)
  586.  {
  587.  points -= 1;
  588.  intellect += 1;
  589.  mana += 6;
  590.  manamax += 6;
  591.  magic1 += 1;
  592.  magic2 += 1;
  593.  heal1 += 2;
  594.  heal2 += 2;
  595.  healcost += 1;
  596.  spellcost += 1;
  597.  goto Skills1;
  598.  }
  599. if (respond.compare(four) == 0 && points >= 1)
  600.  {
  601.  points -= 1;
  602.  dexterity += 1;
  603.  defense1 += 1;
  604.  defense2 += 1;
  605.  goto Skills1;
  606.  }
  607. else
  608. goto Skills1;
  609. }
  610.  
  611. Inventory1:
  612. {
  613. system("cls");
  614. cout << "        |---------|\n";
  615. cout << "        |Inventory|\n";
  616. cout << "        |---------|\n\n";
  617. cout << "(0) Leave\n";
  618. cin >> respond;
  619. if (respond.compare(zero) == 0)
  620.  {
  621.  goto Place1Menu;
  622.  }
  623. else
  624. goto Inventory1;
  625. }
  626.  
  627. ExploreGuardBoss1Find:
  628. {
  629. system("cls");
  630. cout << "        |----------------|\n";
  631. cout << "        |Enemy Guard Boss|\n";
  632. cout << "        |----------------|\n\n";
  633. cout << "You encounter an Enemy Guard Boss!\n\n";
  634. cout << "Enemy Guard Boss:\n";
  635. cout << "Health: " << gb1hp << "/" << gb1hpmax << "\n";
  636. cout << "Damage: " << gb1d1 << "-" << gb1d2 << "\n";
  637. cout << "Defense: " << gb1a1 << "-" << gb1a2 << "\n\n";
  638. cout << name << ", the " << race << " " << clas << ":\n";
  639. cout << "Health: " << hp << "/" << hpmax << "\n";
  640. cout << "Mana: " << mana << "/" << manamax << "\n";
  641. cout << "Damage: " << damage1 << "-" << damage2 << "\n";
  642. cout << "Magic Damage: " << magic1 << "-" << magic2 << "\n";
  643. cout << "Magic Heal: " << heal1 << "-" << heal2 << "\n";
  644. cout << "Defense: " << defense1 << "-" << defense2 << "\n\n";
  645. cout << "(0) Run Away\n";
  646. cout << "(1) Engage Combat\n\n";
  647. cin >> respond;
  648. if (respond.compare(zero) == 0)
  649.  {
  650.  gb1hp = gb1hpmax;
  651.  goto Place1Menu;
  652.  }
  653. if (respond.compare(one) == 0)
  654.  {
  655.  goto ExploreGuardBoss1Engage;
  656.  }
  657. else
  658. goto ExploreGuardBoss1Find;
  659. }
  660.  
  661. ExploreGuardBoss1Engage:
  662. {
  663. system("cls");
  664. cout << "        |----------------|\n";
  665. cout << "        |Enemy Guard Boss|\n";
  666. cout << "        |----------------|\n\n";
  667. cout << "Enemy Guard Boss:\n";
  668. cout << "Health: " << gb1hp << "/" << gb1hpmax << "\n";
  669. cout << "Damage: " << gb1d1 << "-" << gb1d2 << "\n";
  670. cout << "Defense: " << gb1a1 << "-" << gb1a2 << "\n\n";
  671. cout << name << ", the " << race << " " << clas << ":\n";
  672. cout << "Health: " << hp << "/" << hpmax << "\n";
  673. cout << "Mana: " << mana << "/" << manamax << "\n";
  674. cout << "Damage: " << damage1 << "-" << damage2 << "\n";
  675. cout << "Magic Damage: " << magic1 << "-" << magic2 << "\n";
  676. cout << "Magic Heal: " << heal1 << "-" << heal2 << "\n";
  677. cout << "Defense: " << defense1 << "-" << defense2 << "\n\n";
  678. cout << "(0) Run Away\n";
  679. cout << "(1) Attack (Melee)\n";
  680. cout << "(2) Attack (Magic [" << spellcost << " Mana])\n";
  681. cout << "(3) Heal (Magic [" << healcost << " Mana])\n\n";
  682. cin >> respond;
  683. if (respond.compare(zero) == 0)
  684.  {
  685.  gb1hp = gb1hpmax;
  686.  goto Place1Menu;
  687.  }
  688. if (respond.compare(one) == 0)
  689.  {
  690.  system("cls");
  691.  holder7 = rand() % 15 + 1; //player crit
  692.  holder8 = rand() % 15 + 1; //player miss
  693.  holder9 = rand() % 15 + 1; //enemy crit
  694.  holder10 = rand() % 15 + 1; //enemy miss
  695.  holder1 = rand() % (damage2 - damage1) + damage1; //player damage
  696.  holder2 = rand() % (defense2 - defense1) + defense1; //player defense
  697.  holder3 = rand() % (gb1d2 - gb1d1) + gb1d1; //enemy damage
  698.  holder4 = rand() % (gb1a2 - gb1a1) + gb1a1; //enemy defense
  699.  holder5 = holder1 - holder4; //player damage
  700.  holder6 = holder3 - holder2; //enemy damage
  701.  if (holder6 <= 0)
  702.   {
  703.   holder6 = 0;
  704.   }
  705.  if (holder7 == 5)
  706.   {
  707.   holder5 *= 2;
  708.   playerchance = "Critical!";
  709.   }
  710.  if (holder8 == 5)
  711.   {
  712.   holder5 = 0;
  713.   playerchance = "Miss!";
  714.   }
  715.  if (holder9 == 5)
  716.   {
  717.   holder6 *= 2;
  718.   enemychance = "Critical!";
  719.   }
  720.  if (holder10 == 5)
  721.   {
  722.   holder6 = 0;
  723.   enemychance = "Miss!";
  724.   }
  725.  hp -= holder6;
  726.  gb1hp -= holder5;
  727.  cout << "        |----------------|\n";
  728.  cout << "        |Enemy Guard Boss|\n";
  729.  cout << "        |----------------|\n\n";
  730.  cout << name << " hit the Guard Boss for " << holder5 << " damage! " << playerchance << "\n\n";
  731.  cout << "The Guard Boss hit " << name << " for " << holder6 << " damage! " << enemychance << "\n\n";
  732.  system("pause");
  733.  playerchance = "";
  734.  enemychance = "";
  735.  if (hp <= 0)
  736.   {
  737.   gb1hp = gb1hpmax;
  738.   goto PlayerDead;
  739.   }
  740.  if (gb1hp <= 0)
  741.   {
  742.   gb1hp = gb1hpmax;
  743.   goto ExploreGuardBoss1Dead;
  744.   }
  745.  else
  746.  goto ExploreGuardBoss1Engage;
  747.  }
  748. if (respond.compare(two) == 0 && mana >= spellcost)
  749.  {
  750.  system("cls");
  751.  mana -= spellcost;
  752.  holder7 = rand() % 15 + 1; //player crit
  753.  holder8 = rand() % 15 + 1; //player miss
  754.  holder9 = rand() % 15 + 1; //enemy crit
  755.  holder10 = rand() % 15 + 1; //enemy miss
  756.  holder1 = rand() % (magic2 - magic1) + magic1; //player damage
  757.  holder2 = rand() % (defense2 - defense1) + defense1; //player defense
  758.  holder3 = rand() % (gb1d2 - gb1d1) + gb1d1; //enemy damage
  759.  holder4 = rand() % (gb1a2 - gb1a1) + gb1a1; //enemy defense
  760.  holder5 = holder1 - holder4; //player damage
  761.  holder6 = holder3 - holder2; //enemy damage
  762.  if (holder6 <= 0)
  763.   {
  764.   holder6 = 0;
  765.   }
  766.  if (holder7 == 5)
  767.   {
  768.   holder5 *= 2;
  769.   playerchance = "Critical!";
  770.   }
  771.  if (holder8 == 5)
  772.   {
  773.   holder5 = 0;
  774.   playerchance = "Miss!";
  775.   }
  776.  if (holder9 == 5)
  777.   {
  778.   holder6 *= 2;
  779.   enemychance = "Critical!";
  780.   }
  781.  if (holder10 == 5)
  782.   {
  783.   holder6 = 0;
  784.   enemychance = "Miss!";
  785.   }
  786.  hp -= holder6;
  787.  gb1hp -= holder5;
  788.  cout << "        |----------------|\n";
  789.  cout << "        |Enemy Guard Boss|\n";
  790.  cout << "        |----------------|\n\n";
  791.  cout << name << "'s spell hit the Guard Boss for " << holder5 << " damage! " << playerchance << "\n\n";
  792.  cout << "The Guard Boss hit " << name << " for " << holder6 << " damage! " << enemychance << "\n\n";
  793.  system("pause");
  794.  playerchance = "";
  795.  enemychance = "";
  796.  if (hp <= 0)
  797.   {
  798.   gb1hp = gb1hpmax;
  799.   goto PlayerDead;
  800.   }
  801.  if (gb1hp <= 0)
  802.   {
  803.   gb1hp = gb1hpmax;
  804.   goto ExploreGuardBoss1Dead;
  805.   }
  806.  else
  807.  goto ExploreGuardBoss1Engage;
  808.  }
  809. if (respond.compare(three) == 0 && mana >= healcost)
  810.  {
  811.  system("cls");
  812.  mana -= healcost;
  813.  holder7 = rand() % 15 + 1; //player crit
  814.  holder9 = rand() % 15 + 1; //enemy crit
  815.  holder10 = rand() % 15 + 1; //enemy miss
  816.  holder1 = rand() % (heal2 - heal1) + heal1; //player heal
  817.  holder2 = rand() % (defense2 - defense1) + defense1; //player defense
  818.  holder3 = rand() % (gb1d2 - gb1d1) + gb1d1; //enemy damage
  819.  holder6 = holder3 - holder2; //enemy damage
  820.  if (holder6 <= 0)
  821.   {
  822.   holder6 = 0;
  823.   }
  824.  if (holder7 == 5)
  825.   {
  826.   holder1 *= 2;
  827.   playerchance = "Critical!";
  828.   }
  829.  if (holder9 == 5)
  830.   {
  831.   holder6 *= 2;
  832.   enemychance = "Critical!";
  833.   }
  834.  if (holder10 == 5)
  835.   {
  836.   holder6 = 0;
  837.   enemychance = "Miss!";
  838.   }
  839.  hp += holder1;
  840.  hp -= holder6;
  841.  cout << "        |----------------|\n";
  842.  cout << "        |Enemy Guard Boss|\n";
  843.  cout << "        |----------------|\n\n";
  844.  cout << name << " healed himself for " << holder1 << " health! " << playerchance << "\n\n";
  845.  cout << "The Guard Boss hit " << name << " for " << holder6 << " damage! " << enemychance << "\n\n";
  846.  system("pause");
  847.  playerchance = "";
  848.  enemychance = "";
  849.  if (hp <= 0)
  850.   {
  851.   gb1hp = gb1hpmax;
  852.   goto PlayerDead;
  853.   }
  854.  if (hp >= hpmax)
  855.   {
  856.   hp = hpmax;
  857.   goto ExploreGuardBoss1Engage;
  858.   }
  859.  else
  860.  goto ExploreGuardBoss1Engage;
  861.  }
  862. else
  863. goto ExploreGuardBoss1Engage;
  864. }
  865.  
  866. ExploreGuardBoss1Dead:
  867. {
  868. system("cls");
  869. holder1 = rand() % 250 + 1; //Experience
  870. holder2 = rand() % 45 + 1; //Gold
  871. gold += holder2;
  872. exp += holder1;
  873. cout << "        |---------------|\n";
  874. cout << "        |Guard Boss Dead|\n";
  875. cout << "        |---------------|\n\n";
  876. cout << "You have killed an Enemy Guard Boss!\n\n";
  877. cout << "You are rewarded with:\n";
  878. cout << holder1 << " Experience\n";
  879. cout << holder2 << " Gold\n\n";
  880. system("pause");
  881. system("cls");
  882. cout << "        |---------------|\n";
  883. cout << "        |Guard Boss Dead|\n";
  884. cout << "        |---------------|\n\n";
  885. cout << "Current Statistics:\n";
  886. cout << "Level: " << level << "\n";
  887. cout << "Gold: " << gold << "\n";
  888. cout << "Experience: " << exp << "/" << expmax << "\n";
  889. cout << "Health: " << hp << "/" << hpmax << "\n";
  890. cout << "Mana: " << mana << "/" << manamax << "\n\n";
  891. system("pause");
  892. if (exp >= expmax)
  893.  {
  894.  goto LevelUp1;
  895.  }
  896. else
  897. goto Place1Menu;
  898. }
  899.  
  900. ExploreGuard1Find:
  901. {
  902. system("cls");
  903. cout << "        |-----------|\n";
  904. cout << "        |Enemy Guard|\n";
  905. cout << "        |-----------|\n\n";
  906. cout << "You encounter an Enemy Guard!\n\n";
  907. cout << "Enemy Guard:\n";
  908. cout << "Health: " << guard1hp << "/" << guard1hpmax << "\n";
  909. cout << "Damage: " << guard1d1 << "-" << guard1d2 << "\n";
  910. cout << "Defense: " << guard1a1 << "-" << guard1a2 << "\n\n";
  911. cout << name << ", the " << race << " " << clas << ":\n";
  912. cout << "Health: " << hp << "/" << hpmax << "\n";
  913. cout << "Mana: " << mana << "/" << manamax << "\n";
  914. cout << "Damage: " << damage1 << "-" << damage2 << "\n";
  915. cout << "Magic Damage: " << magic1 << "-" << magic2 << "\n";
  916. cout << "Magic Heal: " << heal1 << "-" << heal2 << "\n";
  917. cout << "Defense: " << defense1 << "-" << defense2 << "\n\n";
  918. cout << "(0) Run Away\n";
  919. cout << "(1) Engage Combat\n\n";
  920. cin >> respond;
  921. if (respond.compare(zero) == 0)
  922.  {
  923.  guard1hp = guard1hpmax;
  924.  goto Place1Menu;
  925.  }
  926. if (respond.compare(one) == 0)
  927.  {
  928.  goto ExploreGuard1Engage;
  929.  }
  930. else
  931. goto ExploreGuard1Find;
  932. }
  933.  
  934. ExploreGuard1Engage:
  935. {
  936. system("cls");
  937. cout << "        |-----------|\n";
  938. cout << "        |Enemy Guard|\n";
  939. cout << "        |-----------|\n\n";
  940. cout << "Enemy Guard:\n";
  941. cout << "Health: " << guard1hp << "/" << guard1hpmax << "\n";
  942. cout << "Damage: " << guard1d1 << "-" << guard1d2 << "\n";
  943. cout << "Defense: " << guard1a1 << "-" << guard1a2 << "\n\n";
  944. cout << name << ", the " << race << " " << clas << ":\n";
  945. cout << "Health: " << hp << "/" << hpmax << "\n";
  946. cout << "Mana: " << mana << "/" << manamax << "\n";
  947. cout << "Damage: " << damage1 << "-" << damage2 << "\n";
  948. cout << "Magic Damage: " << magic1 << "-" << magic2 << "\n";
  949. cout << "Magic Heal: " << heal1 << "-" << heal2 << "\n";
  950. cout << "Defense: " << defense1 << "-" << defense2 << "\n\n";
  951. cout << "(0) Run Away\n";
  952. cout << "(1) Attack (Melee)\n";
  953. cout << "(2) Attack (Magic [" << spellcost << " Mana])\n";
  954. cout << "(3) Heal (Magic [" << healcost << " Mana])\n\n";
  955. cin >> respond;
  956. if (respond.compare(zero) == 0)
  957.  {
  958.  guard1hp = guard1hpmax;
  959.  goto Place1Menu;
  960.  }
  961. if (respond.compare(one) == 0)
  962.  {
  963.  system("cls");
  964.  holder7 = rand() % 15 + 1; //player crit
  965.  holder8 = rand() % 15 + 1; //player miss
  966.  holder9 = rand() % 15 + 1; //enemy crit
  967.  holder10 = rand() % 15 + 1; //enemy miss
  968.  holder1 = rand() % (damage2 - damage1) + damage1; //player damage
  969.  holder2 = rand() % (defense2 - defense1) + defense1; //player defense
  970.  holder3 = rand() % (guard1d2 - guard1d1) + guard1d1; //enemy damage
  971.  holder4 = rand() % (guard1a2 - guard1a1) + guard1a1; //enemy defense
  972.  holder5 = holder1 - holder4; //player damage
  973.  holder6 = holder3 - holder2; //enemy damage
  974.  if (holder6 <= 0)
  975.   {
  976.   holder6 = 0;
  977.   }
  978.  if (holder7 == 5)
  979.   {
  980.   holder5 *= 2;
  981.   playerchance = "Critical!";
  982.   }
  983.  if (holder8 == 5)
  984.   {
  985.   holder5 = 0;
  986.   playerchance = "Miss!";
  987.   }
  988.  if (holder9 == 5)
  989.   {
  990.   holder6 *= 2;
  991.   enemychance = "Critical!";
  992.   }
  993.  if (holder10 == 5)
  994.   {
  995.   holder6 = 0;
  996.   enemychance = "Miss!";
  997.   }
  998.  hp -= holder6;
  999.  guard1hp -= holder5;
  1000.  cout << "        |-----------|\n";
  1001.  cout << "        |Enemy Guard|\n";
  1002.  cout << "        |-----------|\n\n";
  1003.  cout << name << " hit the Guard for " << holder5 << " damage! " << playerchance << "\n\n";
  1004.  cout << "The Guard hit " << name << " for " << holder6 << " damage! " << enemychance << "\n\n";
  1005.  system("pause");
  1006.  playerchance = "";
  1007.  enemychance = "";
  1008.  if (hp <= 0)
  1009.   {
  1010.   guard1hp = guard1hpmax;
  1011.   goto PlayerDead;
  1012.   }
  1013.  if (guard1hp <= 0)
  1014.   {
  1015.   guard1hp = guard1hpmax;
  1016.   goto ExploreGuard1Dead;
  1017.   }
  1018.  else
  1019.  goto ExploreGuard1Engage;
  1020.  }
  1021. if (respond.compare(two) == 0 && mana >= spellcost)
  1022.  {
  1023.  system("cls");
  1024.  mana -= spellcost;
  1025.  holder7 = rand() % 15 + 1; //player crit
  1026.  holder8 = rand() % 15 + 1; //player miss
  1027.  holder9 = rand() % 15 + 1; //enemy crit
  1028.  holder10 = rand() % 15 + 1; //enemy miss
  1029.  holder1 = rand() % (magic2 - magic1) + magic1; //player damage
  1030.  holder2 = rand() % (defense2 - defense1) + defense1; //player defense
  1031.  holder3 = rand() % (guard1d2 - guard1d1) + guard1d1; //enemy damage
  1032.  holder4 = rand() % (guard1a2 - guard1a1) + guard1a1; //enemy defense
  1033.  holder5 = holder1 - holder4; //player damage
  1034.  holder6 = holder3 - holder2; //enemy damage
  1035.  if (holder6 <= 0)
  1036.   {
  1037.   holder6 = 0;
  1038.   }
  1039.  if (holder7 == 5)
  1040.   {
  1041.   holder5 *= 2;
  1042.   playerchance = "Critical!";
  1043.   }
  1044.  if (holder8 == 5)
  1045.   {
  1046.   holder5 = 0;
  1047.   playerchance = "Miss!";
  1048.   }
  1049.  if (holder9 == 5)
  1050.   {
  1051.   holder6 *= 2;
  1052.   enemychance = "Critical!";
  1053.   }
  1054.  if (holder10 == 5)
  1055.   {
  1056.   holder6 = 0;
  1057.   enemychance = "Miss!";
  1058.   }
  1059.  hp -= holder6;
  1060.  guard1hp -= holder5;
  1061.  cout << "        |-----------|\n";
  1062.  cout << "        |Enemy Guard|\n";
  1063.  cout << "        |-----------|\n\n";
  1064.  cout << name << "'s spell hit the Guard for " << holder5 << " damage! " << playerchance << "\n\n";
  1065.  cout << "The Guard hit " << name << " for " << holder6 << " damage! " << enemychance << "\n\n";
  1066.  system("pause");
  1067.  playerchance = "";
  1068.  enemychance = "";
  1069.  if (hp <= 0)
  1070.   {
  1071.   guard1hp = guard1hpmax;
  1072.   goto PlayerDead;
  1073.   }
  1074.  if (guard1hp <= 0)
  1075.   {
  1076.   guard1hp = guard1hpmax;
  1077.   goto ExploreGuard1Dead;
  1078.   }
  1079.  else
  1080.  goto ExploreGuard1Engage;
  1081.  }
  1082. if (respond.compare(three) == 0 && mana >= healcost)
  1083.  {
  1084.  system("cls");
  1085.  mana -= healcost;
  1086.  holder7 = rand() % 15 + 1; //player crit
  1087.  holder9 = rand() % 15 + 1; //enemy crit
  1088.  holder10 = rand() % 15 + 1; //enemy miss
  1089.  holder1 = rand() % (heal2 - heal1) + heal1; //player heal
  1090.  holder2 = rand() % (defense2 - defense1) + defense1; //player defense
  1091.  holder3 = rand() % (guard1d2 - guard1d1) + guard1d1; //enemy damage
  1092.  holder6 = holder3 - holder2; //enemy damage
  1093.  if (holder6 <= 0)
  1094.   {
  1095.   holder6 = 0;
  1096.   }
  1097.  if (holder7 == 5)
  1098.   {
  1099.   holder1 *= 2;
  1100.   playerchance = "Critical!";
  1101.   }
  1102.  if (holder9 == 5)
  1103.   {
  1104.   holder6 *= 2;
  1105.   enemychance = "Critical!";
  1106.   }
  1107.  if (holder10 == 5)
  1108.   {
  1109.   holder6 = 0;
  1110.   enemychance = "Miss!";
  1111.   }
  1112.  hp += holder1;
  1113.  hp -= holder6;
  1114.  cout << "        |-----------|\n";
  1115.  cout << "        |Enemy Guard|\n";
  1116.  cout << "        |-----------|\n\n";
  1117.  cout << name << " healed himself for " << holder1 << " health! " << playerchance << "\n\n";
  1118.  cout << "The Guard hit " << name << " for " << holder6 << " damage! " << enemychance << "\n\n";
  1119.  system("pause");
  1120.  playerchance = "";
  1121.  enemychance = "";
  1122.  if (hp <= 0)
  1123.   {
  1124.   guard1hp = guard1hpmax;
  1125.   goto PlayerDead;
  1126.   }
  1127.  if (hp >= hpmax)
  1128.   {
  1129.   hp = hpmax;
  1130.   goto ExploreGuard1Engage;
  1131.   }
  1132.  else
  1133.  goto ExploreGuard1Engage;
  1134.  }
  1135. else
  1136. goto ExploreGuard1Engage;
  1137. }
  1138.  
  1139. ExploreGuard1Dead:
  1140. {
  1141. system("cls");
  1142. holder1 = rand() % 100 + 1; //Experience
  1143. holder2 = rand() % 20 + 1; //Gold
  1144. gold += holder2;
  1145. exp += holder1;
  1146. cout << "        |----------|\n";
  1147. cout << "        |Guard Dead|\n";
  1148. cout << "        |----------|\n\n";
  1149. cout << "You have killed an Enemy Guard!\n\n";
  1150. cout << "You are rewarded with:\n";
  1151. cout << holder1 << " Experience\n";
  1152. cout << holder2 << " Gold\n\n";
  1153. system("pause");
  1154. system("cls");
  1155. cout << "        |----------|\n";
  1156. cout << "        |Guard Dead|\n";
  1157. cout << "        |----------|\n\n";
  1158. cout << "Current Statistics:\n";
  1159. cout << "Level: " << level << "\n";
  1160. cout << "Gold: " << gold << "\n";
  1161. cout << "Experience: " << exp << "/" << expmax << "\n";
  1162. cout << "Health: " << hp << "/" << hpmax << "\n";
  1163. cout << "Mana: " << mana << "/" << manamax << "\n\n";
  1164. system("pause");
  1165. if (exp >= expmax)
  1166.  {
  1167.  goto LevelUp1;
  1168.  }
  1169. else
  1170. goto Place1Menu;
  1171. }
  1172.  
  1173. LevelUp1:
  1174. {
  1175. system("cls");
  1176. exp -= expmax;
  1177. holder10 = rand() % ((expmax * 2) - expmax) + expmax;
  1178. expmax = holder10;
  1179. level += 1;
  1180. points += 5;
  1181. holder1 = rand() % 2 + 1; // Vitality
  1182. holder2 = rand() % 2 + 1; // Strength
  1183. holder3 = rand() % 2 + 1; // Intellect
  1184. holder4 = rand() % 2 + 1; // Dexterity
  1185. holder5 = rand() % 4 + 1; // Spell Cost
  1186. holder6 = rand() % 4 + 1; // Heal Cost
  1187. vitality += holder1;
  1188. strength += holder2;
  1189. intellect += holder3;
  1190. dexterity += holder4;
  1191. hpmax += (holder1 * 6);
  1192. hp = hpmax;
  1193. damage1 += holder2;
  1194. damage2 += holder2;
  1195. manamax += (holder3 * 6);
  1196. mana = manamax;
  1197. magic1 += holder3;
  1198. magic2 += holder3;
  1199. heal1 += (holder3 * 2);
  1200. heal2 += (holder3 * 2);
  1201. defense1 += holder4;
  1202. defense2 += holder4;
  1203. spellcost += holder5;
  1204. healcost += holder6;
  1205. cout << "        |--------|\n";
  1206. cout << "        |Level Up|\n";
  1207. cout << "        |--------|\n\n";
  1208. cout << "You have gained a level up!\n\n";
  1209. cout << "Vitality +" << holder1 << "\n";
  1210. cout << "Strength +" << holder2 << "\n";
  1211. cout << "Intellect +" << holder3 << "\n";
  1212. cout << "Dexterity +" << holder4 << "\n";
  1213. cout << "Skill Points +5\n\n";
  1214. system("pause");
  1215. system("cls");
  1216. cout << "        |--------|\n";
  1217. cout << "        |Level Up|\n";
  1218. cout << "        |--------|\n\n";
  1219. cout << "Level: " << level << "\n";
  1220. cout << "Experience: " << exp << "/" << expmax << "\n";
  1221. cout << "Skill Points: " << points << "\n";
  1222. cout << "Health: " << hp << "/" << hpmax << "\n";
  1223. cout << "Mana: " << mana << "/" << manamax << "\n";
  1224. cout << "Damage: " << damage1 << "-" << damage2 << "\n";
  1225. cout << "Magic Damage: " << magic1 << "-" << magic2 << "\n";
  1226. cout << "Magic Heal: " << heal1 << "-" << heal2 << "\n";
  1227. cout << "Defense: " << defense1 << "-" << defense2 << "\n";
  1228. cout << "Strength: " << strength << "\n";
  1229. cout << "Intellect: " << intellect << "\n";
  1230. cout << "Vitality: " << vitality << "\n";
  1231. cout << "Dexterity: " << dexterity << "\n\n";
  1232. system("pause");
  1233. if (exp >= expmax)
  1234.  {
  1235.  goto LevelUp1;
  1236.  }
  1237. else
  1238. goto Place1Menu;
  1239. }
  1240.  
  1241. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement