From 51b5deb30032e6ac8dab3039769a4de1eaf84cf5 Mon Sep 17 00:00:00 2001 From: Magesofthebeach <53281653+Magesofthebeach@users.noreply.github.com> Date: Sat, 29 Feb 2020 19:31:03 -0500 Subject: [PATCH] Changed how OP1 determines rarity This should fix the Castle Pillar bug actually but for real this time --- src/components/entercode/PackSimulator.js | 25 +++++++++-------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/components/entercode/PackSimulator.js b/src/components/entercode/PackSimulator.js index fafa887..50bf5fd 100644 --- a/src/components/entercode/PackSimulator.js +++ b/src/components/entercode/PackSimulator.js @@ -90,6 +90,14 @@ export default class PackSimulator extends React.Component { else if (randomNumber % 3 == 0) return "Super Rare"; else return "Rare"; }; + + const randomWeird = () => { + let randomNumber = Math.floor(Math.random() * 75) + 1; + if (randomNumber == 75) return "Ultra Rare"; + else if (randomNumber < 19) return "Super Rare"; + else if (randomNumber < 44) return "Rare"; + else return "Uncommon"; + }; const gendisp = (avg) => { let min = parseInt(avg) - 10; @@ -168,21 +176,8 @@ export default class PackSimulator extends React.Component { } else if (this.set === "OP1") { genrarity("Common", 2); - let randomWeird = Math.floor(Math.random() * 75) + 1; - let weirdRarity = ""; - if (randomWeird == 75) { - weirdRarity = "Ultra Rare"; - } - else if (randomWeird < 19) { - weirdRarity = "Super Rare"; - } - else if (randomWeird < 44) { - weirdRarity = "Rare"; - } - else { - weirdRarity = "Uncommon"; - } - genrarity(weirdRarity, 1); + + genrarity(randomWeird(), 1); } else if (this.set === "PE1") { genrarity("Super Rare", 5);