dsun

Untitled

Feb 6th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 78.50 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.util.Random;
  3.  
  4. public class Game {
  5.  
  6. static Scanner i = new Scanner(System.in);
  7. static Random r = new Random();
  8. static String name, option;
  9. static String items[] = {"[P]otion", "[D]agger", "[T]orch\t", "[S]hield"};
  10. static String items2[] = {"[Hi]gh Potion", "+[HP] Potion", "+[ST]R Potion"};
  11. static String mons[] = {"\nA wolf attacks you!\n", "\nA bear attacks you!\n", "\nAn orc attacks you!\n", "\nA spider attacks you!\n", "\nA snake attacks you!\n",
  12. "\nA troll attacks you!\n", "\nA unicorn attacks you!\n", "\nA tree monster attacks you!\n", "\nA phoenix attacks you!\n", "\nA white shark attacks you!\n",
  13. "\nA baby dragon attacks you!\n", "\nThe dragon attacks you!\n"};
  14. public static int hp, hpMax, lvl, exp, totalExp, nextLvl, gold, goldDrop, potionCount, medPotionCount, highPotionCount, hpPotionCount, strPotionCount,
  15. q_bearClawCount, monsterDrop, chest, pool, chestLoot, str, dmg, m_dmg, m_hp, poison, poisondmg, heal, healAmount, healSelf, healSelfAmount, fireBreath, tailWhip;
  16. static int price[] = {25, 50, 100, 125};
  17. static int price2[] = {75, 350, 700};
  18. static boolean area, quest, fight, potion, medPotion, highPotion, dagger, torch, daggerEquipped, torchEquipped, shield, shieldEquipped, q_bearClaw, questComplete,
  19. crystalHelm, crystalGloves, crystalBoots, crystalHelmEquipped, crystalGlovesEquipped, crystalBootsEquipped, poisonRing, poisonRingEquipped,
  20. rockHammer, rockHammerEquipped, hpPotion, strPotion, holyAmulet, holyAmuletEquipped, leafShield, leafShieldEquipped, phoenixPet, phoenixPetEquipped,
  21. dragonWings, dragonWingsEquipped, dragonPants, dragonBody, dragonPantsEquipped, dragonBodyEquipped, flying;
  22.  
  23. public static void main(String[] args) throws InterruptedException {
  24.  
  25. hp = 10;
  26. hpMax = 10;
  27. lvl = 1;
  28. exp = 0;
  29. totalExp = 0;
  30. nextLvl = 35;
  31. gold = 0;
  32. potionCount = 0;
  33. medPotionCount = 0;
  34. q_bearClawCount = 0;
  35. str = 5;
  36. area = true;
  37. fight = true;
  38.  
  39. System.out.println("###########################################################");
  40. System.out.println("# #");
  41. System.out.println("# $$$$ $$$$$ $$ $$$$$ $$$ $$ $ #");
  42. System.out.println("# $ $ $ $ $ $ $ $ $ $ $ $ #");
  43. System.out.println("# $ $ $ $$$ $$$$$$ $ $$$ $ $ $ $ $ #");
  44. System.out.println("# $$$$ $ $ $ $ $$$$$$ $$$ $ $$ #");
  45. System.out.println("# #");
  46. System.out.println("# $$ $$ $$ $$$ $$$$$ $$ $$$$ #");
  47. System.out.println("# $ $$ $ $ $ $ $ $$ $ $ #");
  48. System.out.println("# $ $ $ $ $ $ $ $$$ $$ $ $ #");
  49. System.out.println("# $$ $$ $$$ $ $ $$$$$ $$$$ #");
  50. System.out.println("# #");
  51. System.out.println("###########################################################");
  52. Thread.sleep(2000);
  53.  
  54. System.out.println("\n\n[P]lay\n[Q]uit");
  55. option = i.nextLine().toLowerCase();
  56.  
  57. while(area == true){
  58. if(option.equals("p")){
  59. System.out.print("\nName: ");
  60. name = i.nextLine();
  61. System.out.println("\nAfter witnessing your whole family slaughtered by the dragon...");
  62. Thread.sleep(3000);
  63. System.out.println("\nYou, known as " + name + ", swore to take revenge.");
  64. Thread.sleep(3000);
  65. System.out.println("\nYour quest to kill the dragon begins now.");
  66. Thread.sleep(3000);
  67. home();
  68. }else if(option.equals("q")){
  69. area = false;
  70. }else{
  71. option = i.nextLine().toLowerCase();
  72. }
  73. }
  74. }
  75.  
  76. public static void home() throws InterruptedException{
  77. System.out.println("\nYou are in your home.");
  78. System.out.println("Options: [E]xit, [R]est, [I]nventory, [S]tats");
  79. option = i.nextLine().toLowerCase();
  80.  
  81. while(area == true){
  82.  
  83. if(option.equals("e")){
  84. town();
  85. }else if(option.equals("r")){
  86. if(hp < 5){
  87. hp = hpMax;
  88. System.out.println("\nYou rested well!");
  89. option = i.nextLine().toLowerCase();
  90. }else{
  91. System.out.println("\nYou don't feel like resting.");
  92. option = i.nextLine().toLowerCase();
  93. }
  94. }else if(option.equals("i")){
  95. System.out.println("\nInventory\n\nItems\t\t\t\tDescription\n");
  96. if(potion == false && dagger == false && torch == false && shield == false && crystalHelm == false && crystalGloves == false &&
  97. crystalBoots == false && poisonRing == false && medPotion == false && highPotion == false && hpPotion == false && strPotion == false
  98. && holyAmulet == false && leafShield == false && phoenixPet == false && dragonWings == false && dragonPants == false
  99. && dragonBody == false && gold == 0){
  100. System.out.println("Empty");
  101. option = i.nextLine().toLowerCase();
  102. }else{
  103.  
  104. if(gold >= 10){
  105. System.out.println("Gold x" + gold + "\t\t\tGold is always welcome.");
  106. }else if(gold < 10){
  107. System.out.println("Gold x" + gold + "\t\t\t\tGold is always welcome.");
  108. }
  109.  
  110. if(potion == true){
  111. System.out.println(items[0] + " x" + potionCount + "\t\t\tHeals 5 HP");
  112. }
  113.  
  114. if(medPotion == true){
  115. System.out.println("[M]edium Potion x" + medPotionCount + "\t\tHeals 15 HP");
  116. }
  117.  
  118. if(highPotion == true){
  119. System.out.println(items2[0] + " x" + highPotionCount + "\t\tHeals 30 HP");
  120. }
  121.  
  122. if(hpPotion == true){
  123. System.out.println(items2[1] + " x" + hpPotionCount + "\t\t\t+10 HP");
  124. }
  125.  
  126. if(strPotion == true){
  127. System.out.println(items2[2] + " x" + strPotionCount + "\t\t+10 STR");
  128. }
  129.  
  130. if(dagger == true){
  131. if(daggerEquipped == true){
  132. System.out.println(items[1] + " [Equipped]\t\t+3 STR");
  133. }else{
  134. System.out.println(items[1] + "\t\t\t+3 STR");
  135. }
  136.  
  137. }
  138.  
  139. if(torch == true){
  140. if(torchEquipped == true){
  141. System.out.println(items[2] + " [Equipped]\t\tLights up dark areas.");
  142. }else{
  143. System.out.println(items[2] + "\t\t\tLights up dark areas.");
  144. }
  145. }
  146.  
  147. if(shield == true){
  148. if(shieldEquipped == true){
  149. System.out.println(items[3] + " [Equipped]\t\t+10 HP");
  150. }else{
  151. System.out.println(items[3] + "\t\t\t+10 HP");
  152. }
  153. }
  154.  
  155. if(crystalHelm == true){
  156. if(crystalHelmEquipped == true){
  157. System.out.println("Crystal [h]elm [Equipped]\t+25 HP");
  158. }else{
  159. System.out.println("Crystal [h]elm\t\t\t+25 HP");
  160. }
  161. }
  162.  
  163. if(crystalGloves == true){
  164. if(crystalGlovesEquipped == true){
  165. System.out.println("Crystal [g]loves [Equipped]\t+15 HP");
  166. }else{
  167. System.out.println("Crystal [g]loves\t\t+15 HP");
  168. }
  169. }
  170.  
  171. if(crystalBoots == true){
  172. if(crystalBootsEquipped == true){
  173. System.out.println("Crystal [b]oots [Equipped]\t+20 HP");
  174. }else{
  175. System.out.println("Crystal [b]oots\t\t\t+20 HP");
  176. }
  177. }
  178.  
  179. if(poisonRing == true){
  180. if(poisonRingEquipped == true){
  181. System.out.println("Poison [ri]ng [Equipped]\t+5 HP, +5 STR");
  182. }else{
  183. System.out.println("Poison [ri]ng \t\t\t+5 HP, +5 STR");
  184. }
  185. }
  186.  
  187. if(rockHammer == true){
  188. if(rockHammerEquipped == true){
  189. System.out.println("[R]ock hammer [Equipped]\t+10 STR");
  190. }else{
  191. System.out.println("[R]ock hammer\t\t\t+10 STR");
  192. }
  193. }
  194.  
  195. if(holyAmulet == true){
  196. if(holyAmuletEquipped == true){
  197. System.out.println("Holy [a]mulet [Equipped]\t+15 HP, +7 STR");
  198. }else{
  199. System.out.println("Holy [a]mulet\t\t\t+15 HP, +7 STR");
  200. }
  201. }
  202.  
  203. if(leafShield == true){
  204. if(leafShieldEquipped == true){
  205. System.out.println("Lea[f] Shield [Equipped]\t+30 HP, +5 STR");
  206. }else{
  207. System.out.println("Lea[f] Shield\t\t\t+30 HP, +5 STR");
  208. }
  209. }
  210.  
  211. if(phoenixPet == true){
  212. if(phoenixPetEquipped == true){
  213. System.out.println("Phoeni[x] Pet [Equipped]\tHeals you in combat.");
  214. }else{
  215. System.out.println("Phoeni[x] Pet\t\t\tHeals you in combat.");
  216. }
  217. }
  218.  
  219. if(dragonWings == true){
  220. if(dragonWingsEquipped == true){
  221. System.out.println("Dragon [w]ings [Equipped]\t+25 HP, +10 STR, FLY");
  222. }else{
  223. System.out.println("Dragon [w]ings\t\t\t+25 HP, +10 STR, FLY");
  224. }
  225. }
  226.  
  227. if(dragonPants == true){
  228. if(dragonPantsEquipped == true){
  229. System.out.println("Dragon [pa]nts [Equipped]\t+35 HP, +15 STR");
  230. }else{
  231. System.out.println("Dragon [pa]nts\t\t\t+35 HP, +15 STR");
  232. }
  233. }
  234.  
  235. if(dragonBody == true){
  236. if(dragonBodyEquipped == true){
  237. System.out.println("Dragon [bo]dy [Equipped]\t+50 HP, +25 STR");
  238. }else{
  239. System.out.println("Dragon [bo]dy\t\t\t+50 HP, +25 STR");
  240. }
  241. }
  242.  
  243. System.out.println("[E]xit");
  244. option = i.nextLine().toLowerCase();
  245.  
  246. while(area == true){
  247.  
  248. if(option.equals("p") && potion == true){
  249. if(hp == hpMax){
  250. System.out.println("\nYou don't need to drink this right now.");
  251. }else{
  252. System.out.println("\nYou drink the Potion... some HP was restored!");
  253. hp += 5;
  254. potionCount -= 1;
  255. if(hp > hpMax){
  256. hp = hpMax;
  257. }
  258. if(potionCount == 0){
  259. potion = false;
  260. }
  261.  
  262. home();
  263. }
  264. option = i.nextLine().toLowerCase();
  265.  
  266. }else if(option.equals("m") && medPotion == true){
  267.  
  268. if(hp == hpMax){
  269. System.out.println("\nYou don't need to drink this right now.");
  270. }else{
  271. System.out.println("\nYou drink the Medium Potion... some HP was restored!");
  272. hp += 15;
  273. medPotionCount -= 1;
  274. if(hp > hpMax){
  275. hp = hpMax;
  276. }
  277. if(medPotionCount == 0){
  278. medPotion = false;
  279. }
  280.  
  281. home();
  282. }
  283. option = i.nextLine().toLowerCase();
  284.  
  285. }else if(option.equals("hi") && highPotion == true){
  286.  
  287. if(hp == hpMax){
  288. System.out.println("\nYou don't need to drink this right now.");
  289. }else{
  290. System.out.println("\nYou drink the High Potion... some HP was restored!");
  291. hp += 30;
  292. highPotionCount -= 1;
  293. if(hp > hpMax){
  294. hp = hpMax;
  295. }
  296. if(highPotionCount == 0){
  297. highPotion = false;
  298. }
  299. home();
  300. }
  301. option = i.nextLine().toLowerCase();
  302.  
  303. }else if(option.equals("hp") && hpPotion == true){
  304. System.out.println("\nYou drink the +HP Potion... HP increased!");
  305. hp += 10;
  306. hpMax += 10;
  307. hpPotionCount -= 1;
  308. if(hpPotionCount == 0){
  309. hpPotion = false;
  310. }
  311. home();
  312.  
  313. }else if(option.equals("st") && strPotion == true){
  314. System.out.println("\nYou drink the +STR Potion... STR increased!");
  315. str += 10;
  316. strPotionCount -= 1;
  317. if(strPotionCount == 0){
  318. strPotion = false;
  319. }
  320. home();
  321.  
  322. }else if(option.equals("d") && dagger == true){
  323. if(rockHammerEquipped == true){
  324. System.out.println("\nPlease unequip the other weapon first!");
  325. option = i.nextLine().toLowerCase();
  326. }else if(daggerEquipped == false){
  327. System.out.println("\nYou equip the dagger.");
  328. daggerEquipped = true;
  329. str += 3;
  330. home();
  331. }else if(daggerEquipped == true){
  332. System.out.println("\nYou unequip the dagger.");
  333. daggerEquipped = false;
  334. str -= 3;
  335. home();
  336. }
  337.  
  338. }else if(option.equals("t") && torch == true){
  339. if(torchEquipped == false){
  340. System.out.println("\nYou equip the torch.");
  341. torchEquipped = true;
  342. home();
  343. }else if(torchEquipped == true){
  344. System.out.println("\nYou unequip the torch.");
  345. torchEquipped = false;
  346. home();
  347. }
  348. }else if(option.equals("s") && shield == true){
  349. if(leafShieldEquipped == true){
  350. System.out.println("\nPlease unequip the other shield first!");
  351. option = i.nextLine().toLowerCase();
  352. }else if(shieldEquipped == false){
  353. System.out.println("\nYou equip the shield.");
  354. shieldEquipped = true;
  355. hp += 10;
  356. hpMax += 10;
  357. home();
  358. }else if(shieldEquipped == true){
  359. System.out.println("\nYou unequip the shield.");
  360. shieldEquipped = false;
  361. hp -= 10;
  362. hpMax -= 10;
  363. home();
  364. }
  365.  
  366. }else if(option.equals("h") && crystalHelm == true){
  367. if(crystalHelmEquipped == false){
  368. System.out.println("\nYou equip the crystal helm.");
  369. crystalHelmEquipped = true;
  370. hp += 25;
  371. hpMax += 25;
  372. home();
  373. }else if(crystalHelmEquipped == true){
  374. System.out.println("\nYou unequip the crystal helm.");
  375. crystalHelmEquipped = false;
  376. hp -= 25;
  377. hpMax -= 25;
  378. home();
  379. }
  380.  
  381. }else if(option.equals("g") && crystalGloves == true){
  382. if(crystalGlovesEquipped == false){
  383. System.out.println("\nYou equip the crystal gloves.");
  384. crystalGlovesEquipped = true;
  385. hp += 15;
  386. hpMax += 15;
  387. home();
  388. }else if(crystalGlovesEquipped == true){
  389. System.out.println("\nYou unequip the crystal gloves.");
  390. crystalGlovesEquipped = false;
  391. hp -= 15;
  392. hpMax -= 15;
  393. home();
  394. }
  395.  
  396. }else if(option.equals("b") && crystalBoots == true){
  397. if(crystalBootsEquipped == false){
  398. System.out.println("\nYou equip the crystal boots.");
  399. crystalBootsEquipped = true;
  400. hp += 20;
  401. hpMax += 20;
  402. home();
  403. }else if(crystalBootsEquipped == true){
  404. System.out.println("\nYou unequip the crystal boots.");
  405. crystalBootsEquipped = false;
  406. hp -= 20;
  407. hpMax -= 20;
  408. home();
  409. }
  410.  
  411. }else if(option.equals("ri") && poisonRing == true){
  412. if(poisonRingEquipped == false){
  413. System.out.println("\nYou equip the poison ring.");
  414. poisonRingEquipped = true;
  415. hp += 5;
  416. hpMax += 5;
  417. str += 5;
  418. home();
  419. }else if(poisonRingEquipped == true){
  420. System.out.println("\nYou unequip the poison ring.");
  421. poisonRingEquipped = false;
  422. hp -= 5;
  423. hpMax -= 5;
  424. str -= 5;
  425. home();
  426. }
  427.  
  428. }else if(option.equals("r") && rockHammer == true){
  429. if(daggerEquipped == true){
  430. System.out.println("\nPlease unequip the other weapon first!");
  431. option = i.nextLine().toLowerCase();
  432. }else if(rockHammerEquipped == false){
  433. System.out.println("\nYou equip the rock hammer.");
  434. rockHammerEquipped = true;
  435. str += 10;
  436. home();
  437. }else if(rockHammerEquipped == true){
  438. System.out.println("\nYou unequip the rock hammer.");
  439. rockHammerEquipped = false;
  440. str -= 10;
  441. home();
  442. }
  443.  
  444. }else if(option.equals("a") && holyAmulet == true){
  445. if(holyAmuletEquipped == false){
  446. System.out.println("\nYou equip the holy amulet.");
  447. holyAmuletEquipped = true;
  448. hp += 15;
  449. hpMax += 15;
  450. str += 7;
  451. home();
  452. }else if(holyAmuletEquipped == true){
  453. System.out.println("\nYou unequip the holy amulet.");
  454. holyAmuletEquipped = false;
  455. hp -= 15;
  456. hpMax -= 15;
  457. str -= 7;
  458. home();
  459. }
  460. }else if(option.equals("f") && leafShield == true){
  461. if(shieldEquipped == true){
  462. System.out.println("\nPlease unequip the other shield first!");
  463. option = i.nextLine().toLowerCase();
  464. }else if(leafShieldEquipped == false){
  465. System.out.println("\nYou equip the leaf shield.");
  466. leafShieldEquipped = true;
  467. hp += 30;
  468. hpMax += 30;
  469. str += 5;
  470. home();
  471. }else if(leafShieldEquipped == true){
  472. System.out.println("\nYou unequip the leaf shield.");
  473. leafShieldEquipped = false;
  474. hp -= 30;
  475. hpMax -= 30;
  476. str -= 5;
  477. home();
  478. }
  479. }else if(option.equals("x") && phoenixPet == true){
  480.  
  481. if(phoenixPetEquipped == false){
  482. System.out.println("\nYou equip the phoenix pet.");
  483. phoenixPetEquipped = true;
  484. home();
  485. }else if(phoenixPetEquipped == true){
  486. System.out.println("\nYou unequip the phoenix pet.");
  487. phoenixPetEquipped = false;
  488. home();
  489. }
  490. }else if(option.equals("w") && dragonWings == true){
  491.  
  492. if(dragonWingsEquipped == false){
  493. System.out.println("\nYou equip the dragon wings.");
  494. dragonWingsEquipped = true;
  495. hp += 25;
  496. hpMax += 25;
  497. str += 10;
  498. home();
  499. }else if(dragonWingsEquipped == true){
  500. System.out.println("\nYou unequip the dragon wings.");
  501. dragonWingsEquipped = false;
  502. hp -= 25;
  503. hpMax -= 25;
  504. str -= 10;
  505. home();
  506. }
  507.  
  508. }else if(option.equals("pa") && dragonPants == true){
  509.  
  510. if(dragonPantsEquipped == false){
  511. System.out.println("\nYou equip the dragon pants.");
  512. dragonPantsEquipped = true;
  513. hp += 35;
  514. hpMax += 35;
  515. str += 15;
  516. home();
  517. }else if(dragonPantsEquipped == true){
  518. System.out.println("\nYou unequip the dragon pants.");
  519. dragonPantsEquipped = false;
  520. hp -= 35;
  521. hpMax -= 35;
  522. str -= 15;
  523. home();
  524. }
  525.  
  526. }else if(option.equals("bo") && dragonBody == true){
  527.  
  528. if(dragonBodyEquipped == false){
  529. System.out.println("\nYou equip the dragon body.");
  530. dragonBodyEquipped = true;
  531. hp += 50;
  532. hpMax += 50;
  533. str += 25;
  534. home();
  535. }else if(dragonBodyEquipped == true){
  536. System.out.println("\nYou unequip the dragon body.");
  537. dragonBodyEquipped = false;
  538. hp -= 50;
  539. hpMax -= 50;
  540. str -= 25;
  541. home();
  542. }
  543.  
  544. }else if(option.equals("e")){
  545. home();
  546.  
  547. }else{
  548. option = i.nextLine().toLowerCase();
  549. }
  550.  
  551. }
  552. }
  553. }else if(option.equals("s")){
  554. System.out.println("\nStats\n");
  555. System.out.println("Name: " + name);
  556. System.out.println("LVL: " + lvl);
  557. System.out.println("HP: " + hp + "/" + hpMax);
  558. System.out.println("STR: " + str);
  559. System.out.println("Next LVL in: " + nextLvl + " exp");
  560. System.out.println("Total exp: " + totalExp);
  561. option = i.nextLine().toLowerCase();
  562. }else{
  563. option = i.nextLine().toLowerCase();
  564. }
  565. }
  566. }
  567.  
  568. public static void town() throws InterruptedException{
  569. System.out.println("\nYou are in the town.");
  570. System.out.println("Options: [H]ome, [S]hop, [F]orest");
  571. option = i.nextLine().toLowerCase();
  572.  
  573. while(area == true){
  574.  
  575. if(option.equals("h")){
  576. home();
  577. }else if(option.equals("s")){
  578. shop();
  579. }else if(option.equals("f")){
  580. forest();
  581. }else{
  582. option = i.nextLine().toLowerCase();
  583. }
  584. }
  585. }
  586.  
  587. public static void shop() throws InterruptedException{
  588. System.out.println("\nYou are in the shop.");
  589. System.out.println("Options: [B]uy, [E]xit");
  590. option = i.nextLine().toLowerCase();
  591.  
  592. while(area == true){
  593.  
  594. if(option.equals("b")){
  595. System.out.println("\nShop keeper: Hello, how can I help you?\nYou have " + gold + " gold.");
  596. System.out.println("\nItems\t\tPrice");
  597.  
  598. for(int x = 0; x < items.length && x < price.length; x++){
  599. System.out.println(items[x] + "\t" + price[x]);
  600. }
  601. System.out.println("[E]xit");
  602. option = i.nextLine().toLowerCase();
  603.  
  604. while(area == true){
  605.  
  606. if(option.equals("p")){
  607. if(gold >= 25){
  608. gold -= 25;
  609. System.out.println("\nYou buy a potion.");
  610. option = i.nextLine().toLowerCase();
  611. potionCount++;
  612. potion = true;
  613.  
  614. }else{
  615. System.out.println("\nNot enough money!");
  616. option = i.nextLine().toLowerCase();
  617. }
  618.  
  619. }else if(option.equals("d")){
  620. if(dagger == true){
  621. System.out.println("\nYou already have a dagger!");
  622. option = i.nextLine().toLowerCase();
  623. }else if(gold >= 50){
  624. gold -= 50;
  625. System.out.println("\nYou buy the dagger.");
  626. option = i.nextLine().toLowerCase();
  627. dagger = true;
  628. }else{
  629. System.out.println("\nNot enough money!");
  630. option = i.nextLine().toLowerCase();
  631. }
  632.  
  633. }else if(option.equals("s")){
  634. if(shield == true){
  635. System.out.println("\nYou already have a shield!");
  636. option = i.nextLine().toLowerCase();
  637. }else if(gold >= 125){
  638. gold -= 125;
  639. System.out.println("\nYou buy the shield.");
  640. option = i.nextLine().toLowerCase();
  641. shield = true;
  642. }else{
  643. System.out.println("\nNot enough money!");
  644. option = i.nextLine().toLowerCase();
  645. }
  646.  
  647. }else if(option.equals("t")){
  648. if(torch == true){
  649. System.out.println("\nYou already have a torch!");
  650. option = i.nextLine().toLowerCase();
  651. }else if(gold >= 100){
  652. gold -= 100;
  653. System.out.println("\nYou buy the torch.");
  654. option = i.nextLine().toLowerCase();
  655. torch = true;
  656. }else{
  657. System.out.println("\nNot enough money!");
  658. option = i.nextLine().toLowerCase();
  659. }
  660.  
  661. }else if(option.equals("e")){
  662. System.out.println("\nYou exit the shop.");
  663. town();
  664. }else{
  665. option = i.nextLine().toLowerCase();
  666. }
  667. }
  668.  
  669. }else if(option.equals("e")){
  670. System.out.println("\nYou exit the shop.");
  671. town();
  672. }else{
  673. option = i.nextLine().toLowerCase();
  674. }
  675. }
  676. }
  677.  
  678. public static void forest() throws InterruptedException{
  679. System.out.println("\nYou are in the forest.");
  680. System.out.println("Options: [E]ast, [W]est, [N]orth, [S]outh");
  681. option = i.nextLine().toLowerCase();
  682.  
  683. while(area == true){
  684.  
  685. if(option.equals("e")){
  686. forestMonsters();
  687. System.out.println("\nYou went east.");
  688. System.out.println("You are in the forest.");
  689. System.out.println("You see a small house.");
  690. System.out.println("Options: [E]nter, [W]est");
  691. option = i.nextLine().toLowerCase();
  692.  
  693. while(area == true){
  694.  
  695. if(option.equals("w")){
  696. forestMonsters();
  697. System.out.println("\nYou went west.");
  698. forest();
  699. }else if(option.equals("e")){
  700. System.out.println("\nYou enter the small house.");
  701. System.out.println("You see an old woman.");
  702. System.out.println("Options: [T]alk, [E]xit");
  703. option = i.nextLine().toLowerCase();
  704.  
  705. while(area == true){
  706. if(option.equals("t")){
  707. if(quest == true && questComplete == false){
  708. if(q_bearClaw == true){
  709. q_bearClawCount = 0;
  710. System.out.println("\nOld Woman: Wonderful, thank you!");
  711. System.out.println("\nQuest Complete!\nReward:\n50 gold\n125 exp");
  712. gold += 50;
  713. exp += 125;
  714. questComplete = true;
  715. lvlsystem();
  716. System.out.println("\nYou left the house.");
  717. forest();
  718. }else{
  719. System.out.println("\nOld Woman: Please bring me some bear claws.");
  720. System.out.println("\nYou left the house.");
  721. forest();
  722. }
  723. }else if(quest == false){
  724. System.out.println("\nOld Woman: Hello, young one.");
  725. System.out.println("Old Woman: What brings you here?");
  726. System.out.println("Options: [Q]uest, [N]ever mind");
  727. option = i.nextLine().toLowerCase();
  728. while(quest == false){
  729. if(option.equals("q")){
  730. quest = true;
  731. System.out.println("\nOld Woman: Please bring me some bear claws.");
  732. System.out.println("\nYou left the house.");
  733. forest();
  734. }else if(option.equals("n")){
  735. System.out.println("\nYou left the house.");
  736. forest();
  737. }else{
  738. option = i.nextLine().toLowerCase();
  739. }
  740. }
  741. }else if(questComplete == true){
  742. System.out.println("\nOld Woman: I don't need help right now.");
  743. System.out.println("\nYou left the house.");
  744. forest();
  745. }
  746. }else if(option.equals("e")){
  747. System.out.println("\nYou left the house.");
  748. forest();
  749. }else{
  750. option = i.nextLine().toLowerCase();
  751. }
  752. }
  753. }else{
  754. option = i.nextLine().toLowerCase();
  755. }
  756. }
  757.  
  758. }else if(option.equals("w")){
  759. forestMonsters();
  760. System.out.println("\nYou went west.");
  761. System.out.println("You are in the forest.");
  762. System.out.println("You see a crystal chest and a warning sign.");
  763. System.out.println("Options: [E]ast, [R]ead, [O]pen");
  764. option = i.nextLine().toLowerCase();
  765.  
  766. while(area == true){
  767.  
  768. if(option.equals("e")){
  769. forestMonsters();
  770. System.out.println("\nYou went east.");
  771. forest();
  772. }else if(option.equals("o")){
  773. chest = 1+r.nextInt(15);
  774. chestLoot = 100+r.nextInt(300);
  775. System.out.println("\nYou attempt to open the chest...");
  776. Thread.sleep(1000);
  777.  
  778. if(chest == 1){
  779. if(crystalHelm == true && crystalGloves == true && crystalBoots == true){
  780. System.out.println("...You find " + chestLoot + " gold!");
  781. gold += chestLoot;
  782. forest();
  783. }else if(crystalHelm == false && crystalGloves == false && crystalBoots == false){
  784. System.out.println("...You find a crystal helm!");
  785. crystalHelm = true;
  786. forest();
  787. }else if(crystalHelm == true && crystalGloves == false && crystalBoots == false){
  788. System.out.println("...You find a pair of crystal gloves!");
  789. crystalGloves = true;
  790. forest();
  791. }else if(crystalHelm == true && crystalGloves == true && crystalBoots == false){
  792. System.out.println("...You find a pair of crystal boots!");
  793. crystalBoots = true;
  794. forest();
  795. }
  796. }else{
  797. orc();
  798. }
  799.  
  800. }else if(option.equals("r")){
  801. System.out.println("\nYou read the sign, it says:");
  802. System.out.println("\"Beware! Strong orcs!\"");
  803. option = i.nextLine().toLowerCase();
  804. }else{
  805. option = i.nextLine().toLowerCase();
  806. }
  807. }
  808.  
  809. }else if(option.equals("n")){
  810. forestMonsters();
  811. System.out.println("\nYou went north.");
  812. System.out.println("You are in the forest.");
  813. System.out.println("You see a cave.");
  814. System.out.println("Options: [E]nter, [S]outh");
  815. option = i.nextLine().toLowerCase();
  816.  
  817. while(area == true){
  818.  
  819. if(option.equals("e")){
  820.  
  821. if(torchEquipped == true){
  822. System.out.println("\nYou enter the cave.");
  823. cave();
  824. }else{
  825. System.out.println("\nIt's too dark, I need to get a lightsource first.");
  826. option = i.nextLine().toLowerCase();
  827. }
  828.  
  829. }else if(option.equals("s")){
  830. forestMonsters();
  831. System.out.println("\nYou went south.");
  832. forest();
  833. }else{
  834. option = i.nextLine().toLowerCase();
  835. }
  836. }
  837.  
  838. }else if(option.equals("s")){
  839. forestMonsters();
  840. System.out.println("\nYou went south.");
  841. town();
  842. }else{
  843. option = i.nextLine().toLowerCase();
  844. }
  845. }
  846. }
  847.  
  848. public static void cave() throws InterruptedException{
  849. System.out.println("\nYou are in the cave.");
  850. System.out.println("Options: [W]est, [E]ast, [N]orth, [S]outh");
  851. option = i.nextLine().toLowerCase();
  852.  
  853. while(area == true){
  854. if(option.equals("w")){
  855. caveMonsters();
  856. System.out.println("\nYou went west.");
  857. System.out.println("You are in the cave.");
  858. System.out.println("You see a warning sign.");
  859. System.out.println("Options: [E]ast, [R]ead");
  860. option = i.nextLine().toLowerCase();
  861.  
  862. while(area == true){
  863. if(option.equals("e")){
  864. System.out.println("\nYou went east.");
  865. cave();
  866. }else if(option.equals("r")){
  867. System.out.println("\nYou read the sign, it says:");
  868. System.out.println("\"Beware! Poisonous monsters!\"");
  869. option = i.nextLine().toLowerCase();
  870. }else{
  871. option = i.nextLine().toLowerCase();
  872. }
  873. }
  874.  
  875. }else if(option.equals("e")){
  876. caveMonsters();
  877. System.out.println("\nYou went east.");
  878. System.out.println("You are in the cave.");
  879. System.out.println("You see a pool with strange looking liquid.");
  880. System.out.println("Options: [W]est, [D]rink");
  881. option = i.nextLine().toLowerCase();
  882.  
  883. while(area == true){
  884. if(option.equals("w")){
  885. System.out.println("\nYou went west.");
  886. cave();
  887. }else if(option.equals("d")){
  888. pool = 1+r.nextInt(3);
  889. if(pool == 1){
  890. System.out.println("\nYou feel refreshed!");
  891. System.out.println("You went west.");
  892. hp = hpMax;
  893. cave();
  894. }else{
  895. snake();
  896. System.out.println("\nDamn snake caught me by surprise.");
  897. System.out.println("You went west.");
  898. cave();
  899. }
  900. }else{
  901. option = i.nextLine().toLowerCase();
  902. }
  903. }
  904.  
  905. }else if(option.equals("n")){
  906. caveMonsters();
  907. System.out.println("\nYou went north.");
  908. System.out.println("You are in the cave.");
  909. System.out.println("You see a strange portal and a wizard.");
  910. System.out.println("Options: [T]alk, [S]outh");
  911. option = i.nextLine().toLowerCase();
  912.  
  913. while(area == true){
  914. if(option.equals("s")){
  915. System.out.println("\nYou went south.");
  916. cave();
  917. }else if(option.equals("t")){
  918. System.out.println("\nWizard: Hello, would you like to go DragonWorld?");
  919. System.out.println("Wizard: It only costs 200 gold!");
  920. System.out.println("Options: [Y]es, [N]o");
  921. option = i.nextLine().toLowerCase();
  922.  
  923. while(area == true){
  924. if(option.equals("y")){
  925. if(gold >= 200){
  926. System.out.println("\nYou walk into the portal...");
  927. dragonWorld();
  928. }else{
  929. System.out.println("\nWizard: You don't have enough gold...");
  930. caveMonsters();
  931. System.out.println("\nYou went south.");
  932. cave();
  933. }
  934. }else if(option.equals("n")){
  935. caveMonsters();
  936. System.out.println("\nYou went south.");
  937. cave();
  938. }else{
  939. option = i.nextLine().toLowerCase();
  940. }
  941.  
  942. }
  943. }else{
  944. option = i.nextLine().toLowerCase();
  945. }
  946. }
  947.  
  948. }else if(option.equals("s")){
  949. caveMonsters();
  950. System.out.println("\nYou exit the cave.");
  951. forest();
  952. }else{
  953. option = i.nextLine().toLowerCase();
  954. }
  955. }
  956.  
  957. }
  958.  
  959. public static void forestMonsters() throws InterruptedException{
  960. int fm = r.nextInt(5);
  961.  
  962. if(fm == 1){
  963. wolf();
  964. }else if(fm == 2){
  965. bear();
  966. }
  967. }
  968.  
  969. public static void caveMonsters() throws InterruptedException{
  970. int cm = 1+r.nextInt(5);
  971.  
  972. if(cm == 1){
  973. spider();
  974. }else if(cm == 2){
  975. snake();
  976. }else if(cm == 3){
  977. troll();
  978. }
  979. }
  980.  
  981. public static void lvlsystem(){
  982. totalExp += exp;
  983.  
  984. if(exp >= nextLvl){
  985. exp = 0;
  986. nextLvl *= 1.2;
  987. lvl++;
  988. hp += 3;
  989. hpMax += 3;
  990. str += 1;
  991. System.out.println("\nYou are now LVL " + lvl + "!");
  992. }
  993. }
  994.  
  995. public static void wolf() throws InterruptedException{
  996. fight = true;
  997. m_hp = 5;
  998. System.out.println(mons[0]);
  999.  
  1000. while(fight == true){
  1001. m_dmg = r.nextInt(2);
  1002. goldDrop = 1+r.nextInt(5);
  1003. monsterDrop = 1+r.nextInt(5);
  1004. dmg = r.nextInt(str);
  1005. dmg *= 0.5;
  1006. healSelf = 1+r.nextInt(3);
  1007. healSelfAmount = 1+r.nextInt(5);
  1008. System.out.println("Wolf (HP:" + m_hp + "/5) does " + m_dmg + " damage");
  1009. hp -= m_dmg;
  1010. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  1011. m_hp -= dmg;
  1012. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  1013. System.out.println(healSelfAmount + "+ heal!");
  1014. hp += healSelfAmount;
  1015. if(hp > hpMax){
  1016. hp = hpMax;
  1017. }
  1018. }
  1019. System.out.println();
  1020. Thread.sleep(1500);
  1021.  
  1022. if(m_hp <= 0){
  1023. fight = false;
  1024. System.out.println("You killed the wolf\nGained 15 exp\nDrops:\nGold x" + goldDrop);
  1025. if(monsterDrop == 1){
  1026. System.out.println("Potion");
  1027. potion = true;
  1028. potionCount += 1;
  1029. }
  1030. gold += goldDrop;
  1031. exp += 15;
  1032. lvlsystem();
  1033. }else if(hp <= 0){
  1034. fight = false;
  1035. System.out.println("\nYou died!");
  1036. System.out.println("Lost some gold.");
  1037. gold *= 0.5;
  1038. hp = hpMax;
  1039. home();
  1040. }else if(hp <= 0 && m_hp <= 0){
  1041. fight = false;
  1042. System.out.println("\nYou died!");
  1043. System.out.println("Lost some gold.");
  1044. gold *= 0.5;
  1045. hp = hpMax;
  1046. home();
  1047. }
  1048. }
  1049. }
  1050.  
  1051. public static void bear() throws InterruptedException{
  1052. fight = true;
  1053. m_hp = 7;
  1054. System.out.println(mons[1]);
  1055.  
  1056. while(fight == true){
  1057. m_dmg = r.nextInt(3);
  1058. goldDrop = 1+r.nextInt(15);
  1059. dmg = r.nextInt(str);
  1060. dmg *= 0.5;
  1061. healSelf = 1+r.nextInt(3);
  1062. healSelfAmount = 1+r.nextInt(5);
  1063. System.out.println("Bear (HP:" + m_hp + "/7) does " + m_dmg + " damage");
  1064. hp -= m_dmg;
  1065. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  1066. m_hp -= dmg;
  1067. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  1068. System.out.println(healSelfAmount + "+ heal!");
  1069. hp += healSelfAmount;
  1070. if(hp > hpMax){
  1071. hp = hpMax;
  1072. }
  1073. }
  1074. System.out.println();
  1075. Thread.sleep(1500);
  1076.  
  1077. if(m_hp <= 0){
  1078. fight = false;
  1079. System.out.println("You killed the bear\nGained 25 exp\nDrops:\nGold x" + goldDrop);
  1080.  
  1081. if(quest == true && q_bearClaw == false){
  1082. if(q_bearClawCount == 3){
  1083. System.out.println("\nI have the bear claws, I should go to the Old Woman now.");
  1084. q_bearClaw = true;
  1085. }else{
  1086. q_bearClawCount++;
  1087. System.out.println("Bear claw");
  1088. }
  1089. }
  1090.  
  1091. gold += goldDrop;
  1092. exp += 25;
  1093. lvlsystem();
  1094. }else if(hp <= 0){
  1095. fight = false;
  1096. System.out.println("\nYou died!");
  1097. System.out.println("Lost some gold.");
  1098. gold *= 0.5;
  1099. hp = hpMax;
  1100. home();
  1101. }else if(hp <= 0 && m_hp <= 0){
  1102. fight = false;
  1103. System.out.println("\nYou died!");
  1104. System.out.println("Lost some gold.");
  1105. gold *= 0.5;
  1106. hp = hpMax;
  1107. home();
  1108. }
  1109. }
  1110. }
  1111.  
  1112. public static void orc() throws InterruptedException{
  1113. fight = true;
  1114. m_hp = 20;
  1115. System.out.println(mons[2]);
  1116.  
  1117. while(fight == true){
  1118. m_dmg = r.nextInt(11);
  1119. goldDrop = 1+r.nextInt(80);
  1120. monsterDrop = 1+r.nextInt(3);
  1121. dmg = r.nextInt(str);
  1122. dmg *= 0.5;
  1123. healSelf = 1+r.nextInt(3);
  1124. healSelfAmount = 1+r.nextInt(5);
  1125. System.out.println("Orc (HP:" + m_hp + "/20) does " + m_dmg + " damage");
  1126. hp -= m_dmg;
  1127. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  1128. m_hp -= dmg;
  1129. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  1130. System.out.println(healSelfAmount + "+ heal!");
  1131. hp += healSelfAmount;
  1132. if(hp > hpMax){
  1133. hp = hpMax;
  1134. }
  1135. }
  1136. System.out.println();
  1137. Thread.sleep(1500);
  1138.  
  1139. if(m_hp <= 0){
  1140. fight = false;
  1141. System.out.println("You killed the orc\nGained 50 exp\nDrops:\nGold x" + goldDrop);
  1142. if(monsterDrop == 1){
  1143. System.out.println("Medium Potion");
  1144. medPotion = true;
  1145. medPotionCount += 1;
  1146. }
  1147. gold += goldDrop;
  1148. exp += 50;
  1149. lvlsystem();
  1150. forest();
  1151. }else if(hp <= 0){
  1152. fight = false;
  1153. System.out.println("\nYou died!");
  1154. System.out.println("Lost some gold.");
  1155. gold *= 0.5;
  1156. hp = hpMax;
  1157. home();
  1158. }else if(hp <= 0 && m_hp <= 0){
  1159. fight = false;
  1160. System.out.println("\nYou died!");
  1161. System.out.println("Lost some gold.");
  1162. gold *= 0.5;
  1163. hp = hpMax;
  1164. home();
  1165. }
  1166. }
  1167. }
  1168.  
  1169. public static void spider() throws InterruptedException{
  1170. fight = true;
  1171. m_hp = 15;
  1172. System.out.println(mons[3]);
  1173.  
  1174. while(fight == true){
  1175. m_dmg = r.nextInt(5);
  1176. goldDrop = 1+r.nextInt(30);
  1177. monsterDrop = 1+r.nextInt(5);
  1178. poison = 1+r.nextInt(5);
  1179. poisondmg = 1+r.nextInt(5);
  1180. dmg = r.nextInt(str);
  1181. dmg *= 0.5;
  1182. healSelf = 1+r.nextInt(3);
  1183. healSelfAmount = 1+r.nextInt(5);
  1184. System.out.println("Spider (HP:" + m_hp + "/15) does " + m_dmg + " damage");
  1185. if(poison == 1){
  1186. System.out.println("+" + poisondmg + " poison damage!");
  1187. hp -= poisondmg;
  1188. }
  1189. hp -= m_dmg;
  1190. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  1191. m_hp -= dmg;
  1192. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  1193. System.out.println(healSelfAmount + "+ heal!");
  1194. hp += healSelfAmount;
  1195. if(hp > hpMax){
  1196. hp = hpMax;
  1197. }
  1198. }
  1199. System.out.println();
  1200. Thread.sleep(1500);
  1201.  
  1202. if(m_hp <= 0){
  1203. fight = false;
  1204. System.out.println("You killed the spider\nGained 30 exp\nDrops:\nGold x" + goldDrop);
  1205. if(monsterDrop == 1){
  1206. System.out.println("Potion");
  1207. potion = true;
  1208. potionCount += 1;
  1209. }
  1210. gold += goldDrop;
  1211. exp += 30;
  1212. lvlsystem();
  1213. }else if(hp <= 0){
  1214. fight = false;
  1215. System.out.println("\nYou died!");
  1216. System.out.println("Lost some gold.");
  1217. gold *= 0.5;
  1218. hp = hpMax;
  1219. home();
  1220. }else if(hp <= 0 && m_hp <= 0){
  1221. fight = false;
  1222. System.out.println("\nYou died!");
  1223. System.out.println("Lost some gold.");
  1224. gold *= 0.5;
  1225. hp = hpMax;
  1226. home();
  1227. }
  1228. }
  1229. }
  1230.  
  1231. public static void snake() throws InterruptedException{
  1232. fight = true;
  1233. m_hp = 15;
  1234. System.out.println(mons[4]);
  1235.  
  1236. while(fight == true){
  1237. m_dmg = r.nextInt(5);
  1238. goldDrop = 1+r.nextInt(30);
  1239. monsterDrop = 1+r.nextInt(10);
  1240. poison = 1+r.nextInt(5);
  1241. poisondmg = 1+r.nextInt(5);
  1242. dmg = r.nextInt(str);
  1243. dmg *= 0.5;
  1244. healSelf = 1+r.nextInt(3);
  1245. healSelfAmount = 1+r.nextInt(5);
  1246. System.out.println("Snake (HP:" + m_hp + "/15) does " + m_dmg + " damage");
  1247. if(poison == 1){
  1248. System.out.println("+" + poisondmg + " poison damage!");
  1249. hp -= poisondmg;
  1250. }
  1251. hp -= m_dmg;
  1252. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  1253. m_hp -= dmg;
  1254. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  1255. System.out.println(healSelfAmount + "+ heal!");
  1256. hp += healSelfAmount;
  1257. if(hp > hpMax){
  1258. hp = hpMax;
  1259. }
  1260. }
  1261. System.out.println();
  1262. Thread.sleep(1500);
  1263.  
  1264. if(m_hp <= 0){
  1265. fight = false;
  1266. System.out.println("You killed the snake\nGained 30 exp\nDrops:\nGold x" + goldDrop);
  1267. if(monsterDrop == 1 && poisonRing == false){
  1268. System.out.println("Poison ring");
  1269. poisonRing = true;
  1270. }
  1271. gold += goldDrop;
  1272. exp += 30;
  1273. lvlsystem();
  1274. }else if(hp <= 0){
  1275. fight = false;
  1276. System.out.println("\nYou died!");
  1277. System.out.println("Lost some gold.");
  1278. gold *= 0.5;
  1279. hp = hpMax;
  1280. home();
  1281. }else if(hp <= 0 && m_hp <= 0){
  1282. fight = false;
  1283. System.out.println("\nYou died!");
  1284. System.out.println("Lost some gold.");
  1285. gold *= 0.5;
  1286. hp = hpMax;
  1287. home();
  1288. }
  1289. }
  1290. }
  1291.  
  1292. public static void troll() throws InterruptedException{
  1293. fight = true;
  1294. m_hp = 20;
  1295. System.out.println(mons[5]);
  1296.  
  1297. while(fight == true){
  1298. m_dmg = r.nextInt(6);
  1299. goldDrop = 1+r.nextInt(40);
  1300. monsterDrop = 1+r.nextInt(15);
  1301. dmg = r.nextInt(str);
  1302. dmg *= 0.5;
  1303. healSelf = 1+r.nextInt(3);
  1304. healSelfAmount = 1+r.nextInt(5);
  1305. System.out.println("Troll (HP:" + m_hp + "/20) does " + m_dmg + " damage");
  1306. hp -= m_dmg;
  1307. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  1308. m_hp -= dmg;
  1309. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  1310. System.out.println(healSelfAmount + "+ heal!");
  1311. hp += healSelfAmount;
  1312. if(hp > hpMax){
  1313. hp = hpMax;
  1314. }
  1315. }
  1316. System.out.println();
  1317. Thread.sleep(1500);
  1318.  
  1319. if(m_hp <= 0){
  1320. fight = false;
  1321. System.out.println("You killed the troll\nGained 35 exp\nDrops:\nGold x" + goldDrop);
  1322. if(monsterDrop == 1 && rockHammer == false){
  1323. System.out.println("Rock hammer");
  1324. rockHammer = true;
  1325. }
  1326. gold += goldDrop;
  1327. exp += 35;
  1328. lvlsystem();
  1329. }else if(hp <= 0){
  1330. fight = false;
  1331. System.out.println("\nYou died!");
  1332. System.out.println("Lost some gold.");
  1333. gold *= 0.5;
  1334. hp = hpMax;
  1335. home();
  1336. }else if(hp <= 0 && m_hp <= 0){
  1337. fight = false;
  1338. System.out.println("\nYou died!");
  1339. System.out.println("Lost some gold.");
  1340. gold *= 0.5;
  1341. hp = hpMax;
  1342. home();
  1343. }
  1344. }
  1345. }
  1346.  
  1347. public static void dragonWorld() throws InterruptedException{
  1348. System.out.println("\nYou are in DragonWorld.");
  1349. System.out.println("You see a strange portal and a wizard.");
  1350. System.out.println("Options: [T]alk, [N]orth, [E]ast");
  1351. option = i.nextLine().toLowerCase();
  1352.  
  1353. while(area == true){
  1354. if(option.equals("t")){
  1355. System.out.println("\nWizard: Would you like to go back?");
  1356. System.out.println("Wizard: Don't worry, it's free to go back.");
  1357. System.out.println("Options: [Y]es, [N]o");
  1358. option = i.nextLine().toLowerCase();
  1359.  
  1360. while(area == true){
  1361. if(option.equals("y")){
  1362. System.out.println("\nYou walk into the portal...");
  1363. cave();
  1364. }else if(option.equals("n")){
  1365. System.out.println("\nWizard: If you ever want to go back, feel free to talk to me.");
  1366. dragonWorld();
  1367. }else{
  1368. option = i.nextLine().toLowerCase();
  1369. }
  1370. }
  1371. }else if(option.equals("n")){
  1372. System.out.println("\nYou went north.");
  1373. dragonWorld2();
  1374. }else if(option.equals("e")){
  1375. System.out.println("\nYou went east.");
  1376. System.out.println("You see a magical looking forest and a sign.");
  1377. System.out.println("Options: [E]nter, [R]ead, [W]est");
  1378. option = i.nextLine().toLowerCase();
  1379. while(area == true){
  1380. if(option.equals("e")){
  1381. System.out.println("\nYou enter the forest...");
  1382. magicForest();
  1383. }else if(option.equals("r")){
  1384. System.out.println("\nYou read the sign, it says:");
  1385. System.out.println("\"Beware! Powerful monsters!\"");
  1386. option = i.nextLine().toLowerCase();
  1387. }else if(option.equals("w")){
  1388. System.out.println("\nYou went west.");
  1389. dragonWorld();
  1390. }else{
  1391. option = i.nextLine().toLowerCase();
  1392. }
  1393. }
  1394. }else{
  1395. option = i.nextLine().toLowerCase();
  1396. }
  1397. }
  1398. }
  1399.  
  1400. public static void dragonWorld2() throws InterruptedException{
  1401. System.out.println("\nYou are in DragonWorld");
  1402. System.out.println("Options: [I]nn, [S]hop, [N]orth, S[o]uth");
  1403. option = i.nextLine().toLowerCase();
  1404.  
  1405. while(area == true){
  1406. if(option.equals("i")){
  1407. inn();
  1408. }else if(option.equals("s")){
  1409. shop2();
  1410. }else if(option.equals("n")){
  1411. System.out.println("\nYou went north.");
  1412. toSkyIsland();
  1413. }else if(option.equals("o")){
  1414. System.out.println("\nYou went south.");
  1415. dragonWorld();
  1416. }else{
  1417. option = i.nextLine().toLowerCase();
  1418. }
  1419. }
  1420. }
  1421.  
  1422. public static void inn() throws InterruptedException{
  1423. System.out.println("\nYou are in the inn.");
  1424. System.out.println("Options: [E]xit, [T]alk, [I]nventory, [S]tats");
  1425. option = i.nextLine().toLowerCase();
  1426.  
  1427. while(area == true){
  1428.  
  1429. if(option.equals("e")){
  1430. dragonWorld2();
  1431. }else if(option.equals("t")){
  1432. System.out.println("\nInn keeper: Hello, how can I help you?");
  1433. System.out.println("Options: [R]est, [N]ever mind");
  1434. option = i.nextLine().toLowerCase();
  1435.  
  1436. while(area == true){
  1437. if(option.equals("r")){
  1438. if(hp < hpMax){
  1439. System.out.println("\nInn keeper: That will be 175 gold.");
  1440. System.out.println("Options: [O]K, [N]ever mind");
  1441. option = i.nextLine().toLowerCase();
  1442.  
  1443. while(area == true){
  1444. if(option.equals("o")){
  1445. if(gold >= 175){
  1446. System.out.println("\nYou rested well!");
  1447. gold -= 175;
  1448. hp = hpMax;
  1449. inn();
  1450. }else{
  1451. System.out.println("\nInn keeper: You don't have enough, come back later.");
  1452. inn();
  1453. }
  1454. }else if(option.equals("n")){
  1455. inn();
  1456. }else{
  1457. option = i.nextLine().toLowerCase();
  1458. }
  1459. }
  1460. }else{
  1461. System.out.println("\nI don't feel like resting right now.");
  1462. inn();
  1463. }
  1464. }else if(option.equals("n")){
  1465. inn();
  1466. }else{
  1467. option = i.nextLine().toLowerCase();
  1468. }
  1469. }
  1470. }else if(option.equals("i")){
  1471. System.out.println("\nInventory\n\nItems\t\t\t\tDescription\n");
  1472. if(potion == false && dagger == false && torch == false && shield == false && crystalHelm == false && crystalGloves == false &&
  1473. crystalBoots == false && poisonRing == false && medPotion == false && highPotion == false && hpPotion == false && strPotion == false
  1474. && holyAmulet == false && leafShield == false && phoenixPet == false && dragonWings == false && dragonPants == false
  1475. && dragonBody == false && gold == 0){
  1476. System.out.println("Empty");
  1477. option = i.nextLine().toLowerCase();
  1478. }else{
  1479.  
  1480. if(gold >= 10){
  1481. System.out.println("Gold x" + gold + "\t\t\tGold is always welcome.");
  1482. }else if(gold < 10){
  1483. System.out.println("Gold x" + gold + "\t\t\t\tGold is always welcome.");
  1484. }
  1485.  
  1486. if(potion == true){
  1487. System.out.println(items[0] + " x" + potionCount + "\t\t\tHeals 5 HP");
  1488. }
  1489.  
  1490. if(medPotion == true){
  1491. System.out.println("[M]edium Potion x" + medPotionCount + "\t\tHeals 15 HP");
  1492. }
  1493.  
  1494. if(highPotion == true){
  1495. System.out.println(items2[0] + " x" + highPotionCount + "\t\tHeals 30 HP");
  1496. }
  1497.  
  1498. if(hpPotion == true){
  1499. System.out.println(items2[1] + " x" + hpPotionCount + "\t\t\t+10 HP");
  1500. }
  1501.  
  1502. if(strPotion == true){
  1503. System.out.println(items2[2] + " x" + strPotionCount + "\t\t+10 STR");
  1504. }
  1505.  
  1506. if(dagger == true){
  1507. if(daggerEquipped == true){
  1508. System.out.println(items[1] + " [Equipped]\t\t+3 STR");
  1509. }else{
  1510. System.out.println(items[1] + "\t\t\t+3 STR");
  1511. }
  1512.  
  1513. }
  1514.  
  1515. if(torch == true){
  1516. if(torchEquipped == true){
  1517. System.out.println(items[2] + " [Equipped]\t\tLights up dark areas.");
  1518. }else{
  1519. System.out.println(items[2] + "\t\t\tLights up dark areas.");
  1520. }
  1521. }
  1522.  
  1523. if(shield == true){
  1524. if(shieldEquipped == true){
  1525. System.out.println(items[3] + " [Equipped]\t\t+10 HP");
  1526. }else{
  1527. System.out.println(items[3] + "\t\t\t+10 HP");
  1528. }
  1529. }
  1530.  
  1531. if(crystalHelm == true){
  1532. if(crystalHelmEquipped == true){
  1533. System.out.println("Crystal [h]elm [Equipped]\t+25 HP");
  1534. }else{
  1535. System.out.println("Crystal [h]elm\t\t\t+25 HP");
  1536. }
  1537. }
  1538.  
  1539. if(crystalGloves == true){
  1540. if(crystalGlovesEquipped == true){
  1541. System.out.println("Crystal [g]loves [Equipped]\t+15 HP");
  1542. }else{
  1543. System.out.println("Crystal [g]loves\t\t+15 HP");
  1544. }
  1545. }
  1546.  
  1547. if(crystalBoots == true){
  1548. if(crystalBootsEquipped == true){
  1549. System.out.println("Crystal [b]oots [Equipped]\t+20 HP");
  1550. }else{
  1551. System.out.println("Crystal [b]oots\t\t\t+20 HP");
  1552. }
  1553. }
  1554.  
  1555. if(poisonRing == true){
  1556. if(poisonRingEquipped == true){
  1557. System.out.println("Poison [ri]ng [Equipped]\t+5 HP, +5 STR");
  1558. }else{
  1559. System.out.println("Poison [ri]ng\t\t\t+5 HP, +5 STR");
  1560. }
  1561. }
  1562.  
  1563. if(rockHammer == true){
  1564. if(rockHammerEquipped == true){
  1565. System.out.println("[R]ock hammer [Equipped]\t+10 STR");
  1566. }else{
  1567. System.out.println("[R]ock hammer\t\t\t+10 STR");
  1568. }
  1569. }
  1570.  
  1571. if(holyAmulet == true){
  1572. if(holyAmuletEquipped == true){
  1573. System.out.println("Holy [a]mulet [Equipped]\t+15 HP, +7 STR");
  1574. }else{
  1575. System.out.println("Holy [a]mulet\t\t\t+15 HP, +7 STR");
  1576. }
  1577. }
  1578.  
  1579. if(leafShield == true){
  1580. if(leafShieldEquipped == true){
  1581. System.out.println("Lea[f] Shield [Equipped]\t+30 HP, +5 STR");
  1582. }else{
  1583. System.out.println("Lea[f] Shield\t\t\t+30 HP, +5 STR");
  1584. }
  1585. }
  1586.  
  1587. if(phoenixPet == true){
  1588. if(phoenixPetEquipped == true){
  1589. System.out.println("Phoeni[x] Pet [Equipped]\tHeals you in combat.");
  1590. }else{
  1591. System.out.println("Phoeni[x] Pet\t\t\tHeals you in combat.");
  1592. }
  1593. }
  1594.  
  1595. if(dragonWings == true){
  1596. if(dragonWingsEquipped == true){
  1597. System.out.println("Dragon [w]ings [Equipped]\t+25 HP, +10 STR, FLY");
  1598. }else{
  1599. System.out.println("Dragon [w]ings\t\t\t+25 HP, +10 STR, FLY");
  1600. }
  1601. }
  1602.  
  1603. if(dragonPants == true){
  1604. if(dragonPantsEquipped == true){
  1605. System.out.println("Dragon [pa]nts [Equipped]\t+35 HP, +15 STR");
  1606. }else{
  1607. System.out.println("Dragon [pa]nts\t\t\t+35 HP, +15 STR");
  1608. }
  1609. }
  1610.  
  1611. if(dragonBody == true){
  1612. if(dragonBodyEquipped == true){
  1613. System.out.println("Dragon [bo]dy [Equipped]\t+50 HP, +25 STR");
  1614. }else{
  1615. System.out.println("Dragon [bo]dy\t\t\t+50 HP, +25 STR");
  1616. }
  1617. }
  1618.  
  1619.  
  1620. System.out.println("[E]xit");
  1621. option = i.nextLine().toLowerCase();
  1622.  
  1623. while(area == true){
  1624.  
  1625. if(option.equals("p") && potion == true){
  1626. if(hp == hpMax){
  1627. System.out.println("\nYou don't need to drink this right now.");
  1628. }else{
  1629. System.out.println("\nYou drink the Potion... some HP was restored!");
  1630. hp += 5;
  1631. potionCount -= 1;
  1632. if(hp > hpMax){
  1633. hp = hpMax;
  1634. }
  1635. if(potionCount == 0){
  1636. potion = false;
  1637. }
  1638.  
  1639. inn();
  1640. }
  1641. option = i.nextLine().toLowerCase();
  1642.  
  1643. }else if(option.equals("m") && medPotion == true){
  1644.  
  1645. if(hp == hpMax){
  1646. System.out.println("\nYou don't need to drink this right now.");
  1647. }else{
  1648. System.out.println("\nYou drink the Medium Potion... some HP was restored!");
  1649. hp += 15;
  1650. medPotionCount -= 1;
  1651. if(hp > hpMax){
  1652. hp = hpMax;
  1653. }
  1654. if(medPotionCount == 0){
  1655. medPotion = false;
  1656. }
  1657.  
  1658. inn();
  1659. }
  1660. option = i.nextLine().toLowerCase();
  1661.  
  1662. }else if(option.equals("hi") && highPotion == true){
  1663. if(hp == hpMax){
  1664. System.out.println("\nYou don't need to drink this right now.");
  1665. }else{
  1666. System.out.println("\nYou drink the High Potion... some HP was restored!");
  1667. hp += 30;
  1668. highPotionCount -= 1;
  1669. if(hp > hpMax){
  1670. hp = hpMax;
  1671. }
  1672. if(highPotionCount == 0){
  1673. highPotion = false;
  1674. }
  1675. inn();
  1676. }
  1677. option = i.nextLine().toLowerCase();
  1678.  
  1679. }else if(option.equals("hp") && hpPotion == true){
  1680. System.out.println("\nYou drink the +HP Potion... HP increased!");
  1681. hp += 10;
  1682. hpMax += 10;
  1683. hpPotionCount -= 1;
  1684. if(hpPotionCount == 0){
  1685. hpPotion = false;
  1686. }
  1687. inn();
  1688.  
  1689. }else if(option.equals("st") && strPotion == true){
  1690. System.out.println("\nYou drink the +STR Potion... STR increased!");
  1691. str += 10;
  1692. strPotionCount -= 1;
  1693. if(strPotionCount == 0){
  1694. strPotion = false;
  1695. }
  1696. inn();
  1697.  
  1698. }else if(option.equals("d") && dagger == true){
  1699. if(rockHammerEquipped == true){
  1700. System.out.println("\nPlease unequip the other weapon first!");
  1701. option = i.nextLine().toLowerCase();
  1702. }else if(daggerEquipped == false){
  1703. System.out.println("\nYou equip the dagger.");
  1704. daggerEquipped = true;
  1705. str += 3;
  1706. inn();
  1707. }else if(daggerEquipped == true){
  1708. System.out.println("\nYou unequip the dagger.");
  1709. daggerEquipped = false;
  1710. str -= 3;
  1711. inn();
  1712. }
  1713.  
  1714. }else if(option.equals("t") && torch == true){
  1715. if(torchEquipped == false){
  1716. System.out.println("\nYou equip the torch.");
  1717. torchEquipped = true;
  1718. inn();
  1719. }else if(torchEquipped == true){
  1720. System.out.println("\nYou unequip the torch.");
  1721. torchEquipped = false;
  1722. inn();
  1723. }
  1724. }else if(option.equals("s") && shield == true){
  1725. if(leafShieldEquipped == true){
  1726. System.out.println("\nPlease unequip the other shield first!");
  1727. option = i.nextLine().toLowerCase();
  1728. }else if(shieldEquipped == false){
  1729. System.out.println("\nYou equip the shield.");
  1730. shieldEquipped = true;
  1731. hp += 10;
  1732. hpMax += 10;
  1733. inn();
  1734. }else if(shieldEquipped == true){
  1735. System.out.println("\nYou unequip the shield.");
  1736. shieldEquipped = false;
  1737. hp -= 10;
  1738. hpMax -= 10;
  1739. inn();
  1740. }
  1741.  
  1742. }else if(option.equals("h") && crystalHelm == true){
  1743. if(crystalHelmEquipped == false){
  1744. System.out.println("\nYou equip the crystal helm.");
  1745. crystalHelmEquipped = true;
  1746. hp += 25;
  1747. hpMax += 25;
  1748. inn();
  1749. }else if(crystalHelmEquipped == true){
  1750. System.out.println("\nYou unequip the crystal helm.");
  1751. crystalHelmEquipped = false;
  1752. hp -= 25;
  1753. hpMax -= 25;
  1754. inn();
  1755. }
  1756.  
  1757. }else if(option.equals("g") && crystalGloves == true){
  1758. if(crystalGlovesEquipped == false){
  1759. System.out.println("\nYou equip the crystal gloves.");
  1760. crystalGlovesEquipped = true;
  1761. hp += 15;
  1762. hpMax += 15;
  1763. inn();
  1764. }else if(crystalGlovesEquipped == true){
  1765. System.out.println("\nYou unequip the crystal gloves.");
  1766. crystalGlovesEquipped = false;
  1767. hp -= 15;
  1768. hpMax -= 15;
  1769. inn();
  1770. }
  1771.  
  1772. }else if(option.equals("b") && crystalBoots == true){
  1773. if(crystalBootsEquipped == false){
  1774. System.out.println("\nYou equip the crystal boots.");
  1775. crystalBootsEquipped = true;
  1776. hp += 20;
  1777. hpMax += 20;
  1778. inn();
  1779. }else if(crystalBootsEquipped == true){
  1780. System.out.println("\nYou unequip the crystal boots.");
  1781. crystalBootsEquipped = false;
  1782. hp -= 20;
  1783. hpMax -= 20;
  1784. inn();
  1785. }
  1786.  
  1787. }else if(option.equals("ri") && poisonRing == true){
  1788. if(poisonRingEquipped == false){
  1789. System.out.println("\nYou equip the poison ring.");
  1790. poisonRingEquipped = true;
  1791. hp += 5;
  1792. hpMax += 5;
  1793. str += 5;
  1794. inn();
  1795. }else if(poisonRingEquipped == true){
  1796. System.out.println("\nYou unequip the poison ring.");
  1797. poisonRingEquipped = false;
  1798. hp -= 5;
  1799. hpMax -= 5;
  1800. str -= 5;
  1801. inn();
  1802. }
  1803.  
  1804. }else if(option.equals("r") && rockHammer == true){
  1805. if(daggerEquipped == true){
  1806. System.out.println("\nPlease unequip the other weapon first!");
  1807. option = i.nextLine().toLowerCase();
  1808. }else if(rockHammerEquipped == false){
  1809. System.out.println("\nYou equip the rock hammer.");
  1810. rockHammerEquipped = true;
  1811. str += 10;
  1812. inn();
  1813. }else if(rockHammerEquipped == true){
  1814. System.out.println("\nYou unequip the rock hammer.");
  1815. rockHammerEquipped = false;
  1816. str -= 10;
  1817. inn();
  1818. }
  1819.  
  1820. }else if(option.equals("a") && holyAmulet == true){
  1821. if(holyAmuletEquipped == false){
  1822. System.out.println("\nYou equip the holy amulet.");
  1823. holyAmuletEquipped = true;
  1824. hp += 15;
  1825. hpMax += 15;
  1826. str += 7;
  1827. inn();
  1828. }else if(holyAmuletEquipped == true){
  1829. System.out.println("\nYou unequip the holy amulet.");
  1830. holyAmuletEquipped = false;
  1831. hp -= 15;
  1832. hpMax -= 15;
  1833. str -= 7;
  1834. inn();
  1835. }
  1836. }else if(option.equals("f") && leafShield == true){
  1837. if(shieldEquipped == true){
  1838. System.out.println("\nPlease unequip the other shield first!");
  1839. option = i.nextLine().toLowerCase();
  1840. }else if(leafShieldEquipped == false){
  1841. System.out.println("\nYou equip the leaf shield.");
  1842. leafShieldEquipped = true;
  1843. hp += 30;
  1844. hpMax += 30;
  1845. str += 5;
  1846. inn();
  1847. }else if(leafShieldEquipped == true){
  1848. System.out.println("\nYou unequip the leaf shield.");
  1849. leafShieldEquipped = false;
  1850. hp -= 30;
  1851. hpMax -= 30;
  1852. str -= 5;
  1853. inn();
  1854. }
  1855. }else if(option.equals("x") && phoenixPet == true){
  1856. if(phoenixPetEquipped == false){
  1857. System.out.println("\nYou equip the phoenix pet.");
  1858. phoenixPetEquipped = true;
  1859. inn();
  1860. }else if(phoenixPetEquipped == true){
  1861. System.out.println("\nYou unequip the phoenix pet.");
  1862. phoenixPetEquipped = false;
  1863. inn();
  1864. }
  1865. }else if(option.equals("w") && dragonWings == true){
  1866.  
  1867. if(dragonWingsEquipped == false){
  1868. System.out.println("\nYou equip the dragon wings.");
  1869. dragonWingsEquipped = true;
  1870. hp += 25;
  1871. hpMax += 25;
  1872. str += 10;
  1873. inn();
  1874. }else if(dragonWingsEquipped == true){
  1875. System.out.println("\nYou unequip the dragon wings.");
  1876. dragonWingsEquipped = false;
  1877. hp -= 25;
  1878. hpMax -= 25;
  1879. str -= 10;
  1880. inn();
  1881. }
  1882.  
  1883. }else if(option.equals("pa") && dragonPants == true){
  1884.  
  1885. if(dragonPantsEquipped == false){
  1886. System.out.println("\nYou equip the dragon pants.");
  1887. dragonPantsEquipped = true;
  1888. hp += 35;
  1889. hpMax += 35;
  1890. str += 15;
  1891. inn();
  1892. }else if(dragonPantsEquipped == true){
  1893. System.out.println("\nYou unequip the dragon pants.");
  1894. dragonPantsEquipped = false;
  1895. hp -= 35;
  1896. hpMax -= 35;
  1897. str -= 15;
  1898. inn();
  1899. }
  1900.  
  1901. }else if(option.equals("e")){
  1902. inn();
  1903.  
  1904. }else if(option.equals("bo") && dragonBody == true){
  1905.  
  1906. if(dragonBodyEquipped == false){
  1907. System.out.println("\nYou equip the dragon body.");
  1908. dragonBodyEquipped = true;
  1909. hp += 50;
  1910. hpMax += 50;
  1911. str += 25;
  1912. inn();
  1913. }else if(dragonBodyEquipped == true){
  1914. System.out.println("\nYou unequip the dragon body.");
  1915. dragonBodyEquipped = false;
  1916. hp -= 50;
  1917. hpMax -= 50;
  1918. str -= 25;
  1919. inn();
  1920. }
  1921.  
  1922. }else{
  1923. option = i.nextLine().toLowerCase();
  1924. }
  1925.  
  1926. }
  1927. }
  1928. }else if(option.equals("s")){
  1929. System.out.println("\nStats\n");
  1930. System.out.println("Name: " + name);
  1931. System.out.println("LVL: " + lvl);
  1932. System.out.println("HP: " + hp + "/" + hpMax);
  1933. System.out.println("STR: " + str);
  1934. System.out.println("Next LVL in: " + nextLvl + " exp");
  1935. System.out.println("Total exp: " + totalExp);
  1936. option = i.nextLine().toLowerCase();
  1937. }else{
  1938. option = i.nextLine().toLowerCase();
  1939. }
  1940. }
  1941.  
  1942. }
  1943.  
  1944. public static void shop2() throws InterruptedException{
  1945. System.out.println("\nYou are in the shop.");
  1946. System.out.println("Options: [B]uy, [E]xit");
  1947. option = i.nextLine().toLowerCase();
  1948.  
  1949. while(area == true){
  1950.  
  1951. if(option.equals("b")){
  1952. System.out.println("\nShop keeper: Hello, how can I help you?\nYou have " + gold + " gold.");
  1953. System.out.println("\nItems\t\tPrice");
  1954.  
  1955. for(int y = 0; y < items2.length && y < price2.length; y++){
  1956. System.out.println(items2[y] + "\t" + price2[y]);
  1957. }
  1958. System.out.println("[E]xit");
  1959. option = i.nextLine().toLowerCase();
  1960.  
  1961. while(area == true){
  1962.  
  1963. if(option.equals("hi")){
  1964. if(gold >= 75){
  1965. gold -= 75;
  1966. System.out.println("\nYou buy a high potion.");
  1967. option = i.nextLine().toLowerCase();
  1968. highPotionCount++;
  1969. highPotion = true;
  1970.  
  1971. }else{
  1972. System.out.println("\nNot enough money!");
  1973. option = i.nextLine().toLowerCase();
  1974. }
  1975.  
  1976. }else if(option.equals("hp")){
  1977.  
  1978. if(gold >= 350){
  1979. gold -= 350;
  1980. System.out.println("\nYou buy a +HP potion.");
  1981. option = i.nextLine().toLowerCase();
  1982. hpPotionCount++;
  1983. hpPotion = true;
  1984.  
  1985. }else{
  1986. System.out.println("\nNot enough money!");
  1987. option = i.nextLine().toLowerCase();
  1988. }
  1989.  
  1990. }else if(option.equals("st")){
  1991. if(gold >= 700){
  1992. gold -= 700;
  1993. System.out.println("\nYou buy a +STR potion.");
  1994. option = i.nextLine().toLowerCase();
  1995. strPotionCount++;
  1996. strPotion = true;
  1997. }else{
  1998. System.out.println("\nNot enough money!");
  1999. option = i.nextLine().toLowerCase();
  2000. }
  2001.  
  2002. }else if(option.equals("e")){
  2003. System.out.println("\nYou exit the shop.");
  2004. dragonWorld2();
  2005. }else{
  2006. option = i.nextLine().toLowerCase();
  2007. }
  2008. }
  2009.  
  2010. }else if(option.equals("e")){
  2011. System.out.println("\nYou exit the shop.");
  2012. dragonWorld2();
  2013. }else{
  2014. option = i.nextLine().toLowerCase();
  2015. }
  2016. }
  2017. }
  2018.  
  2019. public static void unicorn() throws InterruptedException{
  2020. fight = true;
  2021. m_hp = 35;
  2022. System.out.println(mons[6]);
  2023.  
  2024. while(fight == true){
  2025. m_dmg = r.nextInt(10);
  2026. goldDrop = 1+r.nextInt(75);
  2027. monsterDrop = 1+r.nextInt(15);
  2028. dmg = r.nextInt(str);
  2029. dmg *= 0.5;
  2030. healSelf = 1+r.nextInt(3);
  2031. healSelfAmount = 1+r.nextInt(5);
  2032. System.out.println("Unicorn (HP:" + m_hp + "/35) does " + m_dmg + " damage");
  2033. hp -= m_dmg;
  2034. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage\n");
  2035. m_hp -= dmg;
  2036. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  2037. System.out.println(healSelfAmount + "+ heal!");
  2038. hp += healSelfAmount;
  2039. if(hp > hpMax){
  2040. hp = hpMax;
  2041. }
  2042. }
  2043. System.out.println();
  2044. Thread.sleep(1500);
  2045.  
  2046. if(m_hp <= 0){
  2047. fight = false;
  2048. System.out.println("You killed the unicorn\nGained 65 exp\nDrops:\nGold x" + goldDrop);
  2049. if(monsterDrop == 1 && holyAmulet == false){
  2050. System.out.println("Holy amulet");
  2051. holyAmulet = true;
  2052. }
  2053. gold += goldDrop;
  2054. exp += 65;
  2055. lvlsystem();
  2056. }else if(hp <= 0){
  2057. fight = false;
  2058. System.out.println("\nYou died!");
  2059. System.out.println("Lost some gold.");
  2060. gold *= 0.5;
  2061. hp = hpMax;
  2062. home();
  2063. }else if(hp <= 0 && m_hp <= 0){
  2064. fight = false;
  2065. System.out.println("\nYou died!");
  2066. System.out.println("Lost some gold.");
  2067. gold *= 0.5;
  2068. hp = hpMax;
  2069. home();
  2070. }
  2071. }
  2072. }
  2073.  
  2074. public static void treeMonster() throws InterruptedException{
  2075. fight = true;
  2076. m_hp = 60;
  2077. System.out.println(mons[7]);
  2078.  
  2079. while(fight == true){
  2080. m_dmg = r.nextInt(6);
  2081. goldDrop = 1+r.nextInt(50);
  2082. monsterDrop = 1+r.nextInt(15);
  2083. dmg = r.nextInt(str);
  2084. dmg *= 0.5;
  2085. healSelf = 1+r.nextInt(3);
  2086. healSelfAmount = 1+r.nextInt(5);
  2087. System.out.println("Tree monster (HP:" + m_hp + "/60) does " + m_dmg + " damage");
  2088. hp -= m_dmg;
  2089. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  2090. m_hp -= dmg;
  2091. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  2092. System.out.println(healSelfAmount + "+ heal!");
  2093. hp += healSelfAmount;
  2094. if(hp > hpMax){
  2095. hp = hpMax;
  2096. }
  2097. }
  2098. System.out.println();
  2099. Thread.sleep(1500);
  2100.  
  2101. if(m_hp <= 0){
  2102. fight = false;
  2103. System.out.println("You killed the tree monster\nGained 80 exp\nDrops:\nGold x" + goldDrop);
  2104. if(monsterDrop == 1 && leafShield == false){
  2105. System.out.println("Leaf shield");
  2106. leafShield = true;
  2107. }
  2108. gold += goldDrop;
  2109. exp += 80;
  2110. lvlsystem();
  2111. }else if(hp <= 0){
  2112. fight = false;
  2113. System.out.println("\nYou died!");
  2114. System.out.println("Lost some gold.");
  2115. gold *= 0.5;
  2116. hp = hpMax;
  2117. home();
  2118. }else if(hp <= 0 && m_hp <= 0){
  2119. fight = false;
  2120. System.out.println("\nYou died!");
  2121. System.out.println("Lost some gold.");
  2122. gold *= 0.5;
  2123. hp = hpMax;
  2124. home();
  2125. }
  2126. }
  2127. }
  2128.  
  2129. public static void phoenix() throws InterruptedException{
  2130. fight = true;
  2131. m_hp = 50;
  2132. System.out.println(mons[8]);
  2133.  
  2134. while(fight == true){
  2135. m_dmg = r.nextInt(5);
  2136. goldDrop = 1+r.nextInt(100);
  2137. monsterDrop = 1+r.nextInt(15);
  2138. heal = 1+r.nextInt(4);
  2139. healAmount = 1+r.nextInt(7);
  2140. dmg = r.nextInt(str);
  2141. dmg *= 0.5;
  2142. healSelf = 1+r.nextInt(3);
  2143. healSelfAmount = 1+r.nextInt(5);
  2144. System.out.println("Phoenix (HP:" + m_hp + "/50) does " + m_dmg + " damage");
  2145. if(heal == 1){
  2146. System.out.println("+" + healAmount + " heal!");
  2147. }
  2148. hp -= m_dmg;
  2149. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  2150. m_hp -= dmg;
  2151. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  2152. System.out.println(healSelfAmount + "+ heal!");
  2153. hp += healSelfAmount;
  2154. if(hp > hpMax){
  2155. hp = hpMax;
  2156. }
  2157. }
  2158. System.out.println();
  2159. Thread.sleep(1500);
  2160.  
  2161. if(m_hp <= 0){
  2162. fight = false;
  2163. System.out.println("You killed the phoenix\nGained 100 exp\nDrops:\nGold x" + goldDrop);
  2164. if(monsterDrop == 1 && phoenixPet == false){
  2165. System.out.println("Phoenix pet");
  2166. phoenixPet = true;
  2167. }
  2168. gold += goldDrop;
  2169. exp += 100;
  2170. lvlsystem();
  2171. }else if(hp <= 0){
  2172. fight = false;
  2173. System.out.println("\nYou died!");
  2174. System.out.println("Lost some gold.");
  2175. gold *= 0.5;
  2176. hp = hpMax;
  2177. home();
  2178. }else if(hp <= 0 && m_hp <= 0){
  2179. fight = false;
  2180. System.out.println("\nYou died!");
  2181. System.out.println("Lost some gold.");
  2182. gold *= 0.5;
  2183. hp = hpMax;
  2184. home();
  2185. }
  2186. }
  2187. }
  2188.  
  2189. public static void toSkyIsland() throws InterruptedException{
  2190. System.out.println("You see a sign and a boat.");
  2191. System.out.println("Options: [R]ead, R[i]de, [S]outh");
  2192. option = i.nextLine().toLowerCase();
  2193.  
  2194. while(area == true){
  2195. if(option.equals("r")){
  2196. System.out.println("\nYou read the sign, it says:");
  2197. System.out.println("\"Ride the boat to the dragon island\"");
  2198. option = i.nextLine().toLowerCase();
  2199. }else if(option.equals("i")){
  2200. System.out.println("\nYou ride the boat...");
  2201. Thread.sleep(1500);
  2202. whiteShark();
  2203. dragonIsland();
  2204. }else if(option.equals("s")){
  2205. System.out.println("\nYou went south.");
  2206. dragonWorld2();
  2207. }else{
  2208. option = i.nextLine().toLowerCase();
  2209. }
  2210. }
  2211. }
  2212.  
  2213. public static void whiteShark() throws InterruptedException{
  2214. fight = true;
  2215. m_hp = 80;
  2216. System.out.println(mons[9]);
  2217.  
  2218. while(fight == true){
  2219. m_dmg = r.nextInt(10);
  2220. goldDrop = 25+r.nextInt(150);
  2221. monsterDrop = 1+r.nextInt(15);
  2222. dmg = r.nextInt(str);
  2223. dmg *= 0.5;
  2224. healSelf = 1+r.nextInt(3);
  2225. healSelfAmount = 1+r.nextInt(5);
  2226. System.out.println("White shark (HP:" + m_hp + "/75) does " + m_dmg + " damage");
  2227. hp -= m_dmg;
  2228. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  2229. m_hp -= dmg;
  2230. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  2231. System.out.println(healSelfAmount + "+ heal!");
  2232. hp += healSelfAmount;
  2233. if(hp > hpMax){
  2234. hp = hpMax;
  2235. }
  2236. }
  2237. System.out.println();
  2238. Thread.sleep(1500);
  2239.  
  2240. if(m_hp <= 0){
  2241. fight = false;
  2242. System.out.println("You killed the white shark\nGained 120 exp\nDrops:\nGold x" + goldDrop);
  2243. gold += goldDrop;
  2244. exp += 120;
  2245. lvlsystem();
  2246. }else if(hp <= 0){
  2247. fight = false;
  2248. System.out.println("\nYou died!");
  2249. System.out.println("Lost some gold.");
  2250. gold *= 0.5;
  2251. hp = hpMax;
  2252. home();
  2253. }else if(hp <= 0 && m_hp <= 0){
  2254. fight = false;
  2255. System.out.println("\nYou died!");
  2256. System.out.println("Lost some gold.");
  2257. gold *= 0.5;
  2258. hp = hpMax;
  2259. home();
  2260. }
  2261. }
  2262. }
  2263.  
  2264. public static void dragonIsland() throws InterruptedException{
  2265. System.out.println("\nYou are in the dragon island");
  2266. System.out.println("You see a sign and a boat.");
  2267. System.out.println("Options: [R]ead, R[i]de, [N]orth, [E]ast");
  2268. option = i.nextLine().toLowerCase();
  2269.  
  2270. while(area == true){
  2271. if(option.equals("i")){
  2272. System.out.println("\nYou ride the boat back...");
  2273. Thread.sleep(1500);
  2274. whiteShark();
  2275. toSkyIsland();
  2276. }else if(option.equals("r")){
  2277. System.out.println("\nYou read the sign, it says:");
  2278. System.out.println("\"Welcome to the dragon island\"");
  2279. option = i.nextLine().toLowerCase();
  2280. }else if(option.equals("e")){
  2281. System.out.println("\nYou went east.");
  2282. System.out.println("\nYou are in the dragon island.");
  2283. System.out.println("You see a cave and a warning sign.");
  2284. System.out.println("Options: [R]ead, [E]nter, [W]est");
  2285. option = i.nextLine().toLowerCase();
  2286. while(area == true){
  2287. if(option.equals("r")){
  2288. System.out.println("\nYou read the sign, it says:");
  2289. System.out.println("\"Beware! Baby dragons!\"");
  2290. option = i.nextLine().toLowerCase();
  2291. }else if(option.equals("e")){
  2292. System.out.println("\nYou enter the cave...");
  2293. dragonCave();
  2294. }else if(option.equals("w")){
  2295. System.out.println("\nYou went west.");
  2296. dragonIsland();
  2297. }else{
  2298. option = i.nextLine().toLowerCase();
  2299. }
  2300. }
  2301. }else if(option.equals("n")){
  2302. System.out.println("\nYou went north.");
  2303. System.out.println("\nYou are in the dragon island.");
  2304. System.out.println("You see an old man.");
  2305. System.out.println("Options: [T]alk, [F]ly, [S]outh");
  2306. option = i.nextLine().toLowerCase();
  2307.  
  2308. while(area == true){
  2309. if(option.equals("t")){
  2310. System.out.println("\nOld Man: See that island above us? That's the Sky Island.");
  2311. System.out.println("Old Man: I hear the dragon is up there...");
  2312. System.out.println("Old Man: There's no way to get up there, unless you can fly. HAHAHA!");
  2313. option = i.nextLine().toLowerCase();
  2314. }else if(option.equals("f")){
  2315. if(dragonWings == true && dragonWingsEquipped == true){
  2316. System.out.println("\nYou fly upwards...");
  2317. Thread.sleep(1500);
  2318. skyIsland();
  2319. }else{
  2320. System.out.println("\n..How am I going to fly?");
  2321. option = i.nextLine().toLowerCase();
  2322. }
  2323. }else if(option.equals("s")){
  2324. System.out.println("\nYou went south.");
  2325. dragonIsland();
  2326. }else{
  2327. option = i.nextLine().toLowerCase();
  2328. }
  2329. }
  2330. }else{
  2331. option = i.nextLine().toLowerCase();
  2332. }
  2333. }
  2334. }
  2335.  
  2336. public static void skyIsland() throws InterruptedException{
  2337. System.out.println("\nYou arrive at the Sky Island.");
  2338. System.out.println("You see a huge dragon in front of you.");
  2339. System.out.println("Options: [F]ight, [L]eave");
  2340. option = i.nextLine().toLowerCase();
  2341. while(area == true){
  2342. if(option.equals("f")){
  2343. System.out.println("\nYou charge the dragon...");
  2344. Thread.sleep(1500);
  2345. dragon();
  2346. }else if(option.equals("l")){
  2347. System.out.println("\nYou fly back down...");
  2348. Thread.sleep(1500);
  2349. dragonIsland();
  2350. }else{
  2351. option = i.nextLine().toLowerCase();
  2352. }
  2353. }
  2354. }
  2355.  
  2356. public static void dragonCave() throws InterruptedException{
  2357. System.out.println("\nYou are in the dragon cave.");
  2358. System.out.println("Options: [E]xit, [N]orth, [S]outh");
  2359. option = i.nextLine().toLowerCase();
  2360.  
  2361. while(area == true){
  2362. if(option.equals("e")){
  2363. babyDragon();
  2364. System.out.println("\nYou exit the dragon cave...");
  2365. dragonIsland();
  2366. }else if(option.equals("n")){
  2367. babyDragon();
  2368. System.out.println("\nYou went north.");
  2369. System.out.println("You are in the dragon cave.");
  2370. System.out.println("Options: [S]outh");
  2371. while(area == true){
  2372. if(option.equals("s")){
  2373. babyDragon();
  2374. System.out.println("\nYou went south.");
  2375. dragonCave();
  2376. }
  2377. }
  2378. }else if(option.equals("s")){
  2379. babyDragon();
  2380. System.out.println("\nYou went south.");
  2381. System.out.println("You are in the dragon cave.");
  2382. System.out.println("Options: [N]orth");
  2383. option = i.nextLine().toLowerCase();
  2384. while(area == true){
  2385. if(option.equals("n")){
  2386. babyDragon();
  2387. System.out.println("\nYou went north.");
  2388. dragonCave();
  2389. }else{
  2390. option = i.nextLine().toLowerCase();
  2391. }
  2392. }
  2393. }else{
  2394. option = i.nextLine().toLowerCase();
  2395. }
  2396. }
  2397. }
  2398.  
  2399. public static void babyDragon() throws InterruptedException{
  2400. fight = true;
  2401. m_hp = 100;
  2402. System.out.println(mons[10]);
  2403.  
  2404. while(fight == true){
  2405. m_dmg = r.nextInt(10);
  2406. goldDrop = 25+r.nextInt(250);
  2407. monsterDrop = 1+r.nextInt(15);
  2408. dmg = r.nextInt(str);
  2409. dmg *= 0.5;
  2410. healSelf = 1+r.nextInt(3);
  2411. healSelfAmount = 1+r.nextInt(5);
  2412. System.out.println("Baby dragon (HP:" + m_hp + "/100) does " + m_dmg + " damage");
  2413. hp -= m_dmg;
  2414. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  2415. m_hp -= dmg;
  2416. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  2417. System.out.println(healSelfAmount + "+ heal!");
  2418. hp += healSelfAmount;
  2419. if(hp > hpMax){
  2420. hp = hpMax;
  2421. }
  2422. }
  2423.  
  2424.  
  2425. System.out.println();
  2426. Thread.sleep(1500);
  2427.  
  2428. if(m_hp <= 0){
  2429. fight = false;
  2430. System.out.println("You killed the baby dragon\nGained 180 exp\nDrops:\nGold x" + goldDrop);
  2431. gold += goldDrop;
  2432. exp += 180;
  2433. if(monsterDrop == 1 && dragonWings == false){
  2434. dragonWings = true;
  2435. System.out.println("Dragon wings");
  2436.  
  2437. }
  2438. if(monsterDrop == 2 && dragonPants == false){
  2439. dragonPants = true;
  2440. System.out.println("Dragon pants");
  2441. }
  2442. if(monsterDrop == 3 && dragonBody == false){
  2443. dragonBody = true;
  2444. System.out.println("Dragon body");
  2445. }
  2446. lvlsystem();
  2447. }else if(hp <= 0){
  2448. fight = false;
  2449. System.out.println("\nYou died!");
  2450. System.out.println("Lost some gold.");
  2451. gold *= 0.5;
  2452. hp = hpMax;
  2453. home();
  2454. }else if(hp <= 0 && m_hp <= 0){
  2455. fight = false;
  2456. System.out.println("\nYou died!");
  2457. System.out.println("Lost some gold.");
  2458. gold *= 0.5;
  2459. hp = hpMax;
  2460. home();
  2461. }
  2462. }
  2463. }
  2464.  
  2465. public static void magicForest() throws InterruptedException{
  2466. System.out.println("\nYou are in the magic forest.");
  2467. System.out.println("Options: [W]est, [E]ast, [N]orth, [S]outh");
  2468. option = i.nextLine().toLowerCase();
  2469.  
  2470. while(area == true){
  2471. if(option.equals("w")){
  2472. magicForestMonsters();
  2473. System.out.println("\nYou went west.");
  2474. dragonWorld();
  2475. }else if(option.equals("e")){
  2476. magicForestMonsters();
  2477. System.out.println("\nYou went east.");
  2478. System.out.println("You are in the magic forest.");
  2479. System.out.println("Options: [W]est");
  2480. option = i.nextLine().toLowerCase();
  2481. while(area == true){
  2482. if(option.equals("w")){
  2483. magicForestMonsters();
  2484. System.out.println("\nYou went west.");
  2485. magicForest();
  2486. }else{
  2487. option = i.nextLine().toLowerCase();
  2488. }
  2489. }
  2490. }else if(option.equals("n")){
  2491. magicForestMonsters();
  2492. System.out.println("\nYou went north.");
  2493. System.out.println("You are in the magic forest.");
  2494. System.out.println("Options: [S]outh");
  2495. option = i.nextLine().toLowerCase();
  2496. while(area == true){
  2497. if(option.equals("s")){
  2498. magicForestMonsters();
  2499. System.out.println("\nYou went south.");
  2500. magicForest();
  2501. }else{
  2502. option = i.nextLine().toLowerCase();
  2503. }
  2504. }
  2505. }else if(option.equals("s")){
  2506. magicForestMonsters();
  2507. System.out.println("\nYou went south.");
  2508. System.out.println("You are in the magic forest.");
  2509. System.out.println("Options: [N]orth");
  2510. option = i.nextLine().toLowerCase();
  2511. while(area == true){
  2512. if(option.equals("n")){
  2513. magicForestMonsters();
  2514. System.out.println("\nYou went north.");
  2515. magicForest();
  2516. }else{
  2517. option = i.nextLine().toLowerCase();
  2518. }
  2519. }
  2520. }else{
  2521. option = i.nextLine().toLowerCase();
  2522. }
  2523. }
  2524. }
  2525.  
  2526. public static void magicForestMonsters() throws InterruptedException{
  2527. int mfm = 1+r.nextInt(5);
  2528.  
  2529. if(mfm == 1){
  2530. unicorn();
  2531. }else if(mfm == 2){
  2532. treeMonster();
  2533. }else if(mfm == 3){
  2534. phoenix();
  2535. }
  2536. }
  2537.  
  2538. public static void dragon() throws InterruptedException{
  2539.  
  2540. fight = true;
  2541. m_hp = 350;
  2542. int attStyle;
  2543. System.out.println(mons[11]);
  2544.  
  2545. while(fight == true){
  2546. m_dmg = r.nextInt(15);
  2547. dmg = r.nextInt(str);
  2548. dmg *= 0.5;
  2549. healSelf = 1+r.nextInt(3);
  2550. healSelfAmount = 1+r.nextInt(5);
  2551. attStyle = 1+r.nextInt(4);
  2552. fireBreath = 5+r.nextInt(10);
  2553. tailWhip = 3+r.nextInt(5);
  2554. System.out.println("Dragon (HP:" + m_hp + "/350) does " + m_dmg + " damage");
  2555. if(attStyle == 1){
  2556. System.out.println("+" + fireBreath + " fire breath damage!");
  2557. hp -= fireBreath;
  2558. }else if(attStyle == 2){
  2559. System.out.println("+" + tailWhip + " tail whip damage!");
  2560. hp -= tailWhip;
  2561. }
  2562. hp -= m_dmg;
  2563. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  2564. m_hp -= dmg;
  2565. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  2566. System.out.println(healSelfAmount + "+ heal!");
  2567. hp += healSelfAmount;
  2568. if(hp > hpMax){
  2569. hp = hpMax;
  2570. }
  2571. }
  2572. System.out.println();
  2573. Thread.sleep(1500);
  2574.  
  2575. if(m_hp <= 0){
  2576. fight = false;
  2577. System.out.println("\nYou defeat the dragon...");
  2578. Thread.sleep(2500);
  2579. System.out.println("\nYou finally had your revenge...");
  2580. Thread.sleep(2500);
  2581. System.out.println("\nYour quest is finally over...");
  2582. Thread.sleep(2500);
  2583. System.out.println("\nYou're now known as...");
  2584. Thread.sleep(2500);
  2585. System.out.println("\n" + name + " the DragonSlayer...");
  2586. Thread.sleep(2500);
  2587. System.out.println("\nThe one and only DragonSlayer...");
  2588. Thread.sleep(2500);
  2589. System.out.println("\nEnd");
  2590. Thread.sleep(2500);
  2591. area = false;
  2592. }else if(hp <= 0){
  2593. fight = false;
  2594. System.out.println("\nYou died!");
  2595. System.out.println("Lost some gold.");
  2596. gold *= 0.5;
  2597. hp = hpMax;
  2598. home();
  2599. }else if(hp <= 0 && m_hp <= 0){
  2600. fight = false;
  2601. System.out.println("\nYou died!");
  2602. System.out.println("Lost some gold.");
  2603. gold *= 0.5;
  2604. hp = hpMax;
  2605. home();
  2606. }
  2607. }
  2608.  
  2609. }
  2610. }
Advertisement
Add Comment
Please, Sign In to add comment