Exemple #1
0
 public void setOffhand(Item<?> secondHand) {
   try {
     if (secondHand.is(Shield.class)) {
       setShield(secondHand);
       setWand(null);
     } else if (secondHand.is(WandWeapon.class)) {
       setWand(secondHand);
       setShield(null);
     } else {
       setShield(null);
       setWand(null);
     }
   } catch (NullPointerException e) {
     Logger.getLogger(Equipment.class).error("Player has wrong item");
   }
 }
Exemple #2
0
  public void setShoulderMount(Item<?> shoulderMount) {

    if (shoulderMount == null) {
      setSpecialWeapon(null);
      setMantle(null);
      setWings(null);
    } else if (shoulderMount.is(SlayerWeapon.class)) {
      setMantle(null);
      setWings(null);
      setSpecialWeapon(shoulderMount);
    } else if (shoulderMount.is(HeavyWeapon.class)) {
      setMantle(null);
      setWings(null);
      setSpecialWeapon(shoulderMount);
    } else if (shoulderMount.is(Mantle.class)) {
      setSpecialWeapon(null);
      setWings(null);
      setMantle(shoulderMount);
    } else if (shoulderMount.is(Wing.class)) {
      setSpecialWeapon(null);
      setMantle(null);
      setWings(shoulderMount);
    }
  }
Exemple #3
0
 private void setWings(Item<?> wings) {
   if (wings != null && !wings.is(Wing.class)) {
     throw new IllegalArgumentException();
   }
   this.wings = wings;
 }
Exemple #4
0
 private void setWand(Item<?> wand) {
   if (wand != null && !wand.is(WandWeapon.class)) {
     throw new IllegalArgumentException();
   }
   this.wand = wand;
 }
Exemple #5
0
 private void setSpecialWeapon(Item<?> specialWeapon) {
   if (specialWeapon != null && !specialWeapon.is(SpecialWeapon.class)) {
     throw new IllegalArgumentException();
   }
   this.specialWeapon = specialWeapon;
 }
Exemple #6
0
 private void setShield(Item<?> shield) {
   if (shield != null && !shield.is(Shield.class)) {
     throw new IllegalArgumentException();
   }
   this.shield = shield;
 }
Exemple #7
0
 public void setPants(Item<?> pants) {
   if (pants != null && !pants.is(Armor.class)) {
     throw new IllegalArgumentException();
   }
   this.pants = pants;
 }
Exemple #8
0
 public void setRing(Item<?> ring) {
   if (ring != null && !ring.is(Ring.class)) {
     throw new IllegalArgumentException();
   }
   this.ring = ring;
 }
Exemple #9
0
 private void setMantle(Item<?> mantle) {
   if (mantle != null && !mantle.is(Mantle.class)) {
     throw new IllegalArgumentException();
   }
   this.mantle = mantle;
 }
Exemple #10
0
 public void setNecklace(Item<?> necklace) {
   if (necklace != null && !necklace.is(Necklace.class)) {
     throw new IllegalArgumentException();
   }
   this.necklace = necklace;
 }
Exemple #11
0
 public void setHelmet(Item<?> helmet) {
   if (helmet != null && !helmet.is(Armor.class)) {
     throw new IllegalArgumentException();
   }
   this.helmet = helmet;
 }
Exemple #12
0
 public void setMainhand(Item<?> weapon) {
   if (weapon != null && !weapon.is(Weapon.class)) {
     throw new IllegalArgumentException();
   }
   this.weapon = weapon;
 }
Exemple #13
0
 public void setBracelet(Item<?> bracelet) {
   if (bracelet != null && !bracelet.is(Bracelet.class)) {
     throw new IllegalArgumentException();
   }
   this.bracelet = bracelet;
 }
Exemple #14
0
 public void setBoots(Item<?> boots) {
   if (boots != null && !boots.is(Armor.class)) {
     throw new IllegalArgumentException();
   }
   this.boots = boots;
 }
Exemple #15
0
 public void setArmor(Item<?> armor) {
   if (armor != null && !armor.is(Armor.class)) {
     throw new IllegalArgumentException();
   }
   this.armor = armor;
 }