Search in sources :

Example 36 with Level

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);
}
Also used : Level(com.watabou.pixeldungeon.levels.Level)

Example 37 with Level

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;
}
Also used : Char(com.watabou.pixeldungeon.actors.Char) Pushing(com.watabou.pixeldungeon.effects.Pushing) Level(com.watabou.pixeldungeon.levels.Level)

Aggregations

Level (com.watabou.pixeldungeon.levels.Level)37 Mob (com.watabou.pixeldungeon.actors.mobs.Mob)7 Char (com.watabou.pixeldungeon.actors.Char)5 DeadEndLevel (com.watabou.pixeldungeon.levels.DeadEndLevel)5 LevelObject (com.nyrds.pixeldungeon.levels.objects.LevelObject)4 Pushing (com.watabou.pixeldungeon.effects.Pushing)4 IceCavesLevel (com.nyrds.pixeldungeon.levels.IceCavesLevel)3 NecroLevel (com.nyrds.pixeldungeon.levels.NecroLevel)3 Position (com.nyrds.pixeldungeon.utils.Position)3 Heap (com.watabou.pixeldungeon.items.Heap)3 CavesBossLevel (com.watabou.pixeldungeon.levels.CavesBossLevel)3 CavesLevel (com.watabou.pixeldungeon.levels.CavesLevel)3 CityBossLevel (com.watabou.pixeldungeon.levels.CityBossLevel)3 CityLevel (com.watabou.pixeldungeon.levels.CityLevel)3 HallsBossLevel (com.watabou.pixeldungeon.levels.HallsBossLevel)3 HallsLevel (com.watabou.pixeldungeon.levels.HallsLevel)3 LastLevel (com.watabou.pixeldungeon.levels.LastLevel)3 LastShopLevel (com.watabou.pixeldungeon.levels.LastShopLevel)3 PrisonBossLevel (com.watabou.pixeldungeon.levels.PrisonBossLevel)3 PrisonLevel (com.watabou.pixeldungeon.levels.PrisonLevel)3