Ejemplo n.º 1
0
  private void actPickUp(HeroAction.PickUp action) {
    int dst = action.dst;
    if (pos == dst) {

      Heap heap = Dungeon.level.heaps.get(pos);
      if (heap != null) {
        Item item = heap.pickUp();
        if (item.doPickUp(this)) {

          if (item instanceof Dewdrop) {

          } else {

            if ((item instanceof ScrollOfUpgrade && ((ScrollOfUpgrade) item).isKnown())
                || (item instanceof PotionOfStrength && ((PotionOfStrength) item).isKnown())) {
              GLog.p(TXT_YOU_NOW_HAVE, item.name());
            } else {
              GLog.i(TXT_YOU_NOW_HAVE, item.name());
            }
          }

          if (!heap.isEmpty()) {
            GLog.i(TXT_SOMETHING_ELSE);
          }
          curAction = null;
        } else {
          Dungeon.level.drop(item, pos).sprite.drop();
          ready();
        }
      } else {
        ready();
      }

    } else if (getCloser(dst)) {

    } else {
      ready();
    }
  }