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());
}
}
}
Aggregations