Search in sources :

Example 1 with Dewdrop

use of com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop in project shattered-pixel-dungeon-gdx by 00-Evan.

the class Plant method wither.

public void wither() {
    Dungeon.level.uproot(pos);
    if (Dungeon.level.heroFOV[pos]) {
        CellEmitter.get(pos).burst(LeafParticle.GENERAL, 6);
    }
    if (Dungeon.hero.subClass == HeroSubClass.WARDEN) {
        int naturalismLevel = 0;
        SandalsOfNature.Naturalism naturalism = Dungeon.hero.buff(SandalsOfNature.Naturalism.class);
        if (naturalism != null) {
            naturalismLevel = naturalism.itemLevel() + 1;
        }
        if (Random.Int(5 - (naturalismLevel / 2)) == 0) {
            Item seed = Generator.random(Generator.Category.SEED);
            if (seed instanceof BlandfruitBush.Seed) {
                if (Random.Int(3) - Dungeon.LimitedDrops.BLANDFRUIT_SEED.count >= 0) {
                    Dungeon.level.drop(seed, pos).sprite.drop();
                    Dungeon.LimitedDrops.BLANDFRUIT_SEED.count++;
                }
            } else
                Dungeon.level.drop(seed, pos).sprite.drop();
        }
        if (Random.Int(5 - naturalismLevel) == 0) {
            Dungeon.level.drop(new Dewdrop(), pos).sprite.drop();
        }
    }
}
Also used : Item(com.shatteredpixel.shatteredpixeldungeon.items.Item) Dewdrop(com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop) SandalsOfNature(com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature)

Example 2 with Dewdrop

use of com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop in project shattered-pixel-dungeon-gdx by 00-Evan.

the class HighGrass method trample.

public static void trample(Level level, int pos, Char ch) {
    Level.set(pos, Terrain.GRASS);
    GameScene.updateMap(pos);
    int naturalismLevel = 0;
    if (ch != null) {
        SandalsOfNature.Naturalism naturalism = ch.buff(SandalsOfNature.Naturalism.class);
        if (naturalism != null) {
            if (!naturalism.isCursed()) {
                naturalismLevel = naturalism.itemLevel() + 1;
                naturalism.charge();
            } else {
                naturalismLevel = -1;
            }
        }
    }
    if (naturalismLevel >= 0) {
        // Seed, scales from 1/16 to 1/4
        if (Random.Int(16 - ((int) (naturalismLevel * 3))) == 0) {
            Item seed = Generator.random(Generator.Category.SEED);
            if (seed instanceof BlandfruitBush.Seed) {
                if (Random.Int(3) - Dungeon.LimitedDrops.BLANDFRUIT_SEED.count >= 0) {
                    level.drop(seed, pos).sprite.drop();
                    Dungeon.LimitedDrops.BLANDFRUIT_SEED.count++;
                }
            } else
                level.drop(seed, pos).sprite.drop();
        }
        // Dew, scales from 1/6 to 1/3
        if (Random.Int(24 - naturalismLevel * 3) <= 3) {
            level.drop(new Dewdrop(), pos).sprite.drop();
        }
    }
    int leaves = 4;
    if (ch instanceof Hero) {
        Hero hero = (Hero) ch;
        // Barkskin
        if (hero.subClass == HeroSubClass.WARDEN) {
            Buff.affect(ch, Barkskin.class).level(ch.HT / 3);
            leaves += 4;
        }
        // Camouflage
        if (hero.belongings.armor != null && hero.belongings.armor.hasGlyph(Camouflage.class)) {
            Buff.affect(hero, Camouflage.Camo.class).set(3 + hero.belongings.armor.level());
            leaves += 4;
        }
    }
    CellEmitter.get(pos).burst(LeafParticle.LEVEL_SPECIFIC, leaves);
    if (Dungeon.level.heroFOV[pos])
        Dungeon.observe();
}
Also used : Item(com.shatteredpixel.shatteredpixeldungeon.items.Item) Camouflage(com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Camouflage) Dewdrop(com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop) Hero(com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero) Barkskin(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin) SandalsOfNature(com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature)

Example 3 with Dewdrop

use of com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop in project shattered-pixel-dungeon-gdx by 00-Evan.

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.peek();
            if (item.doPickUp(this)) {
                heap.pickUp();
                if (item instanceof Dewdrop || item instanceof TimekeepersHourglass.sandBag || item instanceof DriedRose.Petal || item instanceof Key) {
                // Do Nothing
                } else {
                    boolean important = ((item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion) && ((Scroll) item).isKnown()) || ((item instanceof PotionOfStrength || item instanceof PotionOfMight) && ((Potion) item).isKnown());
                    if (important) {
                        GLog.p(Messages.get(this, "you_now_have", item.name()));
                    } else {
                        GLog.i(Messages.get(this, "you_now_have", item.name()));
                    }
                }
                curAction = null;
            } else {
                heap.sprite.drop();
                ready();
            }
        } else {
            ready();
        }
        return false;
    } else if (getCloser(dst)) {
        return true;
    } else {
        ready();
        return false;
    }
}
Also used : PotionOfMight(com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMight) TimekeepersHourglass(com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass) PotionOfStrength(com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength) Heap(com.shatteredpixel.shatteredpixeldungeon.items.Heap) Item(com.shatteredpixel.shatteredpixeldungeon.items.Item) WndTradeItem(com.shatteredpixel.shatteredpixeldungeon.windows.WndTradeItem) Dewdrop(com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop) ScrollOfMagicalInfusion(com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion) IronKey(com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey) SkeletonKey(com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey) GoldenKey(com.shatteredpixel.shatteredpixeldungeon.items.keys.GoldenKey) Key(com.shatteredpixel.shatteredpixeldungeon.items.keys.Key) CrystalKey(com.shatteredpixel.shatteredpixeldungeon.items.keys.CrystalKey) ScrollOfUpgrade(com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade)

Aggregations

Dewdrop (com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop)3 Item (com.shatteredpixel.shatteredpixeldungeon.items.Item)3 SandalsOfNature (com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature)2 Barkskin (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin)1 Hero (com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero)1 Heap (com.shatteredpixel.shatteredpixeldungeon.items.Heap)1 Camouflage (com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Camouflage)1 TimekeepersHourglass (com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass)1 CrystalKey (com.shatteredpixel.shatteredpixeldungeon.items.keys.CrystalKey)1 GoldenKey (com.shatteredpixel.shatteredpixeldungeon.items.keys.GoldenKey)1 IronKey (com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey)1 Key (com.shatteredpixel.shatteredpixeldungeon.items.keys.Key)1 SkeletonKey (com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey)1 PotionOfMight (com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMight)1 PotionOfStrength (com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength)1 ScrollOfMagicalInfusion (com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion)1 ScrollOfUpgrade (com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade)1 WndTradeItem (com.shatteredpixel.shatteredpixeldungeon.windows.WndTradeItem)1