Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- prob_item1 = 0.912 # Item1 base probability
- prob_item2_base = 0.08 # Item2 base probability
- prob_item3_base = 0.008 # Item3 base probability
- prob_boost = 0.05 # Boost after 65 creations without item3
- guaranteed_at = 79 # Guaranteed item3 after 79 creations
- rate_up_at = 119
- rolls = 120
- def simulate_long_creations(num_creations):
- # Initialize counts and tracker
- item1_count = 0
- item2_count = 0
- item3_count = 0
- creations_since_item3 = 0
- creations_since_item2 = 0
- rate_up_count = 0
- prob_item3 = prob_item3_base # Start with base probability for item3
- prob_item2 = prob_item2_base
- for __ in range (num_creations):
- for _ in range(rolls):
- rand = np.random.random() # Random value for selection
- # Check if item3
- if rand < prob_item3:
- item3_count += 1
- creations_since_item3 = 0 # Reset after getting item3
- prob_item3 = prob_item3_base # Reset item3 probability after getting it
- continue
- # Increment creations count since item3
- creations_since_item3 += 1
- creations_since_item2 += 1
- rate_up_count += 1
- # Boost item3 probability if applicable
- if creations_since_item3 > 65:
- prob_item3 = min(prob_item3_base + (creations_since_item3 - 65) * prob_boost, 1.0)
- # Guarantee item3 after 79 creations
- if creations_since_item3 >= guaranteed_at:
- prob_item3 = 1.0 # Ensure item3 after 79 creations
- # Guarantee item3 after 119
- if rate_up_count == 119:
- prob_item3 = 1.0
- if prob_item3 != 1.0:
- if creations_since_item2 >= 9:
- prob_item2 = 1.0
- # Check for item2 if item3 is not chosen
- if rand < prob_item2 + prob_item3:
- item2_count += 1
- creations_since_item2 = 0
- prob_item2 = prob_item2_base
- else:
- # Otherwise, it's item1
- item1_count += 1
- return item1_count, item2_count, item3_count
- # Simulate with 10,000 loops of 120 rolls
- simulations=10000
- item1_count, item2_count, item3_count = simulate_long_creations(simulations)
- print("endfield stuff")
- print(item1_count/simulations, item2_count/simulations, item3_count/simulations)
- 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))
- 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)))
- 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)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement