Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. public boolean applyPotentialStats() {
  2. final int chance = Math.max(100 - (potLevel * 10), 10);
  3. if (Math.round(Math.random() * 100) > chance) {
  4. return false;
  5. }
  6. int potChance = (int)(11*Math.random() + 1);
  7.  
  8. if (potChance == 1 ) {
  9. patk += (short)(4*Math.random());
  10. pacc += (short)(7*Math.random());
  11. } else if (potChance == 2) {
  12. pmatk += (short)(4*Math.random());
  13. pstr += (short)(6*Math.random());
  14. } else if (potChance == 3) {
  15. pdex += (short)(8*Math.random());
  16. } else if (potChance == 4) {
  17. pluk += (short)(6*Math.random());
  18. pacc += (short)(7*Math.random());
  19. } else if (potChance == 5) {
  20. pint += (short)(6*Math.random());
  21. pstr += (short)(6*Math.random());
  22. } else if (potChance == 6) {
  23. patk += (short)(5*Math.random());
  24. } else if (potChance == 7) {
  25. pmatk += (short)(5*Math.random());
  26. } else if (potChance == 8) {
  27. pstr += (short)(8*Math.random());
  28. } else if (potChance == 9) {
  29. pluk += (short)(8*Math.random());
  30. } else if (potChance == 10) {
  31. pint += (short)(8*Math.random());
  32. } else if (potChance == 11) {
  33. pacc += (short)(15*Math.random());
  34. }
  35. loadPotentialStats();
  36. setPotLevel(potLevel + 1);
  37. return true;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement