Advertisement
Guest User

Untitled

a guest
Jul 9th, 2025
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.08 KB | Source Code | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Zodiac Rarity Chance Calculator</title>
  7. <style>
  8. body {
  9. font-family: Arial, sans-serif;
  10. max-width: 600px;
  11. margin: 0 auto;
  12. padding: 20px;
  13. transition: background-color 0.5s, color 0.5s;
  14. }
  15. .dark-mode {
  16. background-color: #2c2c2c;
  17. color: white;
  18. }
  19. h1 {
  20. text-align: center;
  21. }
  22. label {
  23. display: block;
  24. margin: 10px 0 5px;
  25. }
  26. input {
  27. width: 100%;
  28. padding: 8px;
  29. margin-bottom: 20px;
  30. box-sizing: border-box;
  31. }
  32. button {
  33. padding: 10px 20px;
  34. background-color: #007BFF;
  35. color: white;
  36. border: none;
  37. cursor: pointer;
  38. }
  39. button:hover {
  40. background-color: #0056b3;
  41. }
  42. .result {
  43. margin-top: 20px;
  44. }
  45. .toggle-button {
  46. margin: 10px 0;
  47. padding: 10px;
  48. background-color: #444;
  49. color: white;
  50. border: none;
  51. cursor: pointer;
  52. }
  53. .rarity-chance {
  54. border: 1px solid #339933;
  55. border-collapse: collapse;
  56. width: 100%;
  57. color: black;
  58. font-size: 65%;
  59. th {
  60. border: 1px solid #339933;
  61. border-collapse: collapse;
  62. height: 20px;
  63. }
  64. td {
  65. border: 1px solid #339933;
  66. border-collapse: collapse;
  67. height: 30px;
  68. background-color: #effbfd;
  69. text-align: center;
  70. font-size: 125%;
  71. }
  72. .header-garbage {
  73. background-color: #635f5f;
  74. }
  75. .header-common {
  76. background-color: #b5b5b5;
  77. }
  78. .header-uncommon {
  79. background-color: #789c44;
  80. }
  81. .header-rare {
  82. background-color: #4f87dc;
  83. }
  84. .header-epic {
  85. background-color: #c855c8;
  86. }
  87. .header-legendary {
  88. background-color: #e4a44e;
  89. }
  90. .header-mythic {
  91. background-color: #d24949;
  92. }
  93. .header-godly {
  94. background-color: #f3f443;
  95. }
  96. .header-divine {
  97. background-color: #90fff8;
  98. }
  99. .header-immortal {
  100. background-color: #79ffc6;
  101. }
  102. }
  103. </style>
  104. </head>
  105. <body>
  106. <h1>Zodiac Rarity Chance Calculator</h1>
  107.  
  108. <button class="toggle-button" onclick="toggleDarkMode()">Toggle Dark Mode</button>
  109.  
  110. <label for="luck">Luck (e.g., 5):</label>
  111. <input type="text" id="luck" placeholder="Enter luck">
  112.  
  113. <button onclick="calculate()">Calculate</button>
  114.  
  115. <div class="result">
  116. <div class="info" id="info"></div>
  117. <div id="tables" style="display: none;">
  118. <table class="rarity-chance">
  119. <tr>
  120. <th class="header-garbage">Garbage</th>
  121. <th class="header-common">Common</th>
  122. <th class="header-uncommon">Uncommon</th>
  123. <th class="header-rare">Rare</th>
  124. <th class="header-epic">Epic</th>
  125. <th class="header-legendary">Legendary</th>
  126. <th class="header-mythic">Mythic</th>
  127. <th class="header-godly">Godly</th>
  128. <th class="header-divine">Divine</th>
  129. <th class="header-immortal">Immortal</th>
  130. </tr>
  131. <tr>
  132. <td id="chance-garbage"></td>
  133. <td id="chance-common"></td>
  134. <td id="chance-uncommon"></td>
  135. <td id="chance-rare"></td>
  136. <td id="chance-epic"></td>
  137. <td id="chance-legendary"></td>
  138. <td id="chance-mythic"></td>
  139. <td id="chance-godly"></td>
  140. <td id="chance-divine"></td>
  141. <td id="chance-immortal"></td>
  142. </tr>
  143. </table>
  144. <table class="rarity-chance" id="extra-rarity" style="margin-top: 10px;"></table>
  145. </div>
  146. </div>
  147.  
  148. <script>
  149. function toggleDarkMode() {
  150. document.body.classList.toggle('dark-mode');
  151. }
  152.  
  153. function formatChance(chance) {
  154. return Math.round(chance * 10000) / 100 + '%';
  155. }
  156.  
  157. function calculate() {
  158. var luck = parseFloat(document.getElementById('luck').value);
  159. if (luck < 0 || isNaN(luck)) {
  160. document.getElementById('info').innerText = "Please enter valid numbers. Luck cannot be negative or not a number.";
  161. document.getElementById('tables').style.display = "none";
  162. return;
  163. }
  164.  
  165. if (luck > 18) luck = Math.pow(luck / 18, 0.3) * 18;
  166.  
  167. const garbageWeight = calculateGarbage(luck);
  168. const commonWeight = calculateCommon(luck);
  169. const uncommonWeight = calculateUncommon(luck);
  170. const rareWeight = calculateRare(luck);
  171. const epicWeight = calculateEpic(luck);
  172. const legendaryWeight = calculateLegendary(luck);
  173. const mythicWeight = calculateMythic(luck);
  174. const godlyWeight = calculateGodly(luck);
  175. const divineWeight = calculateDivine(luck);
  176. const immortalWeight = calculateImmortal(luck);
  177.  
  178. const garbageChance = Math.min(Math.max(garbageWeight / (garbageWeight + commonWeight + uncommonWeight + rareWeight + epicWeight + legendaryWeight + mythicWeight + godlyWeight + divineWeight + immortalWeight), 0), 1);
  179. const commonChance = Math.min(Math.max(commonWeight / (garbageWeight + commonWeight + uncommonWeight + rareWeight + epicWeight + legendaryWeight + mythicWeight + godlyWeight + divineWeight + immortalWeight), 0), 1);
  180. const uncommonChance = Math.min(Math.max(uncommonWeight / (garbageWeight + commonWeight + uncommonWeight + rareWeight + epicWeight + legendaryWeight + mythicWeight + godlyWeight + divineWeight + immortalWeight), 0), 1);
  181. const rareChance = Math.min(Math.max(rareWeight / (garbageWeight + commonWeight + uncommonWeight + rareWeight + epicWeight + legendaryWeight + mythicWeight + godlyWeight + divineWeight + immortalWeight), 0), 1);
  182. const epicChance = Math.min(Math.max(epicWeight / (garbageWeight + commonWeight + uncommonWeight + rareWeight + epicWeight + legendaryWeight + mythicWeight + godlyWeight + divineWeight + immortalWeight), 0), 1);
  183. const legendaryChance = Math.min(Math.max(legendaryWeight / (garbageWeight + commonWeight + uncommonWeight + rareWeight + epicWeight + legendaryWeight + mythicWeight + godlyWeight + divineWeight + immortalWeight), 0), 1);
  184. const mythicChance = Math.min(Math.max(mythicWeight / (garbageWeight + commonWeight + uncommonWeight + rareWeight + epicWeight + legendaryWeight + mythicWeight + godlyWeight + divineWeight + immortalWeight), 0), 1);
  185. const godlyChance = Math.min(Math.max(godlyWeight / (garbageWeight + commonWeight + uncommonWeight + rareWeight + epicWeight + legendaryWeight + mythicWeight + godlyWeight + divineWeight + immortalWeight), 0), 1);
  186. const divineChance = Math.min(Math.max(divineWeight / (garbageWeight + commonWeight + uncommonWeight + rareWeight + epicWeight + legendaryWeight + mythicWeight + godlyWeight + divineWeight + immortalWeight), 0), 1);
  187. const immortalChance = Math.min(Math.max(immortalWeight / (garbageWeight + commonWeight + uncommonWeight + rareWeight + epicWeight + legendaryWeight + mythicWeight + godlyWeight + divineWeight + immortalWeight), 0), 1);
  188.  
  189. document.getElementById('info').innerText = "";
  190. document.getElementById('tables').style.display = "block";
  191. document.getElementById('chance-garbage').innerText = formatChance(garbageChance);
  192. document.getElementById('chance-common').innerText = formatChance(commonChance);
  193. document.getElementById('chance-uncommon').innerText = formatChance(uncommonChance);
  194. document.getElementById('chance-rare').innerText = formatChance(rareChance);
  195. document.getElementById('chance-epic').innerText = formatChance(epicChance);
  196. document.getElementById('chance-legendary').innerText = formatChance(legendaryChance);
  197. document.getElementById('chance-mythic').innerText = formatChance(mythicChance);
  198. document.getElementById('chance-godly').innerText = formatChance(godlyChance);
  199. document.getElementById('chance-divine').innerText = formatChance(divineChance);
  200. document.getElementById('chance-immortal').innerText = formatChance(immortalChance);
  201. populateExtras(document.getElementById('extra-rarity'), luck, immortalChance);
  202. }
  203.  
  204. function calculateGarbage(luck) {
  205. var chance = 5 * Math.pow(0.8, luck - 1);
  206. if (luck > 2) chance *= Math.pow(0.4, luck - 2);
  207. if (luck > 3) chance = 0;
  208. return chance;
  209. }
  210.  
  211. function calculateCommon(luck) {
  212. var chance = 15;
  213. if (luck > 2) chance *= Math.pow(0.45, luck - 2);
  214. if (luck > 5) chance = 0;
  215. return chance;
  216. }
  217.  
  218. function calculateUncommon(luck) {
  219. var chance = 20 * Math.pow(1.5, luck - 1) - 12;
  220. if (luck > 3) chance *= Math.pow(0.5, luck - 3);
  221. if (luck > 8) chance = 0;
  222. return chance;
  223. }
  224.  
  225. function calculateRare(luck) {
  226. var chance = 30 * Math.pow(1.45, luck - 1) - 28;
  227. if (luck > 5) chance *= Math.pow(0.55, luck - 5);
  228. if (luck > 12) chance = 0;
  229. return chance;
  230. }
  231.  
  232. function calculateEpic(luck) {
  233. var chance = Math.max(0, 45 * Math.pow(1.4, luck - 2) - 50);
  234. if (luck > 8) chance *= Math.pow(0.6, luck - 8);
  235. if (luck > 20) chance = 0;
  236. return chance;
  237. }
  238.  
  239. function calculateLegendary(luck) {
  240. var chance = Math.max(0, 80 * Math.pow(1.36, luck - 3) - 100);
  241. if (luck > 12) chance *= Math.pow(0.64, luck - 12);
  242. if (luck > 30) chance = 0;
  243. return chance;
  244. }
  245.  
  246. function calculateMythic(luck) {
  247. var chance = Math.max(0, 120 * Math.pow(1.3, luck - 5) - 140);
  248. if (luck > 20) chance *= Math.pow(0.67, luck - 20);
  249. if (luck > 50) chance = 0;
  250. return chance;
  251. }
  252.  
  253. function calculateGodly(luck) {
  254. var chance = Math.max(0, 150 * Math.pow(1.25, luck - 8) - 200);
  255. if (luck > 30) chance *= Math.pow(0.7, luck - 30);
  256. if (luck > 50) chance = 0;
  257. return chance;
  258. }
  259.  
  260. function calculateDivine(luck) {
  261. var chance = Math.max(0, 200 * Math.pow(1.2, luck - 12) - 300);
  262. if (luck > 40) chance *= Math.pow(0.92, luck - 40);
  263. if (luck > 50) chance *= Math.pow(0.75, luck - 50);
  264. if (luck > 70) chance = 0;
  265. return chance;
  266. }
  267.  
  268. function calculateImmortal(luck) {
  269. return Math.max(0, 300 * Math.pow(1.1, luck - 20) - 500);
  270. }
  271.  
  272. function populateExtras(table, luck, immortalChance) {
  273. if (luck < 50) {
  274. table.style.display = "none";
  275. return;
  276. }
  277.  
  278. const maxRarity = (luck - 45) / 4.95;
  279. const randomChances = new Array(parseInt(Math.ceil(maxRarity)));
  280. for (let i = 0; i < randomChances.length; i++) {
  281. randomChances[i] = Math.min(Math.pow((i + 1) / maxRarity, 2), 1) - Math.pow(i / maxRarity, 2);
  282. }
  283.  
  284. var html = "";
  285. for (let j = 0; j < randomChances.length; j += 9) {
  286. let cells = 9;
  287. if (randomChances.length - j - 9 < 0) cells = randomChances.length % 9;
  288.  
  289. html += "<tr>";
  290. for (let i = 0; i < cells; i++) {
  291. if (j == 0 && i == 0)
  292. html += "<th class=\"header-immortal\">Immortal</th>"
  293. else
  294. html += "<th class=\"header-immortal\">Immortal+" + (i + j) + "</th>"
  295. }
  296. html += "</tr><tr>";
  297. for (let i = 0; i < cells; i++) {
  298. html += "<td>" + formatChance(immortalChance * randomChances[i + j]) + "</td>"
  299. }
  300. html += "</tr>";
  301. }
  302.  
  303. table.innerHTML = html;
  304. table.style.display = "table";
  305. }
  306. </script>
  307. </body>
  308. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement