Advertisement
SuperSalad1

Venti/Promo banner odds

Oct 14th, 2020
3,653
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub venti_odds()
  2. '
  3. 'odds and probability values
  4. Dim total_rolls As Long: total_rolls = 10000000 'total rolls to simulate
  5. Dim venti_odds As Single: venti_odds = 0.5 'chance of getting venti (initially)
  6. Dim venti_pity As Single: venti_pity = 2 'psuedo pity garauntee for getting venti
  7.  
  8.  
  9. Dim rand As Single
  10.  
  11. 'start counters at 0
  12. Dim nonboost As Long: nonboost = 0
  13. Dim venti As Long: venti = 0
  14. Dim ventistreak As Integer: ventistreak = 0
  15. Dim nat_venti As Long: nat_venti = 0
  16. Dim pity_venti As Long: pity_venti = 0
  17.  
  18. For i = 1 To total_rolls
  19.  
  20.     'randomize roll
  21.    rand = Rnd()
  22.    
  23.     'if pity venti
  24.    If ventistreak >= venti_pity - 1 Then
  25.         pity_venti = pity_venti + 1
  26.         venti = venti + 1
  27.         ventistreak = 0
  28.     'if natural venti
  29.    ElseIf rand <= venti_odds Then
  30.         nat_venti = nat_venti + 1
  31.         venti = venti + 1
  32.         ventistreak = 0
  33.     'else random 5*
  34.    Else
  35.         nonboost = nonboost + 1
  36.         ventistreak = ventistreak + 1
  37.     End If
  38.    
  39. 'next roll
  40. Next i
  41.  
  42. 'export results into spreadsheet
  43. Cells(15, 2).Value = venti 'total venti pulls
  44. Cells(15, 3).Value = nonboost 'total non boosted character pulls
  45. Cells(15, 4).Value = nat_venti 'total natural Venti pulls
  46. Cells(15, 5).Value = pity_venti 'total pity venti pulls
  47.  
  48. End Sub
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement