Example #1
0
  private void spawnRandomers() {
    for (int i = 0; i < randomN; i++) {
      float x = (float) Math.random() * width;
      float y = (float) Math.random() * height;
      float r =
          (float)
              Math.sqrt(
                  Math.pow(((Player) players.get(0)).getX() - x, 2)
                      + Math.pow(((Player) players.get(0)).getY() - x, 2));

      while (r < distanceLimit) {
        x = (float) Math.random() * width;
        y = (float) Math.random() * height;
        r =
            (float)
                Math.sqrt(
                    Math.pow(((Player) players.get(0)).getX() - x, 2)
                        + Math.pow(((Player) players.get(0)).getY() - y, 2));
      }

      enemies.add(new EnemyTypes.Random(x, y, 0.5f, borders));
    }

    spawnRandomersB = false;
  }
  /**
   * Spawn a character on the map
   *
   * @param MiX Minimum X value
   * @param MiY Minimum Y value
   * @param MaX Maximum X value
   * @param MaY Maximum Y value
   */
  public void Spawn(int MiX, int MiY, int MaX, int MaY) {
    double Nx = 0, Ny = 0;

    // Random coordinate
    Nx = Math.random() * MaX + MiX;
    Ny = Math.random() * MaY + MiY;

    // Store block number
    int BNum = MAP.elementAt(0).getBlockNum(Nx + W / 2, Ny + H / 2);

    // if invalid block number
    if (BNum == -1) {
      Spawn(MiX, MiY, MaX, MaY);
    }

    // if invalid surface
    else if (!isValidSurface(MAP.elementAt(0).Fill[BNum])) {
      Spawn(MiX, MiY, MaX, MaY);
    }

    // if colliding with something
    else if (this.Collision(Nx + W / 2, Ny + H / 2)) {
      Spawn(MiX, MiY, MaX, MaY);
    } else {
      X = Nx;
      Y = Ny;
    }
  }
Example #3
0
 private void spawnBomb() {
   float x, y;
   for (int i = 0; i < bombN; i++) {
     if (Math.random() > .5) { // top/bottom
       y = (Math.random() > .5) ? borders[1] : borders[3];
       x = (float) Math.random() * borders[2] - borders[0]; // width
     } else {
       x = (Math.random() > .5) ? borders[0] : borders[2];
       y = (float) Math.random() * borders[3] - borders[1]; // height
     }
     enemies.add(new EnemyTypes.Bomb(x, y, 1f, borders, scbInstance));
   }
 }
Example #4
0
  private void levelSetup() {
    reset();

    switch (level) {
      case 1:
        distance = 600;
        monsterN = 0;
        randomN = 0;
        rainN = 30;
        defaultDistance = 600;
        timeLast = 10000;
        spawnCircleB = true;
        break;
      case 2:
        distance = 600;
        monsterN = 0;
        randomN = 30;
        rainN = 30;
        defaultDistance = 600;
        timeLast += 10000;
        spawnCircleB = true;
        break;
      case 3:
        distance = 600;
        monsterN = 30;
        randomN = 0;
        rainN = 0;
        defaultDistance = 600;
        timeLast += 10000;
        spawnCircleB = true;
        break;
      default:
        distance = (float) (Math.random() * 200 + 400 - level * 5);
        monsterN = (int) (Math.random() * 25 + 10 + level);
        randomN = (int) (Math.random() * 25 + 10 + level);
        rainN = (int) (Math.random() * 10 + 10 + level);
        defaultDistance = distance;
        timeLast += 5000 + level * 1000;
        spawnCircleB = true;
    }

    monsterN *= monsterMultiplier;
    randomN *= monsterMultiplier;
    spawnMonsterB = true;
    spawnRandomersB = true;
    spawnIncrease = true;
    spawnRainB = true;
  }
Example #5
0
  private void spawnCircles() {
    if (circular) {
      for (int i = 0; i < ballN; i++) {
        double degree = Math.random() * 2 * Math.PI;
        float x = ((Player) players.get(0)).getX() + distance * (float) Math.sin(degree * i);
        float y = ((Player) players.get(0)).getY() + distance * (float) Math.cos(degree * i);
        enemies.add(new EnemyTypes.Circle(x, y, invSpeed));
      }
    } else {
      for (int i = 1; i < (ballN / 2); i++) {
        float x = (i * 2 * width) / (ballN);
        float y = 0;
        enemies.add(new EnemyTypes.Circle(x, y, invSpeed));
      }

      for (int i = (ballN / 2) + 1; i < ballN; i++) {
        float x = ((i - ballN / 2) * 2 * width) / ballN;
        float y = height;
        enemies.add(new EnemyTypes.Circle(x, y, invSpeed));
      }
    }
    spawnIncrease = false;
  }
Example #6
0
  public void initialize() {
    buffer = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    // #if (Black_P1)
    // @        	player_1 = new Entity(100,100, "imgs/Tank_Black.gif", "SP1");
    // #elif (Red_P1)
    // @        	player_1 = new Entity(100,100, "imgs/Tank_Red.gif", "SP1");
    // #elif (Red_Tier1_P1)
    // @        	player_1 = new Entity(100,100, "imgs/Tier1rot.gif", "SP1");
    // #elif (Yellow_Tier1_P1)
    player_1 = new Entity(100, 100, "imgs/Tier1gelb.gif", "SP1");
    // #elif (Blue_Tier2_P1)
    // @        	player_1 = new Entity(100,100, "imgs/Tier2blau.gif", "SP1");
    // #elif (Green_Tier2_P1)
    // @        	player_1 = new Entity(100,100, "imgs/Tier2gruen.gif", "SP1");
    // #endif

    // #if (Black_P2)
    // @        	player_2 = new Entity(200,100, "imgs/Tank_Black.gif", "SP2");
    // #elif (Red_P2)
    // @        	player_2 = new Entity(200,100, "imgs/Tank_Red.gif", "SP2");
    // #elif (Red_Tier1_P2)
    // @        	player_2 = new Entity(200,100, "imgs/Tier1rot.gif", "SP2");
    // #elif (Yellow_Tier1_P2)
    // @        	player_2 = new Entity(200,100, "imgs/Tier1gelb.gif", "SP2");
    // #elif (Blue_Tier2_P2)
    // @        	player_2 = new Entity(200,100, "imgs/Tier2blau.gif", "SP2");
    // #elif (Green_Tier2_P2)
    player_2 = new Entity(200, 100, "imgs/Tier2gruen.gif", "SP2");
    // #endif

    current_Player = player_1;
    other_Player = player_2;
    env = new Environment[amountEnv];
    powerUps = new PowerUp[9];

    for (int i = 0; i <= amountEnv - 1; i++) {
      // #if (Hinderniss_Set)
      // @                if (Math.random()>0.95) env[i] = new
      // Environment("imgs/HindernisseBearbeitet/_b.GIF");
      // @                else if (Math.random()>0.90)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/MauerDunkelrot_b.gif");
      // @                else if (Math.random()>0.85)env[i] = new
      // Environment("imgs/mauer_hoch.gif");
      // @                else if (Math.random()>0.80)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/BaumStamm.gif");
      // @                else if (Math.random()>0.75)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/BaumKlein.gif");
      // @                else if (Math.random()>0.70)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/BaumKlein_b.GIF");
      // @                else if (Math.random()>0.65)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/BaumStamm.gif");
      // @                else if (Math.random()>0.60)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/BaumStamm_b.GIF");
      // @                else if (Math.random()>0.55)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/MauerDunkelrot_b.gif");
      // @                else if (Math.random()>0.50)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/MauerDunkelrot.gif");
      // @                else if (Math.random()>0.45)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/MauerDunkelrot_b.GIF");
      // @                else if (Math.random()>0.40)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/MauerGrauKurz.gif");
      // @                else if (Math.random()>0.35)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/MauerGrauKurz_b.GIF");
      // @                else if (Math.random()>0.30)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/MauerGrauKurzDick.gif");
      // @                else if (Math.random()>0.25)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/MauerGrauKurzDick_b.GIF");
      // @                else if (Math.random()>0.20)env[i] = new
      // Environment("imgs/Haus_vonOben.gif");
      // @                else if (Math.random()>0.15)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/MauerGrauLangDick.gif");
      // @                else if (Math.random()>0.10)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/MauerGrauLangDick_b.GIF");
      // @                else if (Math.random()>0.05)env[i] = new
      // Environment("imgs/HindernisseBearbeitet/MauerRot.gif");
      // @                else env[i] = new Environment("imgs/Haus_vonOben_b.GIF");
      // @            //}
      // #else
      if (Math.random() > 0.75)
        env[i] = new Environment("imgs/HindernisseBearbeitet/Pfuetze1.gif.gif");
      else if (Math.random() > 0.50)
        env[i] = new Environment("imgs/HindernisseBearbeitet/PfuetzeGross.gif");
      else if (Math.random() > 0.25)
        env[i] = new Environment("imgs/HindernisseBearbeitet/PfuetzeKlein.gif");
      else env[i] = new Environment("imgs/HindernisseBearbeitet/PfuetzeMittel.gif");
      // #endif

      env[i].setX((int) (150 + Math.random() * (w - 200)));
      env[i].setY((int) (50 + Math.random() * (h - 200)));
    }
    int i = 0;
    while (true) {
      // #if (Flower)
      if (i == 9) break;
      powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpBlume.gif");
      i++;
      // #endif
      // #if (Blue_Flower)
      if (i == 9) break;
      powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpBlumeBlau.gif");
      i++;
      // #endif
      // #if (Copy)
      if (i == 9) break;
      powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpCopy.gif");
      i++;
      // #endif
      // #if (Fire)
      // @        	if (i == 9) break;
      // @    	powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpFeuer.gif");
      // @        i++;
      // #endif
      // #if (Light_Bulb_Round)
      if (i == 9) break;
      powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpGluehbirneRund.gif");
      i++;
      // #endif
      // #if (Green)
      // @        	if (i == 9) break;
      // @    	powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpGruen.gif");
      // @        i++;
      // #endif
      // #if (Heart)
      // @        	if (i == 9) break;
      // @    	powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpHerz.gif");
      // @        i++;
      // #endif
      // #if (Circle)
      // @        	if (i == 9) break;
      // @    	powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpKreis.gif");
      // @        i++;
      // #endif
      // #if (Cow)
      // @        	if (i == 9) break;
      // @    	powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpKuh.gif");
      // @        i++;
      // #endif
      // #if (Light_Bulb)
      if (i == 9) break;
      powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpLightbulb.gif");
      i++;
      // #endif
      // #if (Octagonal)
      // @        	if (i == 9) break;
      // @    	powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpOctagonal.gif");
      // @        i++;
      // #endif
      // #if (Mushroom)
      if (i == 9) break;
      powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpPilz.gif");
      i++;
      // #endif
      // #if (Pumpkin_Pie)
      // @	       if (i == 9) break;
      // @	    	powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpPumpkinPie.gif");
      // @	        i++;
      // #endif
      // #if (Ring)
      if (i == 9) break;
      powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpRing.gif");
      i++;
      // #endif
      // #if (Ring_2)
      if (i == 9) break;
      powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpRingeZwei.gif");
      i++;
      // #endif
      // #if (Ring_Oval)
      if (i == 9) break;
      powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpRingOval.gif");
      i++;
      // #endif
      // #if (Ring_Oval_Small)
      if (i == 9) break;
      powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpRingOvalKlein.gif");
      i++;
      // #endif
      // #if (Sponge)
      // @    	if (i == 9) break;
      // @    	powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpSchwamm.gif");
      // @    	i++;
      // #endif
      // #if (Spiral)
      // @    	if (i == 9) break;
      // @    	powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpSpiral.gif");
      // @    	i++;
      // #endif
      // #if (Star_Oval)
      if (i == 9) break;
      powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpSternOval.gif");
      i++;
      // #endif
      // #if (Star_Oval_Small)
      if (i == 9) break;
      powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpSternOvalKlein.gif");
      i++;
      // #endif
      // #if (Star_Ring)
      if (i == 9) break;
      powerUps[i] = new PowerUp(i, "imgs/PowerUpsBearbeitet/PowerUpSternRing.gif");
      i++;
      // #endif
    }
    // #if (Nr1)
    powerUps[0].setX(50 + (int) (Math.random() * (w - 100)));
    powerUps[0].setY(50 + (int) (Math.random() * (h - 150)));
    // #else
    // @            powerUps[0].setX(-100);
    // @            powerUps[0].setY(-100);
    // #endif

    // #if (Nr2)
    powerUps[1].setX(50 + (int) (Math.random() * (w - 100)));
    powerUps[1].setY(50 + (int) (Math.random() * (h - 150)));
    // #else
    // @            powerUps[1].setX(-100);
    // @            powerUps[1].setY(-100);
    // #endif

    // #if (Nr3)
    powerUps[2].setX(50 + (int) (Math.random() * (w - 100)));
    powerUps[2].setY(50 + (int) (Math.random() * (h - 150)));
    // #else
    // @            powerUps[2].setX(-100);
    // @            powerUps[2].setY(-100);
    // #endif

    // #if (Nr4)
    powerUps[3].setX(50 + (int) (Math.random() * (w - 100)));
    powerUps[3].setY(50 + (int) (Math.random() * (h - 150)));
    // #else
    // @            powerUps[3].setX(-100);
    // @            powerUps[3].setY(-100);
    // #endif

    // #if (Nr5)
    powerUps[4].setX(50 + (int) (Math.random() * (w - 100)));
    powerUps[4].setY(50 + (int) (Math.random() * (h - 150)));
    // #else
    // @            powerUps[4].setX(-100);
    // @            powerUps[4].setY(-100);
    // #endif

    // #if (Nr6)
    powerUps[5].setX(50 + (int) (Math.random() * (w - 100)));
    powerUps[5].setY(50 + (int) (Math.random() * (h - 150)));
    // #else
    // @            powerUps[5].setX(-100);
    // @            powerUps[5].setY(-100);
    // #endif

    // #if (Nr7)
    powerUps[6].setX(50 + (int) (Math.random() * (w - 100)));
    powerUps[6].setY(50 + (int) (Math.random() * (h - 150)));
    // #else
    // @            powerUps[6].setX(-100);
    // @            powerUps[6].setY(-100);
    // #endif

    // #if (Nr8)
    powerUps[7].setX(50 + (int) (Math.random() * (w - 100)));
    powerUps[7].setY(50 + (int) (Math.random() * (h - 150)));
    // #else
    // @            powerUps[7].setX(-100);
    // @            powerUps[7].setY(-100);
    // #endif

  }
  /**
   * Constructor to create a character
   *
   * @param x X Position
   * @param y Y Position
   * @param w Width of Image
   * @param h Height of Image
   * @param FileN Name of image file
   * @param S Max number of frames
   */
  public GameCharacter(
      double x, double y, double w, double h, String FileN, int S, int Ty, String c) {
    // Set position and size
    X = x;
    Y = y;
    W = w;
    H = h;

    BASIC_PROCESS = new ProgressBar(new Font("Arial", 36, 36), this);
    BASIC_EFFECTS = new ProgressBar(new Font("Arial", 36, 36), this);
    // Add magic attacks
    // Fireball
    for (int i = 0; i < FIREBALL.length; i++) {
      FIREBALL[i] = new MagicAttack(-500, -500, 39, 41, "Fireball.png", 3, 1, 2, "Fireball");
      FIREBALL[i].STATS.setStats(new String[] {"Damage=10", "Points=10"});
      FIREBALL[i].CASTER = this;
    }
    // Shock
    for (int i = 0; i < SHOCK.length; i++) {
      SHOCK[i] = new MagicAttack(-500, -500, 39, 41, "Shock.png", 2, 1, 0, "Shock");
      SHOCK[i].STATS.setStats(new String[] {"Damage=20", "Points=15"});
      SHOCK[i].CASTER = this;
    }
    // Darkness
    for (int i = 0; i < DARKNESS.length; i++) {
      DARKNESS[i] = new MagicAttack(-500, -500, 165, 164, "Darkness.png", 3, 1, 2, "Darkness");
      DARKNESS[i].STATS.setStats(new String[] {"Damage=100", "Points=50"});
      DARKNESS[i].CASTER = this;
    }
    // Life Drain
    for (int i = 0; i < LIFE_DRAIN.length; i++) {
      LIFE_DRAIN[i] = new MagicAttack(-500, -500, 32, 32, "Life Drain.png", 7, 1, 0, "Life Drain");
      LIFE_DRAIN[i].STATS.setStats(new String[] {"Damage=50", "Points=25"});
      LIFE_DRAIN[i].CASTER = this;
    }
    // Get Image
    try {

      if (isJar()) {
        // Character
        imgCHARAC = getImage("/Graphics/Character/", FileN);

        // Blood
        int BloodType = (int) Math.round(Math.random() * 3) + 1;
        imgBLOOD = getImage("/Graphics/Effects/", "Dead" + BloodType + ".png");

        // Quest
        imgQStart = getImage("/Graphics/Effects/", "Quest_Start.png");
        imgQEnd = getImage("/Graphics/Effects/", "Quest_Complete.png");

      } else {
        // Character
        imgCHARAC = ImageIO.read(Paths.get(DIRECT + FileN).toFile());

        // Blood
        int BloodType = (int) Math.round(Math.random() * 3) + 1;
        imgBLOOD = ImageIO.read(Paths.get(DIRECT2 + "Dead" + BloodType + ".png").toFile());

        // Quest
        imgQStart = ImageIO.read(Paths.get(DIRECT2 + "Quest_Start.png").toFile());
        imgQEnd = ImageIO.read(Paths.get(DIRECT2 + "Quest_Complete.png").toFile());
      }

    } catch (Exception e) {
    }

    // Max number of frames
    SIZE = S;

    // Sprite type
    TYPE = Ty;

    // Assign class
    CLASS = c;
    Cl = c;

    // Add items and attacks according to class
    if (CLASS.equals("Player")) {

      // Add items
      INVENTORY.addItem(
          "Health Potion", 25, 1, "Health Pot.png", "Potion", new String[] {"Points=50"});
      INVENTORY.addItem(
          "Rusted Dagger",
          20,
          1,
          "Dagger_4.png",
          "Meele",
          new String[] {"Damage=10", "Attack Speed=1"});
      INVENTORY.addItem(
          "Wooden Staff",
          20,
          1,
          "Staff_1.png",
          "Meele",
          new String[] {"Damage=5", "Attack Speed=1"});

      // Equip items
      INVENTORY.ItemEffect(1, this);
      // MEELE_WEAPON=null;
      // Assign Magic
      SPELL_LIST.add(FIREBALL);

      // Inventory type
      INVENTORY.Type = "Player";
    } else if (CLASS.equals("Citizen")) {

      // Add items
      INVENTORY.addItem(
          "Health Potion", 25, 1, "Health Pot.png", "Potion", new String[] {"Points=50"});

      // Add Ai
      NAI = new NPCAI(this);

      // Add Gold
      this.GOLD = (int) Math.round(Math.random() * 15 + 5);

      INVENTORY.Type = "Friendly";
    } else if (CLASS.equals("Blacksmith")) {

      // Add items
      INVENTORY.addItem(
          "Silver Dagger",
          250,
          1,
          "Dagger_3.png",
          "Meele",
          new String[] {"Damage=10", "Attack Speed=1"});
      INVENTORY.addItem(
          "Steel Dagger",
          450,
          1,
          "Dagger_5.png",
          "Meele",
          new String[] {"Damage=35", "Attack Speed=1"});
      // INVENTORY.addItem("Assassin blade", 750,1, "Dagger_6.png","Meele",new
      // String[]{"Damage=45","Attack Speed=1"});
      // INVENTORY.addItem("Serpent Dagger", 5000,1, "Dagger_2.png","Meele",new
      // String[]{"Damage=50","Attack Speed=1"});
      // INVENTORY.addItem("Dagger of Time", 5050,1, "Dagger_1.png","Meele",new
      // String[]{"Damage=75","Attack Speed=1"});

      INVENTORY.addItem(
          "Steel Sword",
          450,
          1,
          "Sword_1.png",
          "Meele",
          new String[] {"Damage=30", "Attack Speed=0.65"});
      INVENTORY.addItem(
          "Iron Sword",
          50,
          1,
          "Sword_2.png",
          "Meele",
          new String[] {"Damage=15", "Attack Speed=0.65"});
      INVENTORY.addItem(
          "Silver Sword",
          100,
          1,
          "Sword_5.png",
          "Meele",
          new String[] {"Damage=20", "Attack Speed=0.5"});
      // INVENTORY.addItem("Iron Scimitar", 150,1, "Sword_7.png","Meele",new
      // String[]{"Damage=15","Attack Speed=0.75"});
      // INVENTORY.addItem("Steel Scimitar", 500,1, "Sword_4.png","Meele",new
      // String[]{"Damage=50","Attack Speed=0.75"});
      // INVENTORY.addItem("Steel Katana", 450,1, "Sword_6.png","Meele",new
      // String[]{"Damage=40","Attack Speed=0.95"});
      // INVENTORY.addItem("Butcher's Sword", 5000,1, "Sword_3.png","Meele",new
      // String[]{"Damage=100","Attack Speed=0.55"});
      // INVENTORY.addItem("Blood Thirster", 6000,1, "Sword_8.png","Meele",new
      // String[]{"Damage=200","Attack Speed=0.75"});

      INVENTORY.addItem(
          "Iron Hammer",
          150,
          1,
          "Hammer_1.png",
          "Meele",
          new String[] {"Damage=40", "Attack Speed=0.15"});
      // INVENTORY.addItem("Steel Hammer", 450,1, "Hammer_0.png","Meele",new
      // String[]{"Damage=60","Attack Speed=0.15"});
      // INVENTORY.addItem("Iron Mace", 50,1, "Mace_1.png","Meele",new String[]{"Damage=15","Attack
      // Speed=0.5"});

      INVENTORY.addItem("Steel Helmet", 250, 1, "Head_1.png", "H_armor", new String[] {"Armor=20"});
      INVENTORY.addItem("Iron Helmet", 150, 1, "Head_2.png", "H_armor", new String[] {"Armor=5"});
      // INVENTORY.addItem("Iron Horn Helmet", 350,1, "Head_6.png","H_armor",new
      // String[]{"Armor=50","Magic Resist=0"});
      // INVENTORY.addItem("Steel Horn Helmet", 500,1, "Head_7.png","H_armor",new
      // String[]{"Armor=80","Magic Resist=0"});
      // INVENTORY.addItem("Skysteel Helmet", 4000,1, "Head_4.png","H_armor",new
      // String[]{"Armor=60","Magic Resist=25"});

      INVENTORY.addItem(
          "Iron Cuirass", 250, 1, "Chest_4.png", "C_armor", new String[] {"Armor=20"});
      INVENTORY.addItem(
          "Steel Cuirass", 350, 1, "Chest_1.png", "C_armor", new String[] {"Armor=30"});
      // INVENTORY.addItem("Scale Cuirass", 550,1, "Chest_3.png","C_armor",new
      // String[]{"Armor=50"});
      // INVENTORY.addItem("Dark metal Cuirass", 750,1, "Chest_6.png","C_armor",new
      // String[]{"Armor=70"});
      // INVENTORY.addItem("Master Cuirass", 3050,1, "Chest_5.png","C_armor",new
      // String[]{"Armor=80","Magic Resist=25"});
      // INVENTORY.addItem("Legendary Cuirass", 3050,1, "Chest_2.png","C_armor",new
      // String[]{"Armor=100","Magic Resist=100"});

      INVENTORY.addItem(
          "Wooden Shield",
          50,
          1,
          "Shield_1.png",
          "Shield",
          new String[] {"Armor=5", "Magic Resist=0"});

      // Add AI
      NAI = new NPCAI(this);

      // Identify as trader
      INVENTORY.Type = "Trader";

      // Set Stats
      STATS.setStats(new String[] {"Level = 5 "});
      MAX_HEALTH = 200;
      HEALTH = (int) MAX_HEALTH;
    } else if (CLASS.equals("Alchemist")) {
      // Add Items
      INVENTORY.addItem(
          "Health Potion", 25, 50, "Health Pot.png", "Potion", new String[] {"Points=50"});
      INVENTORY.addItem(
          "Mana Potion", 20, 50, "Mana Pot.png", "Potion", new String[] {"Points=50"});
      INVENTORY.addItem(
          "Speed Potion", 10, 50, "Speed Pot.png", "Potion", new String[] {"Points=5"});
      // INVENTORY.addItem("Invisib Potion", 50, 10, "Invisibility Pot.png","Potion",new
      // String[]{"Points=5"});

      // Add AI
      NAI = new NPCAI(this);

      // Identify as trader
      INVENTORY.Type = "Trader";
    } else if (CLASS.equals("Inn Keeper")) {
      // Add Items
      INVENTORY.addItem("Roasted Fish", 15, 10, "Fish.png", "Food", new String[] {"Points=5"});
      INVENTORY.addItem("Apple", 15, 10, "Apple.png", "Food", new String[] {"Points=2"});

      // Add AI
      NAI = new NPCAI(this);

      // Identify as trader
      INVENTORY.Type = "Trader";
    } else if (CLASS.equals("Mage")) {

      INVENTORY.addItem(
          "Leather Cap",
          250,
          1,
          "Head_8.png",
          "H_armor",
          new String[] {"Armor=5", "Magic Resist=25"});
      INVENTORY.addItem(
          "Dark Leather Cap",
          300,
          1,
          "Head_9.png",
          "H_armor",
          new String[] {"Armor=5", "Magic Resist=50"});
      // INVENTORY.addItem("Jesters Cap", 500,1, "Head_5.png","H_armor",new
      // String[]{"Armor=10","Magic Resist=90"});
      // INVENTORY.addItem("Skull Helmet", 5000,1, "Head_3.png","H_armor",new
      // String[]{"Armor=100","Magic Resist=100"});
      INVENTORY.addItem(
          "Shock Spell Stone",
          250,
          1,
          "Stone_1.png",
          "SpellStoner",
          new String[] {"Damage=" + SHOCK[0].STATS.DAMAGE});
      // INVENTORY.addItem("Darkness Spell Stone", 500,1, "Stone_1.png","SpellStoner",new
      // String[]{"Damage="+DARKNESS[0].STATS.DAMAGE});
      INVENTORY.addItem(
          "Life Drain Spell Stone",
          300,
          1,
          "Stone_1.png",
          "SpellStoner",
          new String[] {"Damage=" + LIFE_DRAIN[0].STATS.DAMAGE});

      // Add AI
      NAI = new NPCAI(this);

      // Identify as trader
      INVENTORY.Type = "Trader";

    } else if (CLASS.equals("Skeleton")) {

      // Add items
      INVENTORY.addItem(
          "Bone Club", 5, 1, "Mace_2.png", "Meele", new String[] {"Damage=5", "Attack Speed=1"});

      // Add Gold
      this.GOLD = (int) Math.round(Math.random() * 10 + 2);

      // Use Item
      INVENTORY.ItemEffect(0, this);

      // Add AI
      EAI = new EnemyAI(this);
    } else if (CLASS.equals("Skeleton Chieftan")) {

      // Add Item
      INVENTORY.addItem(
          "Iron Sword",
          50,
          1,
          "Sword_2.png",
          "Meele",
          new String[] {"Damage=15", "Attack Speed=0.65"});
      INVENTORY.addItem(
          "Health Potion", 25, 1, "Health Pot.png", "Potion", new String[] {"Points=50"});

      // Add Gold
      this.GOLD = (int) Math.round(Math.random() * 50 + 25);

      // Use Item
      INVENTORY.ItemEffect(0, this);

      // Assign Stats
      STATS.LEVEL = 3;
      HEALTH = 250;
      MAX_HEALTH = 250;

      // Opify
      Opify(1 / 1.25);

      // Add AI
      EAI = new EnemyAI(this);
    } else if (CLASS.equals("Shaman")) {

      // Add items
      INVENTORY.addItem(
          "Health Potion", 25, 1, "Health Pot.png", "Potion", new String[] {"Points=50"});

      // Add Ai
      NAI = new NPCAI(this);

    } else if (CLASS.equals("Dark Elf")) {

      // Add items
      INVENTORY.addItem(
          "Rusted Dagger",
          20,
          1,
          "Dagger_4.png",
          "Meele",
          new String[] {"Damage=10", "Attack Speed=1"});
      INVENTORY.addItem("Iron Helmet", 150, 1, "Head_2.png", "H_armor", new String[] {"Armor=5"});

      // Assign Stats
      STATS.LEVEL = 2;
      HEALTH = 150;
      MAX_HEALTH = 150;

      // Add Gold
      this.GOLD = (int) Math.round(Math.random() * 15 + 2);

      // Use Item
      INVENTORY.ItemEffect(0, this);
      INVENTORY.ItemEffect(1, this);

      // Add Ai
      EAI = new EnemyAI(this);

    } else if (CLASS.equals("Prisoner")) {
      INVENTORY.addItem("Key", 0, 1, "Key.png", "Key", new String[] {});
      // NAI= new NPCAI(this);
    }
  }