Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int playerCountFix(int playerCount) {
- Random r = new Random();
- int ran = r.nextInt(1); // Random 0 or 1
- int returnCount = playerCount; // Player count
- if(playerCount < 10) // Do nothing if the player count is below 10
- return returnCount;
- returnCount += (playerCount * 20 / 100); // Add 20% to the player count if its above 10
- if(playerCount > 20)
- returnCount += (playerCount * 15 / 100); // Add an additional 15% to the player count if its above 20
- if(playerCount > 30)
- returnCount += (playerCount * 10 / 100); // Add an additional 10% to the player count if its above 30
- return returnCount + ran; // Return the "fixed" player count plus the random 0 or 1 so it isn't always even or odd
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement