Guest User

Untitled

a guest
Oct 15th, 2013
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. package org.pokemon.utils;
  2.  
  3. /**
  4. * A class representing, presenting and containing the Catch Chance.
  5. * @author Savions Sw.
  6. *
  7. */
  8. public class CatchChance {
  9.  
  10. /**
  11. * The main.
  12. * @param args The arguements.
  13. */
  14. public static void main(String[] args) {
  15. System.out.println(getDefaultValue(300, 2, 5, 2, 1.5));
  16. }
  17.  
  18. /**
  19. * Get the default catch value.
  20. * @param maxHP The max HP.
  21. * @param hp The current HP.
  22. * @param rate The rate.
  23. * @param ball_modif The ball modifer.
  24. * @param stat_modif The stat modifer.
  25. * @return The default catch value.
  26. */
  27. public static double getDefaultValue(int maxHP, int hp, double rate, double ball_modif, double stat_modif) {
  28. return ((3 * maxHP - 2 * hp) * (rate * ball_modif) / (3 * maxHP)) * stat_modif;
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment