Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class hearthstone2 {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int rank = 25;
- int stars = 0;
- int starcap = 2;
- int winstreak = 0;
- String win = "win";
- int legendrank = (int)Math.round(Math.random()*30+500);
- System.out.println("Hearthstone Ranked Games. Enter win or lose");
- while (rank >= 0){
- win = sc.next();
- if (rank > 0) {
- if (win.equalsIgnoreCase("win")) {
- stars++;
- winstreak++;
- if (rank > 20)
- starcap = 2;
- else if (rank > 15)
- starcap = 3;
- else if (rank > 10)
- starcap = 4;
- else if (rank > 5)
- starcap = 5;
- else {
- starcap = 5;
- winstreak = 0;
- }
- if (winstreak >= 3) {
- stars++;
- }
- if (stars == starcap + 1) {
- rank--;
- stars = 1;
- }
- if (stars == starcap + 2) {
- rank--;
- stars = 2;
- }
- if (rank > 20)
- starcap = 2;
- else if (rank > 15)
- starcap = 3;
- else if (rank > 10)
- starcap = 4;
- else if (rank > 5)
- starcap = 5;
- else {
- starcap = 5;
- winstreak = 0;
- }
- }
- if (win.equalsIgnoreCase("lose")) {
- if (rank > 20) {
- System.out.println("\nYou cannot lose stars at this rank");
- winstreak = 0;
- } else if (rank == 20 && stars == 0) {
- System.out.println("\nYou cannot lose stars at this rank");
- winstreak = 0;
- } else {
- stars--;
- winstreak = 0;
- if (stars < 0) {
- rank++;
- if (rank > 20) {
- stars = 1;
- starcap = 2;
- } else if (rank > 15) {
- stars = 2;
- starcap = 3;
- } else if (rank > 10) {
- stars = 3;
- starcap = 4;
- } else {
- stars = 4;
- starcap = 5;
- }
- }
- }
- }
- if (winstreak >= 3)
- System.out.println("\nWinstreak");
- if (rank > 0) {
- System.out.println("\nRank: " + rank);
- System.out.println(stars + " stars out of " + starcap + " stars");
- }
- if (rank == 25)
- System.out.println("Angry Chicken\n");
- if (rank == 24)
- System.out.println("Leper Gnome\n");
- if (rank == 23)
- System.out.println("Argent Squire\n");
- if (rank == 22)
- System.out.println("Murloc Raider\n");
- if (rank == 21)
- System.out.println("Southsea Deckhand\n");
- if (rank == 20)
- System.out.println("Shieldbearer\n");
- if (rank == 19)
- System.out.println("Novice Engineer\n");
- if (rank == 18)
- System.out.println("Sorcerer's Apprentice\n");
- if (rank == 17)
- System.out.println("Tauren Warrior\n");
- if (rank == 16)
- System.out.println("Questing Adventurer\n");
- if (rank == 15)
- System.out.println("Silvermoon Guardian\n");
- if (rank == 14)
- System.out.println("Raid Leader\n");
- if (rank == 13)
- System.out.println("Dread Corsair\n");
- if (rank == 12)
- System.out.println("Warsong Commander\n");
- if (rank == 11)
- System.out.println("Big Game Hunter\n");
- if (rank == 10)
- System.out.println("Ogre Magi\n");
- if (rank == 9)
- System.out.println("Silver Hand Knight\n");
- if (rank == 8)
- System.out.println("Frostwolf Warlord\n");
- if (rank == 7)
- System.out.println("Sunwalker\n");
- if (rank == 6)
- System.out.println("Ancient of War\n");
- if (rank == 5)
- System.out.println("Sea Giant\nWinstreaks are now disabled\n");
- if (rank == 4)
- System.out.println("Mountain Giant\n");
- if (rank == 3)
- System.out.println("Molten Giant\n");
- if (rank == 2)
- System.out.println("The Black Knight\n");
- if (rank == 1)
- System.out.println("The Innkeeper\n");
- }
- if (rank == 0) {
- if (win.equalsIgnoreCase("win")) {
- if (legendrank >= 100)
- legendrank -= (int) Math.round(Math.random() * 80 + 1);
- else if (legendrank >= 50)
- legendrank -= (int) Math.round(Math.random() * 30 + 1);
- else if (legendrank > 20)
- legendrank -= (int) Math.round(Math.random() * 10 + 1);
- else if (legendrank <= 20)
- legendrank -= (int) Math.round(Math.random() + 1);
- else if (legendrank == 2)
- legendrank --;
- }
- if (win.equalsIgnoreCase("lose")) {
- if (legendrank >= 100)
- legendrank += (int) Math.round(Math.random() * 80 + 1);
- else if (legendrank >= 50)
- legendrank += (int) Math.round(Math.random() * 30 + 1);
- else if (legendrank > 20)
- legendrank += (int) Math.round(Math.random() * 10 + 1);
- else if (legendrank <= 20)
- legendrank += (int) Math.round(Math.random() + 1);
- }
- if (legendrank == 1)
- break;
- System.out.println();
- System.out.println(legendrank);
- System.out.println("Legend\n");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement