Advertisement
Guest User

RPG

a guest
May 26th, 2015
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.56 KB | None | 0 0
  1. public class Player
  2. {
  3. String playerName;
  4. int playerHP;
  5. int playerLevel;
  6. int playerAttack;
  7. int playerDefence;
  8. int playerMoney;
  9. int playerRange;
  10. public Player(String name, int hP, int level, int attack, int defence,int range, int money)
  11. {
  12. playerName = name;
  13. playerHP = hP;
  14. playerLevel = level;
  15. playerAttack = attack;
  16. playerDefence = defence;
  17. playerMoney = money;
  18. playerRange = range;
  19. }
  20. public String getName()
  21. {
  22. return playerName;
  23. }
  24.  
  25. public int getHP()
  26. {
  27. return playerHP;
  28. }
  29. public void changeHP(int amount)
  30. {
  31. playerHP = playerHP+amount;
  32. }
  33.  
  34. public int getLevel()
  35. {
  36. return playerLevel;
  37. }
  38.  
  39. public int getAttack()
  40. {
  41. return playerAttack;
  42. }
  43. public void changeAttack(int amount)
  44. {
  45. playerAttack = playerAttack+amount;
  46. }
  47.  
  48. public int getDefence()
  49. {
  50. return playerDefence;
  51. }
  52. public void changeDefence(int amount)
  53. {
  54. playerDefence = playerDefence+amount;
  55. }
  56.  
  57. public int getRange()
  58. {
  59. return playerRange;
  60. }
  61. public void changeRange(int amount)
  62. {
  63. playerRange = playerRange+amount;
  64. }
  65.  
  66. public int getMoney()
  67. {
  68. return playerMoney;
  69. }
  70. public void changeMoney(int amount)
  71. {
  72. playerMoney = playerMoney+amount;
  73. }
  74. }
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81. public class Monster
  82. {
  83. String monsterName;
  84. int monsterHP;
  85. int monsterLevel;
  86. int monsterAttack;
  87. int monsterDefence;
  88. int monsterMoney;
  89. int monsterExperence;
  90. public Monster(String name, int hP, int level, int attack, int defence,int money,int experence)
  91. {
  92. monsterName = name;
  93. monsterHP = hP;
  94. monsterLevel = level;
  95. monsterAttack = attack;
  96. monsterDefence = defence;
  97. monsterMoney = money;
  98. monsterExperence = experence;
  99. }
  100. public String getName()
  101. {
  102. return monsterName;
  103. }
  104. public int getHP()
  105. {
  106. return monsterHP;
  107. }
  108. public int getLevel()
  109. {
  110. return monsterLevel;
  111. }
  112. public int getAttack()
  113. {
  114. return monsterAttack;
  115. }
  116. public int getDefence()
  117. {
  118. return monsterDefence;
  119. }
  120. public int getMoney()
  121. {
  122. return monsterMoney;
  123. }
  124. public int getExperence()
  125. {
  126. return monsterExperence;
  127. }
  128. public void takeDamage(int damageTaken)
  129. {
  130. monsterHP = monsterHP - damageTaken;
  131. }
  132. }
  133.  
  134.  
  135.  
  136. import java.util.Scanner;
  137. import java.util.Random;
  138. public class FuturamaGame
  139. {
  140. static Scanner text = new Scanner(System.in);
  141. static Random RNG = new Random();
  142. static Player jon;
  143. public static void main(String []agrs)
  144. {
  145. System.out.println("Planet Express Delivery Company RPG");
  146. System.out.println("Professor: Good news everyone, today you will be delvering a package"+
  147. "\nto Omicron Persei 8. The package contains the rest of the popplers, so make sure to be"+
  148. "carefull with the goods!");
  149.  
  150. System.out.println("Please pick a character! (Leela, Fry, Bender, Nibbler, Scruffy");
  151. String charPick = text.next();
  152. if(charPick.equalsIgnoreCase("Leela"))
  153. {
  154. System.out.println("You picked Leela! She is great at melee combat!");
  155. jon = new Player("Leela",75,80,80,80,0,100);
  156. }
  157. if(charPick.equalsIgnoreCase("Fry"))
  158. {
  159. System.out.println("You picked Fry! He is bad at everything!");
  160. jon = new Player("Fry",40,40,40,40,40,500);
  161. }
  162. if(charPick.equalsIgnoreCase("Bender"))
  163. {
  164. System.out.println("You picked Bender! He is good at stealing things and running away!");
  165. jon = new Player("Bender",60,70,70,85,10,250);
  166. }
  167. if(charPick.equalsIgnoreCase("Nibbler"))
  168. {
  169. System.out.println("You picked Nibbler! He is great at eating massive things!");
  170. jon = new Player("Nibbler",50,80,75,90,100,100);
  171. }
  172. if(charPick.equalsIgnoreCase("Scruffy"))
  173. {
  174. System.out.println("You picked Scruffy! He is good at mopping the floor!");
  175. System.out.println("You stay home all day mopping the floor and doing nothing.");
  176. System.exit(0);
  177. }
  178. else
  179. {
  180. System.out.println("Invalid option you automatically pick Nibbler.");
  181. }
  182.  
  183. System.out.println("Welcome to the shop! 5 levels in any skill (Range,Attack,Defence, HP) costs $25");
  184. int loop1 = 5;
  185. while(loop1==5)
  186. {
  187. System.out.println("Please print out what skill you would like to improve!\nIf you wouldnt like to buy anything simply type *");
  188. if(jon.getMoney()>=25)
  189. {
  190. String shopResponse = text.next();
  191. if(shopResponse.equalsIgnoreCase("Range"))
  192. {
  193. jon.changeMoney(-25);
  194. jon.changeRange(5);
  195. }
  196. else if(shopResponse.equalsIgnoreCase("Attack"))
  197. {
  198. jon.changeMoney(-25);
  199. jon.changeAttack(5);
  200. }
  201. else if(shopResponse.equalsIgnoreCase("Defence"))
  202. {
  203. jon.changeMoney(-25);
  204. jon.changeDefence(5);
  205. }
  206. else if(shopResponse.equalsIgnoreCase("HP"))
  207. {
  208. jon.changeMoney(-25);
  209. jon.changeHP(5);
  210. }
  211. else if(shopResponse.equalsIgnoreCase("*"))
  212. {
  213. loop1++;
  214. }
  215. }
  216. else
  217. {
  218. System.out.println("YOU DO NOT HAVE ENOUGH CASH");
  219. loop1++;
  220. }
  221. }
  222.  
  223.  
  224.  
  225. System.out.println("Leela: Lets get on the ship!");
  226.  
  227. System.out.println("You take off on the long journey to Omicron Persei 8");
  228. for(int delay = 0; delay<2;delay++)
  229. {
  230. System.out.println("___");
  231. System.out.println("--\\_____________");
  232. System.out.println(" / \\");
  233. System.out.println(" | /");
  234. System.out.println(" ------------");
  235.  
  236. System.out.println(" ___");
  237. System.out.println(" --\\_____________");
  238. System.out.println(" / \\");
  239. System.out.println(" | /");
  240. System.out.println(" ------------");
  241.  
  242. System.out.println(" ___");
  243. System.out.println(" --\\_____________");
  244. System.out.println(" / \\");
  245. System.out.println(" | /");
  246. System.out.println(" ------------");
  247.  
  248. System.out.println(" ___");
  249. System.out.println(" --\\_____________");
  250. System.out.println(" / \\");
  251. System.out.println(" | /");
  252. System.out.println(" ------------");
  253.  
  254. System.out.println(" ___");
  255. System.out.println(" --\\_____________");
  256. System.out.println(" / \\");
  257. System.out.println(" | /");
  258. System.out.println(" ------------");
  259.  
  260. System.out.println(" ___");
  261. System.out.println(" --\\_____________");
  262. System.out.println(" / \\");
  263. System.out.println(" | /");
  264. System.out.println(" ------------");
  265.  
  266. System.out.println("___");
  267. System.out.println("--\\_____________");
  268. System.out.println(" / \\");
  269. System.out.println(" | /");
  270. System.out.println(" ------------");
  271. }
  272. System.out.println("You land on Omicron Persei 8!");
  273. Monster brain = new Monster("Giant Brain", 150, 25, 50, 50, 100, 20000);
  274. System.out.println("YOU RUN INTO A GIANT BRAIN!!!");
  275. while(brain.getHP()>0)
  276. {
  277. if(charPick.equalsIgnoreCase("Leela"))
  278. {
  279. System.out.println("Would you like to kick, punch, or headbutt?");
  280. String attackPick = text.next();
  281. if(attackPick.equalsIgnoreCase("kick"))
  282. {
  283. int missOrHit = RNG.nextInt(4);
  284. if(missOrHit==0)
  285. {
  286. System.out.println("You missed!");
  287. }
  288. else
  289. {
  290. int damage = RNG.nextInt(jon.getAttack()/2)+40;
  291. brain.takeDamage(damage);
  292. }
  293. }
  294. if(attackPick.equalsIgnoreCase("punch"))
  295. {
  296. int damage = RNG.nextInt(jon.getAttack()/2)+20;
  297. brain.takeDamage(damage);
  298. }
  299. if(attackPick.equalsIgnoreCase("headbutt"))
  300. {
  301. int missOrHit = RNG.nextInt(2);
  302. if(missOrHit==0)
  303. {
  304. System.out.println("You missed!");
  305. }
  306. else
  307. {
  308. int damage = RNG.nextInt(jon.getAttack()/2)+100;
  309. brain.takeDamage(damage);
  310. }
  311. }
  312. }
  313. if(charPick.equalsIgnoreCase("Fry"))
  314. {
  315. System.out.println("The brain cannot hurt fry as he is the dumbest person in the world."+
  316. "\nThe brain dies on the spot, you then go and pick up: $!"+brain.getMoney());
  317. brain.takeDamage(brain.getHP());
  318.  
  319. }
  320. if(charPick.equalsIgnoreCase("Bender"))
  321. {
  322. System.out.println("Would you like to bend, smack, or steal the brain?");
  323. String attackPick = text.next();
  324. if(attackPick.equalsIgnoreCase("bend"))
  325. {
  326. int missOrHit = RNG.nextInt(2);
  327. if(missOrHit==0)
  328. {
  329. System.out.println("You missed!");
  330. }
  331. else
  332. {
  333. int damage = RNG.nextInt(jon.getAttack()/2)+100;
  334. brain.takeDamage(damage);
  335. }
  336. }
  337. if(attackPick.equalsIgnoreCase("smack"))
  338. {
  339. int damage = RNG.nextInt(jon.getAttack()/2)+20;
  340. brain.takeDamage(damage);
  341. }
  342. if(attackPick.equalsIgnoreCase("steal"))
  343. {
  344. int missOrHit = RNG.nextInt(3);
  345. if(missOrHit==0)
  346. {
  347. System.out.println("YOU STEEL THE BRAIN!");
  348. }
  349. else
  350. {
  351. System.out.println("You failed to steel the brain :'(");
  352. }
  353. }
  354. }
  355. if(charPick.equalsIgnoreCase("Nibbler"))
  356. {
  357. System.out.println("Would you like to shoot, drop dark matter, or eat?");
  358. String attackPick = text.next();
  359. if(attackPick.equalsIgnoreCase("shoot"))
  360. {
  361. int missOrHit = RNG.nextInt(4);
  362. if(missOrHit==0)
  363. {
  364. System.out.println("You missed!");
  365. }
  366. else
  367. {
  368. int damage = RNG.nextInt(jon.getRange()/2)+40;
  369. brain.takeDamage(damage);
  370. }
  371. }
  372. if(attackPick.equalsIgnoreCase("drop"))
  373. {
  374.  
  375. }
  376. if(attackPick.equalsIgnoreCase("eat"))
  377. {
  378.  
  379. }
  380. }
  381. }
  382. }
  383. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement