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