Пример #1
0
  public void resurrect(int depth) {

    for (Item item : backpack.items.toArray(new Item[0])) {
      if (item instanceof Key) {
        if (((Key) item).depth == depth) {
          item.detachAll(backpack);
        }
      } else if (item.unique) {
        // Keep unique items
      } else if (!item.isEquipped(owner)) {
        item.detachAll(backpack);
      }
    }

    if (weapon != null) {
      weapon.cursed = false;
      weapon.activate(owner);
    }

    if (armor != null) {
      armor.cursed = false;
    }

    if (misc1 != null) {
      misc1.cursed = false;
      misc1.activate(owner);
    }
    if (misc2 != null) {
      misc2.cursed = false;
      misc2.activate(owner);
    }
  }
Пример #2
0
 public void observe() {
   if (weapon != null) {
     weapon.identify();
     Badges.validateItemLevelAquired(weapon);
   }
   if (armor != null) {
     armor.identify();
     Badges.validateItemLevelAquired(armor);
   }
   if (misc1 != null) {
     misc1.identify();
     Badges.validateItemLevelAquired(misc1);
   }
   if (misc2 != null) {
     misc2.identify();
     Badges.validateItemLevelAquired(misc2);
   }
   for (Item item : backpack) {
     item.cursedKnown = true;
   }
 }
Пример #3
0
  public void restoreFromBundle(Bundle bundle) {

    backpack.clear();
    backpack.restoreFromBundle(bundle);

    weapon = (KindOfWeapon) bundle.get(WEAPON);
    if (weapon != null) {
      weapon.activate(owner);
    }

    armor = (Armor) bundle.get(ARMOR);

    misc1 = (KindofMisc) bundle.get(MISC1);
    if (misc1 != null) {
      misc1.activate(owner);
    }

    misc2 = (KindofMisc) bundle.get(MISC2);
    if (misc2 != null) {
      misc2.activate(owner);
    }
  }