Advertisement
daixso

Fighting Class

Aug 2nd, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1. /**
  2.  * This code controls fights, and boss fights
  3.  * @author zachary
  4.  *
  5.  **/
  6. import java.util.*;
  7. import java.awt.*;
  8. public class Fighting {
  9.     public void Fight(){
  10.         Scanner attack = new Scanner(System.in);
  11.         Random rand = new Random();
  12.         int max=10;
  13.         int min=1;
  14.         int bossChance = rand.nextInt(max - min + 1) + min;
  15.        
  16.         if(bossChance >= 7){
  17.             //a boss mob has appeared
  18.             int bossHp=200;//boss health
  19.             int bossGold=rand.nextInt(100-50+1)+50;//boss money drop
  20.             int bossExp=75;
  21.             System.out.println("A boss appears! Prepare to fight!");
  22.             while(bossHp >= 0){
  23.                 //boss is alive
  24.                 System.out.printf("Boss HP: %d!\n", bossHp);
  25.                 System.out.println("Choose attack!\n 1. Fireball (50%)\n2. Melee");
  26.                 System.out.print("Attack: ");
  27.                 attack.nextLine();
  28.                 if(attack.equals("1")){
  29.                     int critChance =
  30.                 }
  31.                
  32.             }else{
  33.                 //boss is dead
  34.             }
  35.         }else{
  36.             //a normal mob has appeared
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement