Advertisement
Guest User

BattleCatsNewSeedCalc

a guest
Jan 26th, 2018
2,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. public class perfect {
  2. // ===== CHANGE THIS DATA BASED ON YOUR CURRENT GATCHA
  3.  
  4. // Number of different Uber-Super-Rares in this set.
  5. public static final int UBER_COUNT = 7;
  6. // Number of different Super-Rares in this set.
  7. public static final int SUPER_COUNT = 16;
  8. // Number of different Rares in this set, usually 23.
  9. public static final int RARE_COUNT = 23;
  10.  
  11. // Chance of an Uber-Super-Rare, in this gatcha, in percent.
  12. // This is 3% in guaranteed events, 5% in most normal events, and 9% in uberfests.
  13. public static final int UBER_CHANCE = 3;
  14. // Chance of a Super-Rare, in this gatcha, in percent.
  15. // This is 22% in guaranteed events, 20% in most normal events, and 26% in uberfests.
  16. public static final int SUPER_CHANCE = 22;
  17.  
  18. // ===== END GATCHA DATA
  19.  
  20. // Converting the above percentages to values out of 10,000.
  21. public static final int UBER_THRESHOLD = 10000 - (UBER_CHANCE * 100);
  22. public static final int SUPER_THRESHOLD = 10000 - (UBER_CHANCE * 100) - (SUPER_CHANCE * 100);
  23.  
  24. static int f(int x) {
  25. // Calculate a new seed value from the previous one.
  26. x ^= x << 13;
  27. x ^= x >> 17;
  28. x ^= x << 15;
  29. return x;
  30. }
  31. static int rem1(int x){
  32. // Use the seed to calculate rarity.
  33. x = Math.abs(x);
  34. x = x%10000; // 0-9999
  35. if(x > UBER_THRESHOLD) { // Uber-rares 9% (9100) in uberfest, 5% (9500) in normal, 3% (9700) in guaranteeds
  36. return 2;
  37. }else if (x > SUPER_THRESHOLD) { // Super-rares 26% (6500) in uberfest, 20% (7500) in normal, 22% (7500) in guaranteeds
  38. return 1;
  39. }else{ // Rares
  40. return 0;
  41. }
  42. }
  43. static int rem2(int r,int y){
  44. // Use the seed to choose from the rarity's pool.
  45. y = Math.abs(y);
  46. if(r==2){
  47. return y%UBER_COUNT; // There are # uber-rares in a pool
  48. }else if (r==1){
  49. return y%SUPER_COUNT; // There are # super-rares in a pool
  50. }else {
  51. return y%RARE_COUNT; // There are # rares in a pool
  52. }
  53. }
  54.  
  55.  
  56. public static void main(String[] args){
  57. // =====
  58. // CHANGE THIS ARRAY TO YOUR CAT PULLS
  59. int[][] array = {{1,8}, {0,0}, {0,11}, {1,15}, {1,10}, {0,17}, {0,2}, {0,7}, {0,21}, {0,15}};
  60. // =====
  61. for (int i=Integer.MIN_VALUE;i<Integer.MAX_VALUE;i++){
  62. int seed = i;
  63. int j = 0;
  64. boolean Running = true;
  65. while(j<array.length && Running){
  66. int rarity = rem1(seed);
  67. seed = f(seed);
  68. int slot = rem2(rarity,seed);
  69. if (rarity != array[j][0]) {
  70. Running = false;
  71. }
  72. if (slot != array[j][1]) {
  73. Running = false;
  74. }
  75. seed = f(seed);
  76. if (j==9){
  77. System.out.println("Your seed value is:");
  78. System.out.println(i);
  79. }
  80. j ++;
  81. }
  82. }
  83. System.out.println("Have a nice day! (•̀ᴗ•́)");
  84. }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement