Advertisement
Guest User

Untitled

a guest
Nov 7th, 2021
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. namespace Weapon_Gacha
  2. {
  3. class Program
  4. {
  5. static public int weaponBanner()
  6. {
  7. //not rate up
  8. int notRate = 0;
  9. //wrong rate up
  10. int wrongWeap = 0;
  11. //right weapon- end loop when we get it
  12. int rightWeap = 0;
  13. //out epimitmized path progress; set epiPath >3 to simulate it not existing.
  14. int epiPath = 0;
  15. //total five star weapons obtained
  16. int fiveStars = 0;
  17. //starting with pity?
  18. bool pity = true;
  19. var rand = new Random();
  20. while (rightWeap == 0)
  21. {
  22. if (epiPath != 2 && pity == false && rand.NextDouble() > .75)
  23. {
  24. pity = true;
  25. notRate += 1;
  26. epiPath += 1;
  27. fiveStars += 1;
  28. }
  29. else
  30. {
  31. if (epiPath != 2 && rand.NextDouble() > .5)
  32. {
  33. wrongWeap += 1;
  34. epiPath += 1;
  35. pity = false;
  36. fiveStars += 1;
  37. }
  38. else
  39. {
  40. rightWeap += 1;
  41. epiPath = 0;
  42. pity = false;
  43. fiveStars += 1;
  44. }
  45.  
  46. }
  47.  
  48. }
  49. return fiveStars;
  50. }
  51. static void Main(string[] args)
  52. {
  53. int i = 0;
  54. int received = 0;
  55. while (i < 10000000)
  56. {
  57. received += weaponBanner();
  58. i++;
  59. //Console.WriteLine("hello");
  60. }
  61. float rate = received / 10000000;
  62. Console.WriteLine(received + " out of 10,000,000, at a rate of " + (float)received/10000000);
  63. }
  64.  
  65.  
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement