Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.11 KB | None | 0 0
  1. import java.util.Scanner;
  2. // Aaron and Jaden
  3. public class Battle {
  4. static Scanner scanner = new Scanner(System.in);
  5. public static void main(String args[]) {
  6. String pokemon = pokemon();
  7. damage(pokemon);
  8. }
  9. public static String pokemon() {
  10. System.out.println("Another trainer is issuing a challenge!\n");
  11. System.out.println("A lvl 100 Pidgey appeared.");
  12. System.out.println(" ");
  13. System.out.println(" ,_ / ");
  14. System.out.println(" __|/|||_ ");
  15. System.out.println(" /__`\\{O}/, ");
  16. System.out.println(" `|_/ / \\_ ");
  17. System.out.println(" / \\ , `\\___ ");
  18. System.out.println(" / | \\> ");
  19. System.out.println(" (|(|(|(|)\\ ^^\\ _/\\");
  20. System.out.println(" ( \\_ |,//___\\ ");
  21. System.out.println(" \\________ \\_\\ )-----\\ ");
  22. System.out.println(" || || \\| ");
  23. System.out.println(" <</<</`\\> ");
  24. System.out.println("\nWhich Pokemon do you choose?\n");
  25. String pokemon = scanner.nextLine();
  26. System.out.println("You choose " + pokemon);
  27. System.out.println("It’s a Pokemon battle between " + pokemon + " and Pidgey! Go!\n");
  28. return pokemon;
  29.  
  30. }
  31. public static double damage(String name) {
  32. System.out.println("Trainer, what are your " + name + "'s stats?");
  33. System.out.print("Level:");
  34. int lvl = scanner.nextInt();
  35. System.out.print("Attack:");
  36. int attack = scanner.nextInt();
  37. System.out.print("Defense:");
  38. int defense = scanner.nextInt();
  39. System.out.print("Base:");
  40. int base = scanner.nextInt();
  41. System.out.print("STAB:");
  42. int stab = scanner.nextInt();
  43. System.out.print("HP:");
  44. int hp = scanner.nextInt();
  45. int pidattack = 45;
  46. int piddefense = 40;
  47. int pidhp = 40;
  48. int pidlvl = 100;
  49. int pidstab = 5;
  50. int pidbase = 10;
  51. double damage;
  52. double piddam;
  53. for (int i = 1; i <= hp && i <= pidhp; i++) {
  54. damage = (int) (Math.round(((2 * lvl) / 25) * (pidattack / defense) * base + 2) * (stab * ((Math.random() * .15) + .85)));
  55. hp -= damage;
  56. System.out.println("Pidgey attacks and " + name + " sustained " + (int) damage + " points damage. HP are now " + hp);
  57. piddam = (int) (Math.round(((2 * pidlvl) / 25) * (attack / piddefense) * pidbase + 2) * (pidstab * ((Math.random() * .15) + .85)));
  58. pidhp -= piddam;
  59. System.out.println(name + " attacks and Pidgey sustained " + (int) piddam + " points damage. HP are now " + pidhp);
  60. }
  61. System.out.println("What is your pokemon's first move: ");
  62. String moveone = scanner.nextLine();
  63. moveone = scanner.nextLine();
  64. System.out.println("What is your pokemon's second move: ");
  65. String movetwo = scanner.nextLine();
  66. System.out.println("What is your pokemon's third move: ");
  67. String movethree = scanner.nextLine();
  68. System.out.println("What is your pokemon's fourth move: ");
  69. String movefour = scanner.nextLine();
  70. System.out.println("What is your pokemon's dex no.: ");
  71. int dex = scanner.nextInt();
  72. statsTable(lvl, hp, attack, defense, base, stab, name, moveone, movetwo, movethree, movefour, dex);
  73. return hp;
  74. }
  75. public static void statsTable(int level, int hp, int atk, int def, int base, int stab, String name, String moveOne, String moveTwo, String moveThree, String moveFour, int dex){
  76. int spAtk, spDef;
  77. int speed = (int) (Math.random() * 50 + 70);
  78.  
  79. String[] words = {"DEX NO.", "HP", "ATTACK", "DEFENSE", "SP. ATK", "SP. DEF", "SPEED", "NATURE", "ABILITY", "ITEM"};
  80. String spaces = " ";
  81. String[] nature = {"hardy", "lonely", "brave", "adamant", "naughty", "bold", "docile", "relaxed", "impish", "lax", "timid", "hasty", "serious", "jolly", "naive", "modest", "mild", "quiet", "bashful", "rash", "calm", "gentle", "sassy", "careful", "quirky"};
  82. String[] ability = {"adaptablity", "bad dreams", "cachophony", "download", "early bird", "filter", "gluttony", "huge power", "illuminate", "justified", "keen eye", "limber", "mervel scale", "natural cure", "oblivious", "plus", "quick feet", "rivalry", "slow start", "trace", "unnerve", "vital spirit", "white smoke", "zen mode"};
  83. String[] item = {"aguav berry", "belue berry", "bluk berry", "cornn berry","durin berry", "enigma berry", "figy berry", "grepa berry", "haban berry", "iapapa berry", "jaboca berry", "lansat berry", "nanab berry", "pinap berry", "razz berry", "wepear berry"};
  84.  
  85. System.out.print("Please input your pokemon's Special Attack: ");
  86. spAtk = scanner.nextInt();
  87. System.out.print("Please input your pokemon's Special Defense: ");
  88. spDef = scanner.nextInt();
  89.  
  90. System.out.println("\n" + name + spaces.substring(moveOne.length()) + "level " + level + "\n");
  91. System.out.println(words[0] + spaces.substring(words[0].length()) + dex);
  92. System.out.println(words[1] + spaces.substring(words[1].length()) + hp);
  93. System.out.println(words[2] + spaces.substring(words[2].length()) + atk);
  94. System.out.println(words[3] + spaces.substring(words[3].length()) + def);
  95. System.out.println(words[4] + spaces.substring(words[4].length()) + spAtk);
  96. System.out.println(words[5] + spaces.substring(words[5].length()) + spDef);
  97. System.out.println(words[6] + spaces.substring(words[6].length()) + speed);
  98. System.out.println(words[7] + spaces.substring(words[7].length()) + nature[(int) (Math.random() * 24)]);
  99. System.out.println(words[8] + spaces.substring(words[8].length()) + ability[(int) (Math.random() * 23)]);
  100. System.out.println(words[9] + spaces.substring(words[9].length()) + item[(int) (Math.random() * 15)]);
  101. System.out.println(spaces + "\nMOVESET\n");
  102. System.out.println(moveOne + spaces.substring(moveOne.length()) + moveTwo);
  103. System.out.println(moveThree + spaces.substring(moveThree.length()) + moveFour);
  104. }
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement