dsun

Untitled

Feb 5th, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 59.98 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.util.Random;
  3.  
  4. public class Main {
  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"};
  13. public static int hp, hpMax, lvl, exp, totalExp, nextLvl, gold, goldDrop, potionCount, medPotionCount, highPotionCount, hpPotionCount, strPotionCount,
  14. q_bearClawCount, monsterDrop, chest, pool, chestLoot, str, dmg, m_dmg, m_hp, poison, poisondmg, heal, healAmount, healSelf, healSelfAmount;
  15. static int price[] = {25, 50, 100, 125};
  16. static int price2[] = {75, 350, 700};
  17. static boolean area, quest, fight, potion, medPotion, highPotion, dagger, torch, daggerEquipped, torchEquipped, shield, shieldEquipped, q_bearClaw, questComplete,
  18. crystalHelm, crystalGloves, crystalBoots, crystalHelmEquipped, crystalGlovesEquipped, crystalBootsEquipped, poisonRing, poisonRingEquipped,
  19. rockHammer, rockHammerEquipped, hpPotion, strPotion, holyAmulet, holyAmuletEquipped, leafShield, leafShieldEquipped, phoenixPet, phoenixPetEquipped;
  20.  
  21. public static void main(String[] args) throws InterruptedException {
  22.  
  23. hp = 10;
  24. hpMax = 10;
  25. lvl = 1;
  26. exp = 0;
  27. totalExp = 0;
  28. nextLvl = 35;
  29. gold = 0;
  30. potionCount = 0;
  31. medPotionCount = 0;
  32. q_bearClawCount = 0;
  33. str = 5;
  34. area = true;
  35. fight = true;
  36.  
  37. System.out.println("###########################################################");
  38. System.out.println("# #");
  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. Thread.sleep(000);
  51.  
  52. System.out.println("\n\n[P]lay\n[Q]uit");
  53. option = i.nextLine().toLowerCase();
  54.  
  55. while(area == true){
  56. if(option.equals("p")){
  57. System.out.print("\nName: ");
  58. name = i.nextLine();
  59. System.out.println("\nAfter witnessing your whole family slaughtered by the dragon...");
  60. Thread.sleep(000);
  61. System.out.println("\nYou, known as " + name + ", swore to take revenge.");
  62. Thread.sleep(000);
  63. System.out.println("\nYour quest to kill the dragon begins now.");
  64. Thread.sleep(000);
  65. home();
  66. }else if(option.equals("q")){
  67. area = false;
  68. }else{
  69. option = i.nextLine().toLowerCase();
  70. }
  71. }
  72. }
  73.  
  74. public static void home() throws InterruptedException{
  75. System.out.println("\nYou are in your home.");
  76. System.out.println("Options: [E]xit, [R]est, [I]nventory, [S]tats");
  77. option = i.nextLine().toLowerCase();
  78.  
  79. while(area == true){
  80.  
  81. if(option.equals("e")){
  82. town();
  83. }else if(option.equals("r")){
  84. if(hp < 5){
  85. hp = hpMax;
  86. System.out.println("\nYou rested well!");
  87. option = i.nextLine().toLowerCase();
  88. }else{
  89. System.out.println("\nYou don't feel like resting.");
  90. option = i.nextLine().toLowerCase();
  91. }
  92. }else if(option.equals("i")){
  93. System.out.println("\nInventory\n\nItems\t\t\t\tDescription\n");
  94. if(potion == false && dagger == false && torch == false && shield == false && crystalHelm == false && crystalGloves == false &&
  95. crystalBoots == false && poisonRing == false && medPotion == false && highPotion == false && hpPotion == false && strPotion == false && gold == 0){
  96. System.out.println("Empty");
  97. option = i.nextLine().toLowerCase();
  98. }else{
  99.  
  100. if(gold >= 10){
  101. System.out.println("Gold x" + gold + "\t\t\tGold is always welcome.");
  102. }else if(gold < 10){
  103. System.out.println("Gold x" + gold + "\t\t\t\tGold is always welcome.");
  104. }
  105.  
  106. if(potion == true){
  107. System.out.println(items[0] + " x" + potionCount + "\t\t\tHeals 5 HP");
  108. }
  109.  
  110. if(medPotion == true){
  111. System.out.println("[M]edium Potion x" + medPotionCount + "\t\tHeals 15 HP");
  112. }
  113.  
  114. if(highPotion == true){
  115. System.out.println(items2[0] + " x" + highPotionCount + "\t\tHeals 30 HP");
  116. }
  117.  
  118. if(hpPotion == true){
  119. System.out.println(items2[1] + " x" + hpPotionCount + "\t\t\t+10 HP");
  120. }
  121.  
  122. if(strPotion == true){
  123. System.out.println(items2[2] + " x" + strPotionCount + "\t\t+10 STR");
  124. }
  125.  
  126. if(dagger == true){
  127. if(daggerEquipped == true){
  128. System.out.println(items[1] + " [Equipped]\t\t+3 STR");
  129. }else{
  130. System.out.println(items[1] + "\t\t\t+3 STR");
  131. }
  132.  
  133. }
  134.  
  135. if(torch == true){
  136. if(torchEquipped == true){
  137. System.out.println(items[2] + " [Equipped]\t\tLights up dark areas.");
  138. }else{
  139. System.out.println(items[2] + "\t\t\tLights up dark areas.");
  140. }
  141. }
  142.  
  143. if(shield == true){
  144. if(shieldEquipped == true){
  145. System.out.println(items[3] + " [Equipped]\t\t+10 HP");
  146. }else{
  147. System.out.println(items[3] + "\t\t\t+10 HP");
  148. }
  149. }
  150.  
  151. if(crystalHelm == true){
  152. if(crystalHelmEquipped == true){
  153. System.out.println("Crystal [h]elm [Equipped]\t+25 HP");
  154. }else{
  155. System.out.println("Crystal [h]elm\t\t\t+25 HP");
  156. }
  157. }
  158.  
  159. if(crystalGloves == true){
  160. if(crystalGlovesEquipped == true){
  161. System.out.println("Crystal [g]loves [Equipped]\t+15 HP");
  162. }else{
  163. System.out.println("Crystal [g]loves\t\t+15 HP");
  164. }
  165. }
  166.  
  167. if(crystalBoots == true){
  168. if(crystalBootsEquipped == true){
  169. System.out.println("Crystal [b]oots [Equipped]\t+20 HP");
  170. }else{
  171. System.out.println("Crystal [b]oots\t\t\t+20 HP");
  172. }
  173. }
  174.  
  175. if(poisonRing == true){
  176. if(poisonRingEquipped == true){
  177. System.out.println("[P]oison ring [Equipped]\t+5 HP, +5 STR");
  178. }else{
  179. System.out.println("[P]oison ring\t\t\t+5 HP, +5 STR");
  180. }
  181. }
  182.  
  183. if(rockHammer == true){
  184. if(rockHammerEquipped == true){
  185. System.out.println("[R]ock hammer [Equipped]\t+10 STR");
  186. }else{
  187. System.out.println("[R]ock hammer\t\t\t+10 STR");
  188. }
  189. }
  190.  
  191. if(holyAmulet == true){
  192. if(holyAmuletEquipped == true){
  193. System.out.println("Holy [a]mulet [Equipped]\t+15 HP, +7 STR");
  194. }else{
  195. System.out.println("Holy [a]mulet\t\t\t+15 HP, +7 STR");
  196. }
  197. }
  198.  
  199. if(leafShield == true){
  200. if(leafShieldEquipped == true){
  201. System.out.println("Lea[f] Shield [Equipped]\t+30 HP, +5 STR");
  202. }else{
  203. System.out.println("Lea[f] Shield\t\t\t+30 HP, +5 STR");
  204. }
  205. }
  206.  
  207. if(phoenixPet == true){
  208. if(phoenixPetEquipped == true){
  209. System.out.println("Phoeni[x] Pet [Equipped]\tHeals you in combat.");
  210. }else{
  211. System.out.println("Phoeni[x] Pet\t\t\tHeals you in combat.");
  212. }
  213. }
  214.  
  215. System.out.println("[E]xit");
  216. option = i.nextLine().toLowerCase();
  217.  
  218. while(area == true){
  219.  
  220. if(option.equals("p") && potion == true){
  221. if(hp == hpMax){
  222. System.out.println("\nYou don't need to drink this right now.");
  223. }else{
  224. System.out.println("\nYou drink the Potion... some HP was restored!");
  225. hp += 5;
  226. potionCount -= 1;
  227. if(hp > hpMax){
  228. hp = hpMax;
  229. }
  230. if(potionCount == 0){
  231. potion = false;
  232. }
  233.  
  234. home();
  235. }
  236. option = i.nextLine().toLowerCase();
  237.  
  238. }else if(option.equals("m") && medPotion == true){
  239.  
  240. if(hp == hpMax){
  241. System.out.println("\nYou don't need to drink this right now.");
  242. }else{
  243. System.out.println("\nYou drink the Medium Potion... some HP was restored!");
  244. hp += 15;
  245. medPotionCount -= 1;
  246. if(hp > hpMax){
  247. hp = hpMax;
  248. }
  249. if(medPotionCount == 0){
  250. potion = false;
  251. }
  252.  
  253. home();
  254. }
  255. option = i.nextLine().toLowerCase();
  256.  
  257. }else if(option.equals("hi") && highPotion == true){
  258.  
  259. if(hp == hpMax){
  260. System.out.println("\nYou don't need to drink this right now.");
  261. }else{
  262. System.out.println("\nYou drink the High Potion... some HP was restored!");
  263. hp += 30;
  264. highPotionCount -= 1;
  265. if(hp > hpMax){
  266. hp = hpMax;
  267. }
  268. if(highPotionCount == 0){
  269. highPotion = false;
  270. }
  271. home();
  272. }
  273. option = i.nextLine().toLowerCase();
  274.  
  275. }else if(option.equals("hp") && hpPotion == true){
  276. System.out.println("\nYou drink the +HP Potion... HP increased!");
  277. hp += 10;
  278. hpMax += 10;
  279. hpPotionCount -= 1;
  280. if(hpPotionCount == 0){
  281. hpPotion = false;
  282. }
  283. home();
  284.  
  285. }else if(option.equals("st") && strPotion == true){
  286. System.out.println("\nYou drink the +STR Potion... STR increased!");
  287. str += 10;
  288. strPotionCount -= 1;
  289. if(strPotionCount == 0){
  290. strPotion = false;
  291. }
  292. home();
  293.  
  294. }else if(option.equals("d") && dagger == true){
  295. if(rockHammerEquipped == true){
  296. System.out.println("\nPlease unequip the other weapon first!");
  297. option = i.nextLine().toLowerCase();
  298. }else if(daggerEquipped == false){
  299. System.out.println("\nYou equip the dagger.");
  300. daggerEquipped = true;
  301. str += 3;
  302. home();
  303. }else if(daggerEquipped == true){
  304. System.out.println("\nYou unequip the dagger.");
  305. daggerEquipped = false;
  306. str -= 3;
  307. home();
  308. }
  309.  
  310. }else if(option.equals("t") && torch == true){
  311. if(torchEquipped == false){
  312. System.out.println("\nYou equip the torch.");
  313. torchEquipped = true;
  314. home();
  315. }else if(torchEquipped == true){
  316. System.out.println("\nYou unequip the torch.");
  317. torchEquipped = false;
  318. home();
  319. }
  320. }else if(option.equals("s") && shield == true){
  321. if(leafShieldEquipped == true){
  322. System.out.println("\nPlease unequip the other shield first!");
  323. option = i.nextLine().toLowerCase();
  324. }else if(shieldEquipped == false){
  325. System.out.println("\nYou equip the shield.");
  326. shieldEquipped = true;
  327. hp += 10;
  328. hpMax += 10;
  329. home();
  330. }else if(shieldEquipped == true){
  331. System.out.println("\nYou unequip the shield.");
  332. shieldEquipped = false;
  333. hp -= 10;
  334. hpMax -= 10;
  335. home();
  336. }
  337.  
  338. }else if(option.equals("h") && crystalHelm == true){
  339. if(crystalHelmEquipped == false){
  340. System.out.println("\nYou equip the crystal helm.");
  341. crystalHelmEquipped = true;
  342. hp += 25;
  343. hpMax += 25;
  344. home();
  345. }else if(crystalHelmEquipped == true){
  346. System.out.println("\nYou unequip the crystal helm.");
  347. crystalHelmEquipped = false;
  348. hp -= 25;
  349. hpMax -= 25;
  350. home();
  351. }
  352.  
  353. }else if(option.equals("g") && crystalGloves == true){
  354. if(crystalGlovesEquipped == false){
  355. System.out.println("\nYou equip the crystal gloves.");
  356. crystalGlovesEquipped = true;
  357. hp += 15;
  358. hpMax += 15;
  359. home();
  360. }else if(crystalGlovesEquipped == true){
  361. System.out.println("\nYou unequip the crystal gloves.");
  362. crystalGlovesEquipped = false;
  363. hp -= 15;
  364. hpMax -= 15;
  365. home();
  366. }
  367.  
  368. }else if(option.equals("b") && crystalBoots == true){
  369. if(crystalBootsEquipped == false){
  370. System.out.println("\nYou equip the crystal boots.");
  371. crystalBootsEquipped = true;
  372. hp += 20;
  373. hpMax += 20;
  374. home();
  375. }else if(crystalBootsEquipped == true){
  376. System.out.println("\nYou unequip the crystal boots.");
  377. crystalBootsEquipped = false;
  378. hp -= 20;
  379. hpMax -= 20;
  380. home();
  381. }
  382.  
  383. }else if(option.equals("p") && poisonRing == true){
  384. if(poisonRingEquipped == false){
  385. System.out.println("\nYou equip the poison ring.");
  386. poisonRingEquipped = true;
  387. hp += 5;
  388. hpMax += 5;
  389. str += 5;
  390. home();
  391. }else if(poisonRingEquipped == true){
  392. System.out.println("\nYou unequip the poison ring.");
  393. poisonRingEquipped = false;
  394. hp -= 5;
  395. hpMax -= 5;
  396. str -= 5;
  397. home();
  398. }
  399.  
  400. }else if(option.equals("r") && rockHammer == true){
  401. if(daggerEquipped == true){
  402. System.out.println("\nPlease unequip the other weapon first!");
  403. option = i.nextLine().toLowerCase();
  404. }else if(rockHammerEquipped == false){
  405. System.out.println("\nYou equip the rock hammer.");
  406. rockHammerEquipped = true;
  407. str += 10;
  408. home();
  409. }else if(rockHammerEquipped == true){
  410. System.out.println("\nYou unequip the rock hammer.");
  411. rockHammerEquipped = false;
  412. str -= 10;
  413. home();
  414. }
  415.  
  416. }else if(option.equals("a") && holyAmulet == true){
  417. if(holyAmuletEquipped == false){
  418. System.out.println("\nYou equip the holy amulet.");
  419. holyAmuletEquipped = true;
  420. hp += 15;
  421. hpMax += 15;
  422. str += 7;
  423. home();
  424. }else if(holyAmuletEquipped == true){
  425. System.out.println("\nYou unequip the holy amulet.");
  426. holyAmuletEquipped = false;
  427. hp -= 15;
  428. hpMax -= 15;
  429. str -= 7;
  430. home();
  431. }
  432. }else if(option.equals("f") && leafShield == true){
  433. if(shieldEquipped == true){
  434. System.out.println("\nPlease unequip the other shield first!");
  435. option = i.nextLine().toLowerCase();
  436. }else if(leafShieldEquipped == false){
  437. System.out.println("\nYou equip the leaf shield.");
  438. leafShieldEquipped = true;
  439. hp += 30;
  440. hpMax += 30;
  441. str += 5;
  442. home();
  443. }else if(leafShieldEquipped == true){
  444. System.out.println("\nYou unequip the leaf shield.");
  445. leafShieldEquipped = false;
  446. hp -= 30;
  447. hpMax -= 30;
  448. str -= 5;
  449. home();
  450. }
  451. }else if(option.equals("x") && phoenixPet == true){
  452.  
  453. if(phoenixPetEquipped == false){
  454. System.out.println("\nYou equip the phoenix pet.");
  455. phoenixPetEquipped = true;
  456. home();
  457. }else if(phoenixPetEquipped == true){
  458. System.out.println("\nYou unequip the phoenix pet.");
  459. phoenixPetEquipped = false;
  460. home();
  461. }
  462. }else if(option.equals("e")){
  463. home();
  464.  
  465. }else{
  466. option = i.nextLine().toLowerCase();
  467. }
  468.  
  469. }
  470. }
  471. }else if(option.equals("s")){
  472. System.out.println("\nStats\n");
  473. System.out.println("Name: " + name);
  474. System.out.println("LVL: " + lvl);
  475. System.out.println("HP: " + hp + "/" + hpMax);
  476. System.out.println("STR: " + str);
  477. System.out.println("Next LVL in: " + nextLvl + " exp");
  478. System.out.println("Total exp: " + totalExp);
  479. option = i.nextLine().toLowerCase();
  480. }else{
  481. option = i.nextLine().toLowerCase();
  482. }
  483. }
  484. }
  485.  
  486. public static void town() throws InterruptedException{
  487. System.out.println("\nYou are in the town.");
  488. System.out.println("Options: [H]ome, [S]hop, [F]orest");
  489. option = i.nextLine().toLowerCase();
  490.  
  491. while(area == true){
  492.  
  493. if(option.equals("h")){
  494. home();
  495. }else if(option.equals("s")){
  496. shop();
  497. }else if(option.equals("f")){
  498. forest();
  499. }else{
  500. option = i.nextLine().toLowerCase();
  501. }
  502. }
  503. }
  504.  
  505. public static void shop() throws InterruptedException{
  506. System.out.println("\nYou are in the shop.");
  507. System.out.println("Options: [B]uy, [E]xit");
  508. option = i.nextLine().toLowerCase();
  509.  
  510. while(area == true){
  511.  
  512. if(option.equals("b")){
  513. System.out.println("\nShop keeper: Hello, how can I help you?\nYou have " + gold + " gold.");
  514. System.out.println("\nItems\t\tPrice");
  515.  
  516. for(int x = 0; x < items.length && x < price.length; x++){
  517. System.out.println(items[x] + "\t" + price[x]);
  518. }
  519. System.out.println("[E]xit");
  520. option = i.nextLine().toLowerCase();
  521.  
  522. while(area == true){
  523.  
  524. if(option.equals("p")){
  525. if(gold >= 25){
  526. gold -= 25;
  527. System.out.println("\nYou buy a potion.");
  528. option = i.nextLine().toLowerCase();
  529. potionCount++;
  530. potion = true;
  531.  
  532. }else{
  533. System.out.println("\nNot enough money!");
  534. option = i.nextLine().toLowerCase();
  535. }
  536.  
  537. }else if(option.equals("d")){
  538. if(dagger == true){
  539. System.out.println("\nYou already have a dagger!");
  540. option = i.nextLine().toLowerCase();
  541. }else if(gold >= 50){
  542. gold -= 50;
  543. System.out.println("\nYou buy the dagger.");
  544. option = i.nextLine().toLowerCase();
  545. dagger = true;
  546. }else{
  547. System.out.println("\nNot enough money!");
  548. option = i.nextLine().toLowerCase();
  549. }
  550.  
  551. }else if(option.equals("s")){
  552. if(shield == true){
  553. System.out.println("\nYou already have a shield!");
  554. option = i.nextLine().toLowerCase();
  555. }else if(gold >= 125){
  556. gold -= 125;
  557. System.out.println("\nYou buy the shield.");
  558. option = i.nextLine().toLowerCase();
  559. shield = true;
  560. }else{
  561. System.out.println("\nNot enough money!");
  562. option = i.nextLine().toLowerCase();
  563. }
  564.  
  565. }else if(option.equals("t")){
  566. if(torch == true){
  567. System.out.println("\nYou already have a torch!");
  568. option = i.nextLine().toLowerCase();
  569. }else if(gold >= 100){
  570. gold -= 100;
  571. System.out.println("\nYou buy the torch.");
  572. option = i.nextLine().toLowerCase();
  573. torch = true;
  574. }else{
  575. System.out.println("\nNot enough money!");
  576. option = i.nextLine().toLowerCase();
  577. }
  578.  
  579. }else if(option.equals("e")){
  580. System.out.println("\nYou exit the shop.");
  581. town();
  582. }else{
  583. option = i.nextLine().toLowerCase();
  584. }
  585. }
  586.  
  587. }else if(option.equals("e")){
  588. System.out.println("\nYou exit the shop.");
  589. town();
  590. }else{
  591. option = i.nextLine().toLowerCase();
  592. }
  593. }
  594. }
  595.  
  596. public static void forest() throws InterruptedException{
  597. System.out.println("\nYou are in the forest.");
  598. System.out.println("Options: [E]ast, [W]est, [N]orth, [S]outh");
  599. option = i.nextLine().toLowerCase();
  600.  
  601. while(area == true){
  602.  
  603. if(option.equals("e")){
  604. forestMonsters();
  605. System.out.println("\nYou went east.");
  606. System.out.println("You are in the forest.");
  607. System.out.println("You see a small house.");
  608. System.out.println("Options: [E]nter, [W]est");
  609. option = i.nextLine().toLowerCase();
  610.  
  611. while(area == true){
  612.  
  613. if(option.equals("w")){
  614. forestMonsters();
  615. System.out.println("\nYou went west.");
  616. forest();
  617. }else if(option.equals("e")){
  618. System.out.println("\nYou enter the small house.");
  619. System.out.println("You see an old woman.");
  620. System.out.println("Options: [T]alk, [E]xit");
  621. option = i.nextLine().toLowerCase();
  622.  
  623. while(area == true){
  624. if(option.equals("t")){
  625. if(quest == true && questComplete == false){
  626. if(q_bearClaw == true){
  627. q_bearClawCount = 0;
  628. System.out.println("\nOld Woman: Wonderful, thank you!");
  629. System.out.println("\nQuest Complete!\nReward:\n50 gold\n125 exp");
  630. gold += 50;
  631. exp += 125;
  632. questComplete = true;
  633. lvlsystem();
  634. System.out.println("\nYou left the house.");
  635. forest();
  636. }else{
  637. System.out.println("\nOld Woman: Please bring me some bear claws.");
  638. System.out.println("\nYou left the house.");
  639. forest();
  640. }
  641. }else if(quest == false){
  642. System.out.println("\nOld Woman: Hello, young one.");
  643. System.out.println("Old Woman: What brings you here?");
  644. System.out.println("Options: [Q]uest, [N]ever mind");
  645. option = i.nextLine().toLowerCase();
  646. while(quest == false){
  647. if(option.equals("q")){
  648. quest = true;
  649. System.out.println("\nOld Woman: Please bring me some bear claws.");
  650. System.out.println("\nYou left the house.");
  651. forest();
  652. }else if(option.equals("n")){
  653. System.out.println("\nYou left the house.");
  654. forest();
  655. }else{
  656. option = i.nextLine().toLowerCase();
  657. }
  658. }
  659. }else if(questComplete == true){
  660. System.out.println("\nOld Woman: I don't need help right now.");
  661. System.out.println("\nYou left the house.");
  662. forest();
  663. }
  664. }else if(option.equals("e")){
  665. System.out.println("\nYou left the house.");
  666. forest();
  667. }else{
  668. option = i.nextLine().toLowerCase();
  669. }
  670. }
  671. }else{
  672. option = i.nextLine().toLowerCase();
  673. }
  674. }
  675.  
  676. }else if(option.equals("w")){
  677. forestMonsters();
  678. System.out.println("\nYou went west.");
  679. System.out.println("You are in the forest.");
  680. System.out.println("You see a crystal chest and a warning sign.");
  681. System.out.println("Options: [E]ast, [R]ead, [O]pen");
  682. option = i.nextLine().toLowerCase();
  683.  
  684. while(area == true){
  685.  
  686. if(option.equals("e")){
  687. forestMonsters();
  688. System.out.println("\nYou went east.");
  689. forest();
  690. }else if(option.equals("o")){
  691. chest = 1+r.nextInt(15);
  692. chestLoot = 100+r.nextInt(300);
  693. System.out.println("\nYou attempt to open the chest...");
  694. Thread.sleep(1000);
  695.  
  696. if(chest == 1){
  697. if(crystalHelm == true && crystalGloves == true && crystalBoots == true){
  698. System.out.println("...You find " + chestLoot + " gold!");
  699. gold += chestLoot;
  700. forest();
  701. }else if(crystalHelm == false && crystalGloves == false && crystalBoots == false){
  702. System.out.println("...You find a crystal helm!");
  703. crystalHelm = true;
  704. forest();
  705. }else if(crystalHelm == true && crystalGloves == false && crystalBoots == false){
  706. System.out.println("...You find a pair of crystal gloves!");
  707. crystalGloves = true;
  708. forest();
  709. }else if(crystalHelm == true && crystalGloves == true && crystalBoots == false){
  710. System.out.println("...You find a pair of crystal boots!");
  711. crystalBoots = true;
  712. forest();
  713. }
  714. }else{
  715. orc();
  716. }
  717.  
  718. }else if(option.equals("r")){
  719. System.out.println("\nYou read the sign, it says:");
  720. System.out.println("\"Beware! Strong orcs!\"");
  721. option = i.nextLine().toLowerCase();
  722. }else{
  723. option = i.nextLine().toLowerCase();
  724. }
  725. }
  726.  
  727. }else if(option.equals("n")){
  728. forestMonsters();
  729. System.out.println("\nYou went north.");
  730. System.out.println("You are in the forest.");
  731. System.out.println("You see a cave.");
  732. System.out.println("Options: [E]nter, [S]outh");
  733. option = i.nextLine().toLowerCase();
  734.  
  735. while(area == true){
  736.  
  737. if(option.equals("e")){
  738.  
  739. if(torchEquipped == true){
  740. System.out.println("\nYou enter the cave.");
  741. cave();
  742. }else{
  743. System.out.println("\nIt's too dark, I need to get a lightsource first.");
  744. option = i.nextLine().toLowerCase();
  745. }
  746.  
  747. }else if(option.equals("s")){
  748. forestMonsters();
  749. System.out.println("\nYou went south.");
  750. forest();
  751. }else{
  752. option = i.nextLine().toLowerCase();
  753. }
  754. }
  755.  
  756. }else if(option.equals("s")){
  757. forestMonsters();
  758. System.out.println("\nYou went south.");
  759. town();
  760. }else{
  761. option = i.nextLine().toLowerCase();
  762. }
  763. }
  764. }
  765.  
  766. public static void cave() throws InterruptedException{
  767. System.out.println("\nYou are in the cave.");
  768. System.out.println("Options: [W]est, [E]ast, [N]orth, [S]outh");
  769. option = i.nextLine().toLowerCase();
  770.  
  771. while(area == true){
  772. if(option.equals("w")){
  773. caveMonsters();
  774. System.out.println("\nYou went west.");
  775. System.out.println("You are in the cave.");
  776. System.out.println("You see a warning sign.");
  777. System.out.println("Options: [E]ast, [R]ead");
  778. option = i.nextLine().toLowerCase();
  779.  
  780. while(area == true){
  781. if(option.equals("e")){
  782. System.out.println("\nYou went east.");
  783. cave();
  784. }else if(option.equals("r")){
  785. System.out.println("\nYou read the sign, it says:");
  786. System.out.println("\"Beware! Poisonous monsters!\"");
  787. option = i.nextLine().toLowerCase();
  788. }else{
  789. option = i.nextLine().toLowerCase();
  790. }
  791. }
  792.  
  793. }else if(option.equals("e")){
  794. caveMonsters();
  795. System.out.println("\nYou went east.");
  796. System.out.println("You are in the cave.");
  797. System.out.println("You see a pool with strange looking liquid.");
  798. System.out.println("Options: [W]est, [D]rink");
  799. option = i.nextLine().toLowerCase();
  800.  
  801. while(area == true){
  802. if(option.equals("w")){
  803. System.out.println("\nYou went west.");
  804. cave();
  805. }else if(option.equals("d")){
  806. pool = 1+r.nextInt(3);
  807. if(pool == 1){
  808. System.out.println("\nYou feel refreshed!");
  809. System.out.println("You went west.");
  810. hp = hpMax;
  811. cave();
  812. }else{
  813. snake();
  814. System.out.println("\nDamn snake caught me by surprise.");
  815. System.out.println("You went west.");
  816. cave();
  817. }
  818. }else{
  819. option = i.nextLine().toLowerCase();
  820. }
  821. }
  822.  
  823. }else if(option.equals("n")){
  824. caveMonsters();
  825. System.out.println("\nYou went north.");
  826. System.out.println("You are in the cave.");
  827. System.out.println("You see a strange portal and a wizard.");
  828. System.out.println("Options: [T]alk, [S]outh");
  829. option = i.nextLine().toLowerCase();
  830.  
  831. while(area == true){
  832. if(option.equals("s")){
  833. System.out.println("\nYou went south.");
  834. cave();
  835. }else if(option.equals("t")){
  836. System.out.println("\nWizard: Hello, would you like to go DragonWorld?");
  837. System.out.println("Wizard: It only costs 200 gold!");
  838. System.out.println("Options: [Y]es, [N]o");
  839. option = i.nextLine().toLowerCase();
  840.  
  841. while(area == true){
  842. if(option.equals("y")){
  843. if(gold >= 200){
  844. System.out.println("\nYou walk into the portal...");
  845. dragonWorld();
  846. }else{
  847. System.out.println("\nWizard: You don't have enough gold...");
  848. caveMonsters();
  849. System.out.println("\nYou went south.");
  850. cave();
  851. }
  852. }else if(option.equals("n")){
  853. caveMonsters();
  854. System.out.println("\nYou went south.");
  855. cave();
  856. }else{
  857. option = i.nextLine().toLowerCase();
  858. }
  859.  
  860. }
  861. }else{
  862. option = i.nextLine().toLowerCase();
  863. }
  864. }
  865.  
  866. }else if(option.equals("s")){
  867. caveMonsters();
  868. System.out.println("\nYou exit the cave.");
  869. forest();
  870. }else{
  871. option = i.nextLine().toLowerCase();
  872. }
  873. }
  874.  
  875. }
  876.  
  877. public static void forestMonsters() throws InterruptedException{
  878. int fm = r.nextInt(5);
  879.  
  880. if(fm == 1){
  881. wolf();
  882. }else if(fm == 2){
  883. bear();
  884. }
  885. }
  886.  
  887. public static void caveMonsters() throws InterruptedException{
  888. int cm = 1+r.nextInt(5);
  889.  
  890. if(cm == 1){
  891. spider();
  892. }else if(cm == 2){
  893. snake();
  894. }else if(cm == 3){
  895. troll();
  896. }
  897. }
  898.  
  899. public static void lvlsystem(){
  900. totalExp += exp;
  901.  
  902. if(exp >= nextLvl){
  903. exp = 0;
  904. nextLvl *= 1.2;
  905. lvl++;
  906. hp += 3;
  907. hpMax += 3;
  908. str += 1;
  909. System.out.println("\nYou are now LVL " + lvl + "!");
  910. }
  911. }
  912.  
  913. public static void wolf() throws InterruptedException{
  914. fight = true;
  915. m_hp = 5;
  916. System.out.println(mons[0]);
  917.  
  918. while(fight == true){
  919. m_dmg = r.nextInt(2);
  920. goldDrop = 1+r.nextInt(5);
  921. monsterDrop = 1+r.nextInt(5);
  922. dmg = r.nextInt(str);
  923. dmg *= 0.5;
  924. healSelf = 1+r.nextInt(3);
  925. healSelfAmount = 1+r.nextInt(5);
  926. System.out.println("Wolf (HP:" + m_hp + "/5) does " + m_dmg + " damage");
  927. hp -= m_dmg;
  928. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  929. m_hp -= dmg;
  930. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  931. System.out.println(healSelfAmount + "+ heal!");
  932. hp += healSelfAmount;
  933. if(hp > hpMax){
  934. hp = hpMax;
  935. }
  936. }
  937. System.out.println();
  938. Thread.sleep(1500);
  939.  
  940. if(m_hp <= 0){
  941. fight = false;
  942. System.out.println("You killed the wolf\nGained 15 exp\nDrops:\nGold x" + goldDrop);
  943. if(monsterDrop == 1){
  944. System.out.println("Potion");
  945. potion = true;
  946. potionCount += 1;
  947. }
  948. gold += goldDrop;
  949. exp += 15;
  950. lvlsystem();
  951. }else if(hp <= 0){
  952. fight = false;
  953. System.out.println("\nYou died!");
  954. System.out.println("Lost some gold.");
  955. gold *= 0.5;
  956. hp = hpMax;
  957. home();
  958. }else if(hp <= 0 && m_hp <= 0){
  959. fight = false;
  960. System.out.println("\nYou died!");
  961. System.out.println("Lost some gold.");
  962. gold *= 0.5;
  963. hp = hpMax;
  964. home();
  965. }
  966. }
  967. }
  968.  
  969. public static void bear() throws InterruptedException{
  970. fight = true;
  971. m_hp = 7;
  972. System.out.println(mons[1]);
  973.  
  974. while(fight == true){
  975. m_dmg = r.nextInt(3);
  976. goldDrop = 1+r.nextInt(15);
  977. dmg = r.nextInt(str);
  978. dmg *= 0.5;
  979. healSelf = 1+r.nextInt(3);
  980. healSelfAmount = 1+r.nextInt(5);
  981. System.out.println("Bear (HP:" + m_hp + "/7) does " + m_dmg + " damage");
  982. hp -= m_dmg;
  983. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  984. m_hp -= dmg;
  985. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  986. System.out.println(healSelfAmount + "+ heal!");
  987. hp += healSelfAmount;
  988. if(hp > hpMax){
  989. hp = hpMax;
  990. }
  991. }
  992. System.out.println();
  993. Thread.sleep(1500);
  994.  
  995. if(m_hp <= 0){
  996. fight = false;
  997. System.out.println("You killed the bear\nGained 25 exp\nDrops:\nGold x" + goldDrop);
  998.  
  999. if(quest == true && q_bearClaw == false){
  1000. if(q_bearClawCount == 3){
  1001. System.out.println("\nI have the bear claws, I should go to the Old Woman now.");
  1002. q_bearClaw = true;
  1003. }else{
  1004. q_bearClawCount++;
  1005. System.out.println("Bear claw");
  1006. }
  1007. }
  1008.  
  1009. gold += goldDrop;
  1010. exp += 25;
  1011. lvlsystem();
  1012. }else if(hp <= 0){
  1013. fight = false;
  1014. System.out.println("\nYou died!");
  1015. System.out.println("Lost some gold.");
  1016. gold *= 0.5;
  1017. hp = hpMax;
  1018. home();
  1019. }else if(hp <= 0 && m_hp <= 0){
  1020. fight = false;
  1021. System.out.println("\nYou died!");
  1022. System.out.println("Lost some gold.");
  1023. gold *= 0.5;
  1024. hp = hpMax;
  1025. home();
  1026. }
  1027. }
  1028. }
  1029.  
  1030. public static void orc() throws InterruptedException{
  1031. fight = true;
  1032. m_hp = 20;
  1033. System.out.println(mons[2]);
  1034.  
  1035. while(fight == true){
  1036. m_dmg = r.nextInt(11);
  1037. goldDrop = 1+r.nextInt(80);
  1038. monsterDrop = 1+r.nextInt(3);
  1039. dmg = r.nextInt(str);
  1040. dmg *= 0.5;
  1041. healSelf = 1+r.nextInt(3);
  1042. healSelfAmount = 1+r.nextInt(5);
  1043. System.out.println("Orc (HP:" + m_hp + "/20) does " + m_dmg + " damage");
  1044. hp -= m_dmg;
  1045. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  1046. m_hp -= dmg;
  1047. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  1048. System.out.println(healSelfAmount + "+ heal!");
  1049. hp += healSelfAmount;
  1050. if(hp > hpMax){
  1051. hp = hpMax;
  1052. }
  1053. }
  1054. System.out.println();
  1055. Thread.sleep(1500);
  1056.  
  1057. if(m_hp <= 0){
  1058. fight = false;
  1059. System.out.println("You killed the orc\nGained 50 exp\nDrops:\nGold x" + goldDrop);
  1060. if(monsterDrop == 1){
  1061. System.out.println("Medium Potion");
  1062. medPotion = true;
  1063. medPotionCount += 1;
  1064. }
  1065. gold += goldDrop;
  1066. exp += 50;
  1067. lvlsystem();
  1068. forest();
  1069. }else if(hp <= 0){
  1070. fight = false;
  1071. System.out.println("\nYou died!");
  1072. System.out.println("Lost some gold.");
  1073. gold *= 0.5;
  1074. hp = hpMax;
  1075. home();
  1076. }else if(hp <= 0 && m_hp <= 0){
  1077. fight = false;
  1078. System.out.println("\nYou died!");
  1079. System.out.println("Lost some gold.");
  1080. gold *= 0.5;
  1081. hp = hpMax;
  1082. home();
  1083. }
  1084. }
  1085. }
  1086.  
  1087. public static void spider() throws InterruptedException{
  1088. fight = true;
  1089. m_hp = 15;
  1090. System.out.println(mons[3]);
  1091.  
  1092. while(fight == true){
  1093. m_dmg = r.nextInt(5);
  1094. goldDrop = 1+r.nextInt(30);
  1095. monsterDrop = 1+r.nextInt(5);
  1096. poison = 1+r.nextInt(5);
  1097. poisondmg = 1+r.nextInt(5);
  1098. dmg = r.nextInt(str);
  1099. dmg *= 0.5;
  1100. healSelf = 1+r.nextInt(3);
  1101. healSelfAmount = 1+r.nextInt(5);
  1102. System.out.println("Spider (HP:" + m_hp + "/15) does " + m_dmg + " damage");
  1103. if(poison == 1){
  1104. System.out.println("+" + poisondmg + " poison damage!");
  1105. hp -= poisondmg;
  1106. }
  1107. hp -= m_dmg;
  1108. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  1109. m_hp -= dmg;
  1110. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  1111. System.out.println(healSelfAmount + "+ heal!");
  1112. hp += healSelfAmount;
  1113. if(hp > hpMax){
  1114. hp = hpMax;
  1115. }
  1116. }
  1117. System.out.println();
  1118. Thread.sleep(1500);
  1119.  
  1120. if(m_hp <= 0){
  1121. fight = false;
  1122. System.out.println("You killed the spider\nGained 30 exp\nDrops:\nGold x" + goldDrop);
  1123. if(monsterDrop == 1){
  1124. System.out.println("Potion");
  1125. potion = true;
  1126. potionCount += 1;
  1127. }
  1128. gold += goldDrop;
  1129. exp += 30;
  1130. lvlsystem();
  1131. }else if(hp <= 0){
  1132. fight = false;
  1133. System.out.println("\nYou died!");
  1134. System.out.println("Lost some gold.");
  1135. gold *= 0.5;
  1136. hp = hpMax;
  1137. home();
  1138. }else if(hp <= 0 && m_hp <= 0){
  1139. fight = false;
  1140. System.out.println("\nYou died!");
  1141. System.out.println("Lost some gold.");
  1142. gold *= 0.5;
  1143. hp = hpMax;
  1144. home();
  1145. }
  1146. }
  1147. }
  1148.  
  1149. public static void snake() throws InterruptedException{
  1150. fight = true;
  1151. m_hp = 15;
  1152. System.out.println(mons[4]);
  1153.  
  1154. while(fight == true){
  1155. m_dmg = r.nextInt(5);
  1156. goldDrop = 1+r.nextInt(30);
  1157. monsterDrop = 1+r.nextInt(10);
  1158. poison = 1+r.nextInt(5);
  1159. poisondmg = 1+r.nextInt(5);
  1160. dmg = r.nextInt(str);
  1161. dmg *= 0.5;
  1162. healSelf = 1+r.nextInt(3);
  1163. healSelfAmount = 1+r.nextInt(5);
  1164. System.out.println("Snake (HP:" + m_hp + "/15) does " + m_dmg + " damage");
  1165. if(poison == 1){
  1166. System.out.println("+" + poisondmg + " poison damage!");
  1167. hp -= poisondmg;
  1168. }
  1169. hp -= m_dmg;
  1170. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  1171. m_hp -= dmg;
  1172. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  1173. System.out.println(healSelfAmount + "+ heal!");
  1174. hp += healSelfAmount;
  1175. if(hp > hpMax){
  1176. hp = hpMax;
  1177. }
  1178. }
  1179. System.out.println();
  1180. Thread.sleep(1500);
  1181.  
  1182. if(m_hp <= 0){
  1183. fight = false;
  1184. System.out.println("You killed the snake\nGained 30 exp\nDrops:\nGold x" + goldDrop);
  1185. if(monsterDrop == 1 && poisonRing == false){
  1186. System.out.println("Poison ring");
  1187. poisonRing = true;
  1188. }
  1189. gold += goldDrop;
  1190. exp += 30;
  1191. lvlsystem();
  1192. }else if(hp <= 0){
  1193. fight = false;
  1194. System.out.println("\nYou died!");
  1195. System.out.println("Lost some gold.");
  1196. gold *= 0.5;
  1197. hp = hpMax;
  1198. home();
  1199. }else if(hp <= 0 && m_hp <= 0){
  1200. fight = false;
  1201. System.out.println("\nYou died!");
  1202. System.out.println("Lost some gold.");
  1203. gold *= 0.5;
  1204. hp = hpMax;
  1205. home();
  1206. }
  1207. }
  1208. }
  1209.  
  1210. public static void troll() throws InterruptedException{
  1211. fight = true;
  1212. m_hp = 20;
  1213. System.out.println(mons[5]);
  1214.  
  1215. while(fight == true){
  1216. m_dmg = r.nextInt(6);
  1217. goldDrop = 1+r.nextInt(40);
  1218. monsterDrop = 1+r.nextInt(15);
  1219. dmg = r.nextInt(str);
  1220. dmg *= 0.5;
  1221. healSelf = 1+r.nextInt(3);
  1222. healSelfAmount = 1+r.nextInt(5);
  1223. System.out.println("Troll (HP:" + m_hp + "/20) does " + m_dmg + " damage");
  1224. hp -= m_dmg;
  1225. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  1226. m_hp -= dmg;
  1227. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  1228. System.out.println(healSelfAmount + "+ heal!");
  1229. hp += healSelfAmount;
  1230. if(hp > hpMax){
  1231. hp = hpMax;
  1232. }
  1233. }
  1234. System.out.println();
  1235. Thread.sleep(1500);
  1236.  
  1237. if(m_hp <= 0){
  1238. fight = false;
  1239. System.out.println("You killed the troll\nGained 35 exp\nDrops:\nGold x" + goldDrop);
  1240. if(monsterDrop == 1 && rockHammer == false){
  1241. System.out.println("Rock hammer");
  1242. rockHammer = true;
  1243. }
  1244. gold += goldDrop;
  1245. exp += 35;
  1246. lvlsystem();
  1247. }else if(hp <= 0){
  1248. fight = false;
  1249. System.out.println("\nYou died!");
  1250. System.out.println("Lost some gold.");
  1251. gold *= 0.5;
  1252. hp = hpMax;
  1253. home();
  1254. }else if(hp <= 0 && m_hp <= 0){
  1255. fight = false;
  1256. System.out.println("\nYou died!");
  1257. System.out.println("Lost some gold.");
  1258. gold *= 0.5;
  1259. hp = hpMax;
  1260. home();
  1261. }
  1262. }
  1263. }
  1264.  
  1265. public static void dragonWorld() throws InterruptedException{
  1266. System.out.println("\nYou are in DragonWorld.");
  1267. System.out.println("You see a strange portal and a wizard.");
  1268. System.out.println("Options: [T]alk, [N]orth");
  1269. option = i.nextLine().toLowerCase();
  1270.  
  1271. while(area == true){
  1272. if(option.equals("t")){
  1273. System.out.println("\nWizard: Would you like to go back?");
  1274. System.out.println("Wizard: Don't worry, it's free to go back.");
  1275. System.out.println("Options: [Y]es, [N]o");
  1276. option = i.nextLine().toLowerCase();
  1277.  
  1278. while(area == true){
  1279. if(option.equals("y")){
  1280. System.out.println("\nYou walk into the portal...");
  1281. cave();
  1282. }else if(option.equals("n")){
  1283. System.out.println("\nWizard: If you ever want to go back, feel free to talk to me.");
  1284. dragonWorld();
  1285. }else{
  1286. option = i.nextLine().toLowerCase();
  1287. }
  1288. }
  1289. }else if(option.equals("n")){
  1290. System.out.println("\nYou went north.");
  1291. dragonWorld2();
  1292. }else{
  1293. option = i.nextLine().toLowerCase();
  1294. }
  1295. }
  1296. }
  1297.  
  1298. public static void dragonWorld2() throws InterruptedException{
  1299. System.out.println("\nYou are in DragonWorld");
  1300. System.out.println("Options: [I]nn, [S]hop, S[o]uth");
  1301. option = i.nextLine().toLowerCase();
  1302.  
  1303. while(area == true){
  1304. if(option.equals("i")){
  1305. inn();
  1306. }else if(option.equals("s")){
  1307. shop2();
  1308. }else if(option.equals("o")){
  1309. System.out.println("\nYou went south.");
  1310. dragonWorld();
  1311. }else{
  1312. option = i.nextLine().toLowerCase();
  1313. }
  1314. }
  1315. }
  1316.  
  1317. public static void inn() throws InterruptedException{
  1318. System.out.println("\nYou are in the inn.");
  1319. System.out.println("Options: [E]xit, [T]alk, [I]nventory, [S]tats");
  1320. option = i.nextLine().toLowerCase();
  1321.  
  1322. while(area == true){
  1323.  
  1324. if(option.equals("e")){
  1325. dragonWorld2();
  1326. }else if(option.equals("t")){
  1327. System.out.println("\nInn keeper: Hello, how can I help you?");
  1328. System.out.println("Options: [R]est, [N]ever mind");
  1329. option = i.nextLine().toLowerCase();
  1330.  
  1331. while(area == true){
  1332. if(option.equals("r")){
  1333. if(hp < hpMax){
  1334. System.out.println("\nInn keeper: That will be 175 gold.");
  1335. System.out.println("Options: [O]K, [N]ever mind");
  1336. option = i.nextLine().toLowerCase();
  1337.  
  1338. while(area == true){
  1339. if(option.equals("o")){
  1340. if(gold >= 175){
  1341. System.out.println("\nYou rested well!");
  1342. gold -= 175;
  1343. hp = hpMax;
  1344. inn();
  1345. }else{
  1346. System.out.println("\nInn keeper: You don't have enough, come back later.");
  1347. inn();
  1348. }
  1349. }else if(option.equals("n")){
  1350. inn();
  1351. }else{
  1352. option = i.nextLine().toLowerCase();
  1353. }
  1354. }
  1355. }else{
  1356. System.out.println("\nI don't feel like resting right now.");
  1357. inn();
  1358. }
  1359. }else if(option.equals("n")){
  1360. inn();
  1361. }else{
  1362. option = i.nextLine().toLowerCase();
  1363. }
  1364. }
  1365. }else if(option.equals("i")){
  1366. System.out.println("\nInventory\n\nItems\t\t\t\tDescription\n");
  1367. if(potion == false && dagger == false && torch == false && shield == false && crystalHelm == false && crystalGloves == false &&
  1368. crystalBoots == false && poisonRing == false && medPotion == false && highPotion == false && hpPotion == false && strPotion == false && gold == 0){
  1369. System.out.println("Empty");
  1370. option = i.nextLine().toLowerCase();
  1371. }else{
  1372.  
  1373. if(gold >= 10){
  1374. System.out.println("Gold x" + gold + "\t\t\tGold is always welcome.");
  1375. }else if(gold < 10){
  1376. System.out.println("Gold x" + gold + "\t\t\t\tGold is always welcome.");
  1377. }
  1378.  
  1379. if(potion == true){
  1380. System.out.println(items[0] + " x" + potionCount + "\t\t\tHeals 5 HP");
  1381. }
  1382.  
  1383. if(medPotion == true){
  1384. System.out.println("[M]edium Potion x" + medPotionCount + "\t\tHeals 15 HP");
  1385. }
  1386.  
  1387. if(highPotion == true){
  1388. System.out.println(items2[0] + " x" + highPotionCount + "\t\tHeals 30 HP");
  1389. }
  1390.  
  1391. if(hpPotion == true){
  1392. System.out.println(items2[1] + " x" + hpPotionCount + "\t\t\t+10 HP");
  1393. }
  1394.  
  1395. if(strPotion == true){
  1396. System.out.println(items2[2] + " x" + strPotionCount + "\t\t+10 STR");
  1397. }
  1398.  
  1399. if(dagger == true){
  1400. if(daggerEquipped == true){
  1401. System.out.println(items[1] + " [Equipped]\t\t+3 STR");
  1402. }else{
  1403. System.out.println(items[1] + "\t\t\t+3 STR");
  1404. }
  1405.  
  1406. }
  1407.  
  1408. if(torch == true){
  1409. if(torchEquipped == true){
  1410. System.out.println(items[2] + " [Equipped]\t\tLights up dark areas.");
  1411. }else{
  1412. System.out.println(items[2] + "\t\t\tLights up dark areas.");
  1413. }
  1414. }
  1415.  
  1416. if(shield == true){
  1417. if(shieldEquipped == true){
  1418. System.out.println(items[3] + " [Equipped]\t\t+10 HP");
  1419. }else{
  1420. System.out.println(items[3] + "\t\t\t+10 HP");
  1421. }
  1422. }
  1423.  
  1424. if(crystalHelm == true){
  1425. if(crystalHelmEquipped == true){
  1426. System.out.println("Crystal [h]elm [Equipped]\t+25 HP");
  1427. }else{
  1428. System.out.println("Crystal [h]elm\t\t\t+25 HP");
  1429. }
  1430. }
  1431.  
  1432. if(crystalGloves == true){
  1433. if(crystalGlovesEquipped == true){
  1434. System.out.println("Crystal [g]loves [Equipped]\t+15 HP");
  1435. }else{
  1436. System.out.println("Crystal [g]loves\t\t+15 HP");
  1437. }
  1438. }
  1439.  
  1440. if(crystalBoots == true){
  1441. if(crystalBootsEquipped == true){
  1442. System.out.println("Crystal [b]oots [Equipped]\t+20 HP");
  1443. }else{
  1444. System.out.println("Crystal [b]oots\t\t\t+20 HP");
  1445. }
  1446. }
  1447.  
  1448. if(poisonRing == true){
  1449. if(poisonRingEquipped == true){
  1450. System.out.println("[P]oison ring [Equipped]\t+5 HP, +5 STR");
  1451. }else{
  1452. System.out.println("[P]oison ring\t\t\t+5 HP, +5 STR");
  1453. }
  1454. }
  1455.  
  1456. if(rockHammer == true){
  1457. if(rockHammerEquipped == true){
  1458. System.out.println("[R]ock hammer [Equipped]\t+10 STR");
  1459. }else{
  1460. System.out.println("[R]ock hammer\t\t\t+10 STR");
  1461. }
  1462. }
  1463.  
  1464. if(holyAmulet == true){
  1465. if(holyAmuletEquipped == true){
  1466. System.out.println("Holy [a]mulet [Equipped]\t+15 HP, +7 STR");
  1467. }else{
  1468. System.out.println("Holy [a]mulet\t\t\t+15 HP, +7 STR");
  1469. }
  1470. }
  1471.  
  1472. if(leafShield == true){
  1473. if(leafShieldEquipped == true){
  1474. System.out.println("Lea[f] Shield [Equipped]\t+30 HP, +5 STR");
  1475. }else{
  1476. System.out.println("Lea[f] Shield\t\t\t+30 HP, +5 STR");
  1477. }
  1478. }
  1479.  
  1480. if(phoenixPet == true){
  1481. if(phoenixPetEquipped == true){
  1482. System.out.println("Phoeni[x] Pet [Equipped]\tHeals you in combat.");
  1483. }else{
  1484. System.out.println("Phoeni[x] Pet\t\t\tHeals you in combat.");
  1485. }
  1486. }
  1487.  
  1488. System.out.println("[E]xit");
  1489. option = i.nextLine().toLowerCase();
  1490.  
  1491. while(area == true){
  1492.  
  1493. if(option.equals("p") && potion == true){
  1494. if(hp == hpMax){
  1495. System.out.println("\nYou don't need to drink this right now.");
  1496. }else{
  1497. System.out.println("\nYou drink the Potion... some HP was restored!");
  1498. hp += 5;
  1499. potionCount -= 1;
  1500. if(hp > hpMax){
  1501. hp = hpMax;
  1502. }
  1503. if(potionCount == 0){
  1504. potion = false;
  1505. }
  1506.  
  1507. inn();
  1508. }
  1509. option = i.nextLine().toLowerCase();
  1510.  
  1511. }else if(option.equals("m") && medPotion == true){
  1512.  
  1513. if(hp == hpMax){
  1514. System.out.println("\nYou don't need to drink this right now.");
  1515. }else{
  1516. System.out.println("\nYou drink the Medium Potion... some HP was restored!");
  1517. hp += 15;
  1518. medPotionCount -= 1;
  1519. if(hp > hpMax){
  1520. hp = hpMax;
  1521. }
  1522. if(medPotionCount == 0){
  1523. potion = false;
  1524. }
  1525.  
  1526. inn();
  1527. }
  1528. option = i.nextLine().toLowerCase();
  1529.  
  1530. }else if(option.equals("hi") && highPotion == true){
  1531. if(hp == hpMax){
  1532. System.out.println("\nYou don't need to drink this right now.");
  1533. }else{
  1534. System.out.println("\nYou drink the High Potion... some HP was restored!");
  1535. hp += 30;
  1536. highPotionCount -= 1;
  1537. if(hp > hpMax){
  1538. hp = hpMax;
  1539. }
  1540. if(highPotionCount == 0){
  1541. highPotion = false;
  1542. }
  1543. inn();
  1544. }
  1545. option = i.nextLine().toLowerCase();
  1546.  
  1547. }else if(option.equals("hp") && hpPotion == true){
  1548. System.out.println("\nYou drink the +HP Potion... HP increased!");
  1549. hp += 10;
  1550. hpMax += 10;
  1551. hpPotionCount -= 1;
  1552. if(hpPotionCount == 0){
  1553. hpPotion = false;
  1554. }
  1555. home();
  1556.  
  1557. }else if(option.equals("st") && strPotion == true){
  1558. System.out.println("\nYou drink the +STR Potion... STR increased!");
  1559. str += 10;
  1560. strPotionCount -= 1;
  1561. if(strPotionCount == 0){
  1562. strPotion = false;
  1563. }
  1564. home();
  1565.  
  1566. }else if(option.equals("d") && dagger == true){
  1567. if(rockHammerEquipped == true){
  1568. System.out.println("\nPlease unequip the other weapon first!");
  1569. option = i.nextLine().toLowerCase();
  1570. }else if(daggerEquipped == false){
  1571. System.out.println("\nYou equip the dagger.");
  1572. daggerEquipped = true;
  1573. str += 3;
  1574. inn();
  1575. }else if(daggerEquipped == true){
  1576. System.out.println("\nYou unequip the dagger.");
  1577. daggerEquipped = false;
  1578. str -= 3;
  1579. inn();
  1580. }
  1581.  
  1582. }else if(option.equals("t") && torch == true){
  1583. if(torchEquipped == false){
  1584. System.out.println("\nYou equip the torch.");
  1585. torchEquipped = true;
  1586. inn();
  1587. }else if(torchEquipped == true){
  1588. System.out.println("\nYou unequip the torch.");
  1589. torchEquipped = false;
  1590. inn();
  1591. }
  1592. }else if(option.equals("s") && shield == true){
  1593. if(leafShieldEquipped == true){
  1594. System.out.println("\nPlease unequip the other shield first!");
  1595. option = i.nextLine().toLowerCase();
  1596. }else if(shieldEquipped == false){
  1597. System.out.println("\nYou equip the shield.");
  1598. shieldEquipped = true;
  1599. hp += 10;
  1600. hpMax += 10;
  1601. inn();
  1602. }else if(shieldEquipped == true){
  1603. System.out.println("\nYou unequip the shield.");
  1604. shieldEquipped = false;
  1605. hp -= 10;
  1606. hpMax -= 10;
  1607. inn();
  1608. }
  1609.  
  1610. }else if(option.equals("h") && crystalHelm == true){
  1611. if(crystalHelmEquipped == false){
  1612. System.out.println("\nYou equip the crystal helm.");
  1613. crystalHelmEquipped = true;
  1614. hp += 25;
  1615. hpMax += 25;
  1616. inn();
  1617. }else if(crystalHelmEquipped == true){
  1618. System.out.println("\nYou unequip the crystal helm.");
  1619. crystalHelmEquipped = false;
  1620. hp -= 25;
  1621. hpMax -= 25;
  1622. inn();
  1623. }
  1624.  
  1625. }else if(option.equals("g") && crystalGloves == true){
  1626. if(crystalGlovesEquipped == false){
  1627. System.out.println("\nYou equip the crystal gloves.");
  1628. crystalGlovesEquipped = true;
  1629. hp += 15;
  1630. hpMax += 15;
  1631. inn();
  1632. }else if(crystalGlovesEquipped == true){
  1633. System.out.println("\nYou unequip the crystal gloves.");
  1634. crystalGlovesEquipped = false;
  1635. hp -= 15;
  1636. hpMax -= 15;
  1637. inn();
  1638. }
  1639.  
  1640. }else if(option.equals("b") && crystalBoots == true){
  1641. if(crystalBootsEquipped == false){
  1642. System.out.println("\nYou equip the crystal boots.");
  1643. crystalBootsEquipped = true;
  1644. hp += 20;
  1645. hpMax += 20;
  1646. inn();
  1647. }else if(crystalBootsEquipped == true){
  1648. System.out.println("\nYou unequip the crystal boots.");
  1649. crystalBootsEquipped = false;
  1650. hp -= 20;
  1651. hpMax -= 20;
  1652. inn();
  1653. }
  1654.  
  1655. }else if(option.equals("p") && poisonRing == true){
  1656. if(poisonRingEquipped == false){
  1657. System.out.println("\nYou equip the poison ring.");
  1658. poisonRingEquipped = true;
  1659. hp += 5;
  1660. hpMax += 5;
  1661. str += 5;
  1662. inn();
  1663. }else if(poisonRingEquipped == true){
  1664. System.out.println("\nYou unequip the poison ring.");
  1665. poisonRingEquipped = false;
  1666. hp -= 5;
  1667. hpMax -= 5;
  1668. str -= 5;
  1669. inn();
  1670. }
  1671.  
  1672. }else if(option.equals("r") && rockHammer == true){
  1673. if(daggerEquipped == true){
  1674. System.out.println("\nPlease unequip the other weapon first!");
  1675. option = i.nextLine().toLowerCase();
  1676. }else if(rockHammerEquipped == false){
  1677. System.out.println("\nYou equip the rock hammer.");
  1678. rockHammerEquipped = true;
  1679. str += 10;
  1680. inn();
  1681. }else if(rockHammerEquipped == true){
  1682. System.out.println("\nYou unequip the rock hammer.");
  1683. rockHammerEquipped = false;
  1684. str -= 10;
  1685. inn();
  1686. }
  1687.  
  1688. }else if(option.equals("a") && holyAmulet == true){
  1689. if(holyAmuletEquipped == false){
  1690. System.out.println("\nYou equip the holy amulet.");
  1691. holyAmuletEquipped = true;
  1692. hp += 15;
  1693. hpMax += 15;
  1694. str += 7;
  1695. home();
  1696. }else if(holyAmuletEquipped == true){
  1697. System.out.println("\nYou unequip the holy amulet.");
  1698. holyAmuletEquipped = false;
  1699. hp -= 15;
  1700. hpMax -= 15;
  1701. str -= 7;
  1702. home();
  1703. }
  1704. }else if(option.equals("f") && leafShield == true){
  1705. if(shieldEquipped == true){
  1706. System.out.println("\nPlease unequip the other shield first!");
  1707. option = i.nextLine().toLowerCase();
  1708. }else if(leafShieldEquipped == false){
  1709. System.out.println("\nYou equip the leaf shield.");
  1710. leafShieldEquipped = true;
  1711. hp += 30;
  1712. hpMax += 30;
  1713. str += 5;
  1714. home();
  1715. }else if(leafShieldEquipped == true){
  1716. System.out.println("\nYou unequip the leaf shield.");
  1717. leafShieldEquipped = false;
  1718. hp -= 30;
  1719. hpMax -= 30;
  1720. str -= 5;
  1721. home();
  1722. }
  1723. }else if(option.equals("x") && phoenixPet == true){
  1724. if(phoenixPetEquipped == false){
  1725. System.out.println("\nYou equip the phoenix pet.");
  1726. phoenixPetEquipped = true;
  1727. home();
  1728. }else if(phoenixPetEquipped == true){
  1729. System.out.println("\nYou unequip the phoenix pet.");
  1730. phoenixPetEquipped = false;
  1731. home();
  1732. }
  1733. }else if(option.equals("e")){
  1734. inn();
  1735.  
  1736. }else{
  1737. option = i.nextLine().toLowerCase();
  1738. }
  1739.  
  1740. }
  1741. }
  1742. }else if(option.equals("s")){
  1743. System.out.println("\nStats\n");
  1744. System.out.println("Name: " + name);
  1745. System.out.println("LVL: " + lvl);
  1746. System.out.println("HP: " + hp + "/" + hpMax);
  1747. System.out.println("STR: " + str);
  1748. System.out.println("Next LVL in: " + nextLvl + " exp");
  1749. System.out.println("Total exp: " + totalExp);
  1750. option = i.nextLine().toLowerCase();
  1751. }else{
  1752. option = i.nextLine().toLowerCase();
  1753. }
  1754. }
  1755.  
  1756. }
  1757.  
  1758. public static void shop2() throws InterruptedException{
  1759. System.out.println("\nYou are in the shop.");
  1760. System.out.println("Options: [B]uy, [E]xit");
  1761. option = i.nextLine().toLowerCase();
  1762.  
  1763. while(area == true){
  1764.  
  1765. if(option.equals("b")){
  1766. System.out.println("\nShop keeper: Hello, how can I help you?\nYou have " + gold + " gold.");
  1767. System.out.println("\nItems\t\tPrice");
  1768.  
  1769. for(int y = 0; y < items2.length && y < price2.length; y++){
  1770. System.out.println(items2[y] + "\t" + price2[y]);
  1771. }
  1772. System.out.println("[E]xit");
  1773. option = i.nextLine().toLowerCase();
  1774.  
  1775. while(area == true){
  1776.  
  1777. if(option.equals("hi")){
  1778. if(gold >= 75){
  1779. gold -= 75;
  1780. System.out.println("\nYou buy a high potion.");
  1781. option = i.nextLine().toLowerCase();
  1782. highPotionCount++;
  1783. highPotion = true;
  1784.  
  1785. }else{
  1786. System.out.println("\nNot enough money!");
  1787. option = i.nextLine().toLowerCase();
  1788. }
  1789.  
  1790. }else if(option.equals("hp")){
  1791.  
  1792. if(gold >= 350){
  1793. gold -= 350;
  1794. System.out.println("\nYou buy a +HP potion.");
  1795. option = i.nextLine().toLowerCase();
  1796. hpPotionCount++;
  1797. hpPotion = true;
  1798.  
  1799. }else{
  1800. System.out.println("\nNot enough money!");
  1801. option = i.nextLine().toLowerCase();
  1802. }
  1803.  
  1804. }else if(option.equals("st")){
  1805. if(gold >= 700){
  1806. gold -= 700;
  1807. System.out.println("\nYou buy a +STR potion.");
  1808. option = i.nextLine().toLowerCase();
  1809. strPotionCount++;
  1810. strPotion = true;
  1811. }else{
  1812. System.out.println("\nNot enough money!");
  1813. option = i.nextLine().toLowerCase();
  1814. }
  1815.  
  1816. }else if(option.equals("e")){
  1817. System.out.println("\nYou exit the shop.");
  1818. dragonWorld2();
  1819. }else{
  1820. option = i.nextLine().toLowerCase();
  1821. }
  1822. }
  1823.  
  1824. }else if(option.equals("e")){
  1825. System.out.println("\nYou exit the shop.");
  1826. dragonWorld2();
  1827. }else{
  1828. option = i.nextLine().toLowerCase();
  1829. }
  1830. }
  1831. }
  1832.  
  1833. public static void unicorn() throws InterruptedException{
  1834. fight = true;
  1835. m_hp = 35;
  1836. System.out.println(mons[6]);
  1837.  
  1838. while(fight == true){
  1839. m_dmg = r.nextInt(10);
  1840. goldDrop = 1+r.nextInt(75);
  1841. monsterDrop = 1+r.nextInt(15);
  1842. dmg = r.nextInt(str);
  1843. dmg *= 0.5;
  1844. healSelf = 1+r.nextInt(3);
  1845. healSelfAmount = 1+r.nextInt(5);
  1846. System.out.println("Unicorn (HP:" + m_hp + "/35) does " + m_dmg + " damage");
  1847. hp -= m_dmg;
  1848. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage\n");
  1849. m_hp -= dmg;
  1850. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  1851. System.out.println(healSelfAmount + "+ heal!");
  1852. hp += healSelfAmount;
  1853. if(hp > hpMax){
  1854. hp = hpMax;
  1855. }
  1856. }
  1857. System.out.println();
  1858. Thread.sleep(1500);
  1859.  
  1860. if(m_hp <= 0){
  1861. fight = false;
  1862. System.out.println("You killed the unicorn\nGained 65 exp\nDrops:\nGold x" + goldDrop);
  1863. if(monsterDrop == 1 && holyAmulet == false){
  1864. System.out.println("Holy amulet");
  1865. holyAmulet = true;
  1866. }
  1867. gold += goldDrop;
  1868. exp += 65;
  1869. lvlsystem();
  1870. }else if(hp <= 0){
  1871. fight = false;
  1872. System.out.println("\nYou died!");
  1873. System.out.println("Lost some gold.");
  1874. gold *= 0.5;
  1875. hp = hpMax;
  1876. home();
  1877. }else if(hp <= 0 && m_hp <= 0){
  1878. fight = false;
  1879. System.out.println("\nYou died!");
  1880. System.out.println("Lost some gold.");
  1881. gold *= 0.5;
  1882. hp = hpMax;
  1883. home();
  1884. }
  1885. }
  1886. }
  1887.  
  1888. public static void treeMonster() throws InterruptedException{
  1889. fight = true;
  1890. m_hp = 60;
  1891. System.out.println(mons[7]);
  1892.  
  1893. while(fight == true){
  1894. m_dmg = r.nextInt(6);
  1895. goldDrop = 1+r.nextInt(50);
  1896. monsterDrop = 1+r.nextInt(15);
  1897. dmg = r.nextInt(str);
  1898. dmg *= 0.5;
  1899. System.out.println("Tree monster (HP:" + m_hp + "/60) does " + m_dmg + " damage");
  1900. hp -= m_dmg;
  1901. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  1902. m_hp -= dmg;
  1903. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  1904. System.out.println(healSelfAmount + "+ heal!");
  1905. hp += healSelfAmount;
  1906. if(hp > hpMax){
  1907. hp = hpMax;
  1908. }
  1909. }
  1910. System.out.println();
  1911. Thread.sleep(1500);
  1912.  
  1913. if(m_hp <= 0){
  1914. fight = false;
  1915. System.out.println("You killed the tree monster\nGained 80 exp\nDrops:\nGold x" + goldDrop);
  1916. if(monsterDrop == 1 && leafShield == false){
  1917. System.out.println("Leaf shield");
  1918. leafShield = true;
  1919. }
  1920. gold += goldDrop;
  1921. exp += 80;
  1922. lvlsystem();
  1923. }else if(hp <= 0){
  1924. fight = false;
  1925. System.out.println("\nYou died!");
  1926. System.out.println("Lost some gold.");
  1927. gold *= 0.5;
  1928. hp = hpMax;
  1929. home();
  1930. }else if(hp <= 0 && m_hp <= 0){
  1931. fight = false;
  1932. System.out.println("\nYou died!");
  1933. System.out.println("Lost some gold.");
  1934. gold *= 0.5;
  1935. hp = hpMax;
  1936. home();
  1937. }
  1938. }
  1939. }
  1940.  
  1941. public static void phoenix() throws InterruptedException{
  1942. fight = true;
  1943. m_hp = 50;
  1944. System.out.println(mons[8]);
  1945.  
  1946. while(fight == true){
  1947. m_dmg = r.nextInt(5);
  1948. goldDrop = 1+r.nextInt(100);
  1949. monsterDrop = 1+r.nextInt(15);
  1950. heal = 1+r.nextInt(4);
  1951. healAmount = 1+r.nextInt(7);
  1952. dmg = r.nextInt(str);
  1953. dmg *= 0.5;
  1954. healSelf = 1+r.nextInt(3);
  1955. healSelfAmount = 1+r.nextInt(5);
  1956. System.out.println("Phoenix (HP:" + m_hp + "/50) does " + m_dmg + " damage");
  1957. if(heal == 1){
  1958. System.out.println("+" + healAmount + " heal!");
  1959. }
  1960. hp -= m_dmg;
  1961. System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
  1962. m_hp -= dmg;
  1963. if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
  1964. System.out.println(healSelfAmount + "+ heal!");
  1965. hp += healSelfAmount;
  1966. if(hp > hpMax){
  1967. hp = hpMax;
  1968. }
  1969. }
  1970. System.out.println();
  1971. Thread.sleep(1500);
  1972.  
  1973. if(m_hp <= 0){
  1974. fight = false;
  1975. System.out.println("You killed the phoenix\nGained 100 exp\nDrops:\nGold x" + goldDrop);
  1976. if(monsterDrop == 1 && phoenixPet == false){
  1977. System.out.println("Phoenix pet");
  1978. phoenixPet = true;
  1979. }
  1980. gold += goldDrop;
  1981. exp += 100;
  1982. lvlsystem();
  1983. }else if(hp <= 0){
  1984. fight = false;
  1985. System.out.println("\nYou died!");
  1986. System.out.println("Lost some gold.");
  1987. gold *= 0.5;
  1988. hp = hpMax;
  1989. home();
  1990. }else if(hp <= 0 && m_hp <= 0){
  1991. fight = false;
  1992. System.out.println("\nYou died!");
  1993. System.out.println("Lost some gold.");
  1994. gold *= 0.5;
  1995. hp = hpMax;
  1996. home();
  1997. }
  1998. }
  1999. }
  2000. }
Advertisement
Add Comment
Please, Sign In to add comment