Search in sources :

Example 1 with PotionOfMight

use of com.watabou.pixeldungeon.items.potions.PotionOfMight in project pixel-dungeon by watabou.

the class Hero method actPickUp.

private boolean 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) {
                // Do nothing
                } else {
                    boolean important = ((item instanceof ScrollOfUpgrade || item instanceof ScrollOfEnchantment) && ((Scroll) item).isKnown()) || ((item instanceof PotionOfStrength || item instanceof PotionOfMight) && ((Potion) item).isKnown());
                    if (important) {
                        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();
        }
        return false;
    } else if (getCloser(dst)) {
        return true;
    } else {
        ready();
        return false;
    }
}
Also used : Item(com.watabou.pixeldungeon.items.Item) WndTradeItem(com.watabou.pixeldungeon.windows.WndTradeItem) PotionOfMight(com.watabou.pixeldungeon.items.potions.PotionOfMight) ScrollOfEnchantment(com.watabou.pixeldungeon.items.scrolls.ScrollOfEnchantment) PotionOfStrength(com.watabou.pixeldungeon.items.potions.PotionOfStrength) Dewdrop(com.watabou.pixeldungeon.items.Dewdrop) Heap(com.watabou.pixeldungeon.items.Heap) ScrollOfUpgrade(com.watabou.pixeldungeon.items.scrolls.ScrollOfUpgrade)

Aggregations

Dewdrop (com.watabou.pixeldungeon.items.Dewdrop)1 Heap (com.watabou.pixeldungeon.items.Heap)1 Item (com.watabou.pixeldungeon.items.Item)1 PotionOfMight (com.watabou.pixeldungeon.items.potions.PotionOfMight)1 PotionOfStrength (com.watabou.pixeldungeon.items.potions.PotionOfStrength)1 ScrollOfEnchantment (com.watabou.pixeldungeon.items.scrolls.ScrollOfEnchantment)1 ScrollOfUpgrade (com.watabou.pixeldungeon.items.scrolls.ScrollOfUpgrade)1 WndTradeItem (com.watabou.pixeldungeon.windows.WndTradeItem)1