Search in sources :

Example 1 with Burning

use of com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning in project shattered-pixel-dungeon-gdx by 00-Evan.

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 && !(item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion)) {
            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;
        } else if (item instanceof Bomb) {
            items.remove(item);
            ((Bomb) item).explode(pos);
            // stop processing the burning, it will be replaced by the explosion.
            return;
        }
    }
    if (burnt || evaporated) {
        if (Dungeon.level.heroFOV[pos]) {
            if (burnt) {
                burnFX(pos);
            } else {
                evaporateFX(pos);
            }
        }
        if (isEmpty()) {
            destroy();
        } else if (sprite != null) {
            sprite.view(items.peek());
        }
    }
}
Also used : Mimic(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic) Scroll(com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll) ScrollOfMagicalInfusion(com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion) MysteryMeat(com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat) ScrollOfUpgrade(com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade) Burning(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning)

Aggregations

Burning (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning)1 Mimic (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic)1 MysteryMeat (com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat)1 Scroll (com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll)1 ScrollOfMagicalInfusion (com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion)1 ScrollOfUpgrade (com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade)1