Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. function round(%n)
  2. {
  3. // dbecho($dbechoMode, "round(" @ %n @ ")");
  4.  
  5. if(%n < 0)
  6. {
  7. %t = -1;
  8. %n = -%n;
  9. }
  10. else if(%n >= 0)
  11. %t = 1;
  12.  
  13. %f = floor(%n);
  14. %a = %n - %f;
  15. if(%a < 0.5)
  16. %b = 0;
  17. else if(%a >= 0.5)
  18. %b = 1;
  19.  
  20. return (%f + %b) * %t;
  21. }
  22.  
  23. function RB(%a,%b)
  24. {
  25. return floor(getRandom() * (%b - %a) + %a);
  26. }
  27.  
  28. function CLeg()
  29. {
  30. %cost = 0;
  31. %f = 0;
  32. %count = 0;
  33. for (%i = 1; %f != 1; %i++) {
  34. %g = Legendary(1,1);
  35. %count += 1;
  36. if (%g == false)
  37. %cost += 34700;
  38. else
  39. %f = 1;
  40. }
  41. $TCOST += %cost;
  42. $LX += 1;
  43. echo("COST $" @ %cost @ " COUNT:" @ %count);
  44. }
  45.  
  46. function AvgCLeg()
  47. {
  48. echo($TCOST @ " " @ $LX);
  49. %avg = $TCOST / $LX;
  50. echo("AVG $" @ %avg);
  51. $TCOST = 0;
  52. $LX = 0;
  53. }
  54.  
  55. function Legendary(%t,%c)
  56. {
  57. %l = false;
  58. %h = 0;
  59. %hits = 0;
  60. for (%i = 1; %i <= %t; %i++) {
  61. %atk = RB(16,-10);
  62. %rng = RB(16,-10);
  63. %spd = RB(11,-3);
  64. %crt = RB(6,0);
  65. %combo = %atk @ " " @ %rng @ " " @ %spd @ " " @ %crt;
  66. %test = %atk + %rng + %spd + %crt;
  67. if (%test >= %h) { %h = %test; %hs = %combo; }
  68. if (%combo == "15 15 10 5") { %l = true; %hits++; }
  69. //echo(%combo);
  70. }
  71. if (%c) return %l;
  72. if (%l == true) echo("TRUE " @ %hits);
  73. else echo("FALSE " @ %hits);
  74. echo(%hs);
  75. return %hits;
  76. }
  77.  
  78. function MLeg(%t,%a)
  79. {
  80. $LHITS = 0;
  81. $LROLL = 0;
  82. %s = 0;
  83. for (%i = 1; %i <= %t; %i++) {
  84. schedule("GLeg(" @ %a @ ");",%s);
  85. %s += 1;
  86. }
  87. }
  88.  
  89. function GLeg(%a)
  90. {
  91. $LROLL += %a;
  92. $LHITS += Legendary(%a);
  93. %p = ($LHITS / $LROLL) * 100;
  94. echo("GLEG ROLL:" @ $LROLL @ " HITS:" @ $LHITS @ " P%" @ %p);
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement