zopiac

RandomWeapon

Feb 4th, 2011
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.19 KB | None | 0 0
  1. package butka;
  2. import java.util.Random;
  3.  
  4. public class RandomWeapon {
  5.     static Random randInt = new Random();
  6.     //Type, Size, Material, Bless/Curse, Quality
  7.     static int[] weapon = {0, 0, 0, 0, 0};
  8.     //Name, Quality mod, Enchant mod, Material mod, atk1, atk2, atk3
  9.     static Object[] stats = {"", 0, 0, 0, 0, 0, 0};
  10.     static String[] name = {"", "", "", ""};
  11.     static int[] newWeapon(){
  12.         weapon[0] = randInt.nextInt(3);
  13.         weapon[1] = randInt.nextInt(10);
  14.         weapon[2] = randInt.nextInt(10);
  15.         weapon[3] = randInt.nextInt(10);
  16.         weapon[4] = randInt.nextInt(10);
  17.         return weapon; 
  18.     }
  19.     static Object[] nameWeapon() {
  20.         switch (weapon[0]){
  21.         case 0:
  22.         case 1:
  23.             switch (weapon[4]){
  24.             case 0:name[0]="Crude ";stats[1]=.8;break;
  25.             case 1:
  26.             case 2:
  27.             case 3:
  28.             case 4:
  29.             case 5:
  30.             case 6:
  31.             case 7:name[0]="";stats[1]=1;break;
  32.             case 8:
  33.             case 9:name[0]="Fine ";stats[1]=1.1;break;
  34.             }
  35.             break;
  36.         case 2:
  37.         }
  38.         switch(weapon[3]) {
  39.         case 0:stats[0]="Crude ";stats[4]=.8;break;
  40.         case 1:
  41.         case 2:
  42.         case 3:
  43.         case 4:
  44.         case 5:
  45.         case 6:
  46.         case 7:stats[0]="";stats[4]=1;break;
  47.         case 8:
  48.         case 9:stats[0]="Blessed ";stats[4]=1.2;break;
  49.         }
  50.         return stats;
  51.  
  52.     }
  53.  
  54.  
  55. }
Add Comment
Please, Sign In to add comment