Search in sources :

Example 1 with Mimic

use of com.watabou.pixeldungeon.actors.mobs.Mimic in project pixel-dungeon by watabou.

the class Heap method freeze.

public void freeze() {
    if (type == Type.MIMIC) {
        Mimic m = Mimic.spawnAt(pos, items);
        if (m != null) {
            Buff.prolong(m, Frost.class, Frost.duration(m) * Random.Float(1.0f, 1.5f));
            destroy();
        }
    }
    if (type != Type.HEAP) {
        return;
    }
    boolean frozen = false;
    for (Item item : items.toArray(new Item[0])) {
        if (item instanceof MysteryMeat) {
            replace(item, FrozenCarpaccio.cook((MysteryMeat) item));
            frozen = true;
        }
    }
    if (frozen) {
        if (isEmpty()) {
            destroy();
        } else if (sprite != null) {
            sprite.view(image(), glowing());
        }
    }
}
Also used : Mimic(com.watabou.pixeldungeon.actors.mobs.Mimic) MysteryMeat(com.watabou.pixeldungeon.items.food.MysteryMeat)

Example 2 with Mimic

use of com.watabou.pixeldungeon.actors.mobs.Mimic in project pixel-dungeon by watabou.

the class ScrollOfChallenge method doRead.

@Override
protected void doRead() {
    for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
        mob.beckon(curUser.pos);
        if (Dungeon.visible[mob.pos]) {
            Buff.affect(mob, Rage.class, Level.distance(curUser.pos, mob.pos));
        }
    }
    for (Heap heap : Dungeon.level.heaps.values()) {
        if (heap.type == Heap.Type.MIMIC) {
            Mimic m = Mimic.spawnAt(heap.pos, heap.items);
            if (m != null) {
                m.beckon(curUser.pos);
                heap.destroy();
            }
        }
    }
    GLog.w("The scroll emits a challenging roar that echoes throughout the dungeon!");
    setKnown();
    curUser.sprite.centerEmitter().start(Speck.factory(Speck.SCREAM), 0.3f, 3);
    Sample.INSTANCE.play(Assets.SND_CHALLENGE);
    Invisibility.dispel();
    readAnimation();
}
Also used : Mob(com.watabou.pixeldungeon.actors.mobs.Mob) Mimic(com.watabou.pixeldungeon.actors.mobs.Mimic) Heap(com.watabou.pixeldungeon.items.Heap)

Example 3 with Mimic

use of com.watabou.pixeldungeon.actors.mobs.Mimic in project pixel-dungeon by watabou.

the class Heap method burn.

public void burn() {
    if (type == Type.MIMIC) {
        Mimic m = Mimic.spawnAt(pos, items);
        if (m != null) {
            Buff.affect(m, Burning.class).reignite(m);
            m.sprite.emitter().burst(FlameParticle.FACTORY, 5);
            destroy();
        }
    }
    if (type != Type.HEAP) {
        return;
    }
    boolean burnt = false;
    boolean evaporated = false;
    for (Item item : items.toArray(new Item[0])) {
        if (item instanceof Scroll) {
            items.remove(item);
            burnt = true;
        } else if (item instanceof Dewdrop) {
            items.remove(item);
            evaporated = true;
        } else if (item instanceof MysteryMeat) {
            replace(item, ChargrilledMeat.cook((MysteryMeat) item));
            burnt = true;
        }
    }
    if (burnt || evaporated) {
        if (Dungeon.visible[pos]) {
            if (burnt) {
                burnFX(pos);
            } else {
                evaporateFX(pos);
            }
        }
        if (isEmpty()) {
            destroy();
        } else if (sprite != null) {
            sprite.view(image(), glowing());
        }
    }
}
Also used : Mimic(com.watabou.pixeldungeon.actors.mobs.Mimic) Scroll(com.watabou.pixeldungeon.items.scrolls.Scroll) MysteryMeat(com.watabou.pixeldungeon.items.food.MysteryMeat) Burning(com.watabou.pixeldungeon.actors.buffs.Burning)

Aggregations

Mimic (com.watabou.pixeldungeon.actors.mobs.Mimic)3 MysteryMeat (com.watabou.pixeldungeon.items.food.MysteryMeat)2 Burning (com.watabou.pixeldungeon.actors.buffs.Burning)1 Mob (com.watabou.pixeldungeon.actors.mobs.Mob)1 Heap (com.watabou.pixeldungeon.items.Heap)1 Scroll (com.watabou.pixeldungeon.items.scrolls.Scroll)1