Search in sources :

Example 1 with Dewdrop

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

the class Plant method wither.

public void wither() {
    Dungeon.level.uproot(pos);
    sprite.kill();
    if (Dungeon.visible[pos]) {
        CellEmitter.get(pos).burst(LeafParticle.GENERAL, 6);
    }
    if (Dungeon.hero.subClass == HeroSubClass.WARDEN) {
        if (Random.Int(5) == 0) {
            Dungeon.level.drop(Generator.random(Generator.Category.SEED), pos).sprite.drop();
        }
        if (Random.Int(5) == 0) {
            Dungeon.level.drop(new Dewdrop(), pos).sprite.drop();
        }
    }
}
Also used : Dewdrop(com.watabou.pixeldungeon.items.Dewdrop)

Example 2 with Dewdrop

use of com.watabou.pixeldungeon.items.Dewdrop 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)

Example 3 with Dewdrop

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

the class HighGrass method trample.

public static void trample(Level level, int pos, Char ch) {
    Level.set(pos, Terrain.GRASS);
    GameScene.updateMap(pos);
    if (!Dungeon.isChallenged(Challenges.NO_HERBALISM)) {
        int herbalismLevel = 0;
        if (ch != null) {
            Herbalism herbalism = ch.buff(Herbalism.class);
            if (herbalism != null) {
                herbalismLevel = herbalism.level;
            }
        }
        // Seed
        if (herbalismLevel >= 0 && Random.Int(18) <= Random.Int(herbalismLevel + 1)) {
            level.drop(Generator.random(Generator.Category.SEED), pos).sprite.drop();
        }
        // Dew
        if (herbalismLevel >= 0 && Random.Int(6) <= Random.Int(herbalismLevel + 1)) {
            level.drop(new Dewdrop(), pos).sprite.drop();
        }
    }
    int leaves = 4;
    // Warlock's barkskin
    if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN) {
        Buff.affect(ch, Barkskin.class).level(ch.HT / 3);
        leaves = 8;
    }
    CellEmitter.get(pos).burst(LeafParticle.LEVEL_SPECIFIC, leaves);
    Dungeon.observe();
}
Also used : Dewdrop(com.watabou.pixeldungeon.items.Dewdrop) Hero(com.watabou.pixeldungeon.actors.hero.Hero) Barkskin(com.watabou.pixeldungeon.actors.buffs.Barkskin) Herbalism(com.watabou.pixeldungeon.items.rings.RingOfHerbalism.Herbalism)

Aggregations

Dewdrop (com.watabou.pixeldungeon.items.Dewdrop)3 Barkskin (com.watabou.pixeldungeon.actors.buffs.Barkskin)1 Hero (com.watabou.pixeldungeon.actors.hero.Hero)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 Herbalism (com.watabou.pixeldungeon.items.rings.RingOfHerbalism.Herbalism)1 ScrollOfEnchantment (com.watabou.pixeldungeon.items.scrolls.ScrollOfEnchantment)1 ScrollOfUpgrade (com.watabou.pixeldungeon.items.scrolls.ScrollOfUpgrade)1 WndTradeItem (com.watabou.pixeldungeon.windows.WndTradeItem)1