Advertisement
SacredNoob

Endfield Beta Gacha Stuff

Jan 17th, 2025
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.15 KB | None | 0 0
  1. import numpy as np
  2.  
  3. prob_item1 = 0.912 # Item1 base probability
  4. prob_item2_base = 0.08 # Item2 base probability
  5. prob_item3_base = 0.008 # Item3 base probability
  6. prob_boost = 0.05 # Boost after 65 creations without item3
  7. guaranteed_at = 79 # Guaranteed item3 after 79 creations
  8. rate_up_at = 119
  9. rolls = 120
  10.  
  11. def simulate_long_creations(num_creations):
  12. # Initialize counts and tracker
  13. item1_count = 0
  14. item2_count = 0
  15. item3_count = 0
  16. creations_since_item3 = 0
  17. creations_since_item2 = 0
  18. rate_up_count = 0
  19. prob_item3 = prob_item3_base # Start with base probability for item3
  20. prob_item2 = prob_item2_base
  21.  
  22. for __ in range (num_creations):
  23. for _ in range(rolls):
  24. rand = np.random.random() # Random value for selection
  25.  
  26. # Check if item3
  27. if rand < prob_item3:
  28. item3_count += 1
  29. creations_since_item3 = 0 # Reset after getting item3
  30. prob_item3 = prob_item3_base # Reset item3 probability after getting it
  31. continue
  32.  
  33. # Increment creations count since item3
  34. creations_since_item3 += 1
  35. creations_since_item2 += 1
  36. rate_up_count += 1
  37.  
  38. # Boost item3 probability if applicable
  39. if creations_since_item3 > 65:
  40. prob_item3 = min(prob_item3_base + (creations_since_item3 - 65) * prob_boost, 1.0)
  41.  
  42. # Guarantee item3 after 79 creations
  43. if creations_since_item3 >= guaranteed_at:
  44. prob_item3 = 1.0 # Ensure item3 after 79 creations
  45.  
  46. # Guarantee item3 after 119
  47. if rate_up_count == 119:
  48. prob_item3 = 1.0
  49.  
  50. if prob_item3 != 1.0:
  51. if creations_since_item2 >= 9:
  52. prob_item2 = 1.0
  53.  
  54. # Check for item2 if item3 is not chosen
  55. if rand < prob_item2 + prob_item3:
  56. item2_count += 1
  57. creations_since_item2 = 0
  58. prob_item2 = prob_item2_base
  59. else:
  60. # Otherwise, it's item1
  61. item1_count += 1
  62.  
  63. return item1_count, item2_count, item3_count
  64.  
  65. # Simulate with 10,000 loops of 120 rolls
  66. simulations=10000
  67. item1_count, item2_count, item3_count = simulate_long_creations(simulations)
  68. print("endfield stuff")
  69. print(item1_count/simulations, item2_count/simulations, item3_count/simulations)
  70. print("4star%:", round(item1_count/simulations/rolls*100,3), "| 5star%:", round(item2_count/simulations/rolls*100,3), "| 6star%:", round(item3_count/simulations/rolls*100,3))
  71. print("weapon pull currency per roll: ", round((item1_count*50+item2_count*500+item3_count*1500)/simulations/rolls,3), "| rolls until 3k currency (weapon banner pull): ", round(3000/((item1_count*50+item2_count*500+item3_count*1500)/simulations/rolls)))
  72. print("certs per roll: ", round((item2_count*10+item3_count*50)/simulations/rolls,3), "| rolls until 500 (standard character shop): ", round(500/((item2_count*10+item3_count*50)/simulations/rolls)))
  73.  
  74.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement