use of com.watabou.pixeldungeon.levels.Level in project pixel-dungeon-remix by NYRDS.
the class King method getCloser.
@Override
protected boolean getCloser(int target) {
Level level = Dungeon.level;
int x = level.cellX(getPos());
int y = level.cellY(getPos());
targetPedestal = level.getNearestTerrain(x, y, Terrain.PEDESTAL, lastPedestal);
if (canTryToSummon()) {
return super.getCloser(targetPedestal);
}
return super.getCloser(target);
}
use of com.watabou.pixeldungeon.levels.Level in project pixel-dungeon-remix by NYRDS.
the class Mimic method spawnAt.
public static Mimic spawnAt(int pos, List<Item> items) {
Level level = Dungeon.level;
Char ch = Actor.findChar(pos);
if (ch != null) {
int newPos = Dungeon.level.getEmptyCellNextTo(pos);
if (!Dungeon.level.cellValid(newPos)) {
Actor.addDelayed(new Pushing(ch, ch.getPos(), newPos), -1);
ch.setPos(newPos);
level.press(newPos, ch);
} else {
return null;
}
}
Mimic m = new Mimic();
m.items.addAll(items);
m.adjustStats(Dungeon.depth);
m.hp(m.ht());
m.setPos(pos);
m.setState(m.HUNTING);
level.spawnMob(m, 1);
m.getSprite().turnTo(pos, Dungeon.hero.getPos());
if (Dungeon.visible[m.getPos()]) {
CellEmitter.get(pos).burst(Speck.factory(Speck.STAR), 10);
Sample.INSTANCE.play(Assets.SND_MIMIC);
}
return m;
}
Aggregations