Search in sources :

Example 1 with Level

use of com.watabou.pixeldungeon.levels.Level in project pixel-dungeon by watabou.

the class InterlevelScene method fall.

private void fall() throws Exception {
    Actor.fixTime();
    Dungeon.saveLevel();
    Level level;
    if (Dungeon.depth >= Statistics.deepestFloor) {
        level = Dungeon.newLevel();
    } else {
        Dungeon.depth++;
        level = Dungeon.loadLevel(Dungeon.hero.heroClass);
    }
    Dungeon.switchLevel(level, fallIntoPit ? level.pitCell() : level.randomRespawnCell());
}
Also used : Level(com.watabou.pixeldungeon.levels.Level)

Example 2 with Level

use of com.watabou.pixeldungeon.levels.Level in project pixel-dungeon by watabou.

the class InterlevelScene method returnTo.

private void returnTo() throws Exception {
    Actor.fixTime();
    Dungeon.saveLevel();
    Dungeon.depth = returnDepth;
    Level level = Dungeon.loadLevel(Dungeon.hero.heroClass);
    Dungeon.switchLevel(level, Level.resizingNeeded ? level.adjustPos(returnPos) : returnPos);
}
Also used : Level(com.watabou.pixeldungeon.levels.Level)

Example 3 with Level

use of com.watabou.pixeldungeon.levels.Level in project pixel-dungeon by watabou.

the class Dungeon method newLevel.

public static Level newLevel() {
    Dungeon.level = null;
    Actor.clear();
    depth++;
    if (depth > Statistics.deepestFloor) {
        Statistics.deepestFloor = depth;
        if (Statistics.qualifiedForNoKilling) {
            Statistics.completedWithNoKilling = true;
        } else {
            Statistics.completedWithNoKilling = false;
        }
    }
    Arrays.fill(visible, false);
    Level level;
    switch(depth) {
        case 1:
        case 2:
        case 3:
        case 4:
            level = new SewerLevel();
            break;
        case 5:
            level = new SewerBossLevel();
            break;
        case 6:
        case 7:
        case 8:
        case 9:
            level = new PrisonLevel();
            break;
        case 10:
            level = new PrisonBossLevel();
            break;
        case 11:
        case 12:
        case 13:
        case 14:
            level = new CavesLevel();
            break;
        case 15:
            level = new CavesBossLevel();
            break;
        case 16:
        case 17:
        case 18:
        case 19:
            level = new CityLevel();
            break;
        case 20:
            level = new CityBossLevel();
            break;
        case 21:
            level = new LastShopLevel();
            break;
        case 22:
        case 23:
        case 24:
            level = new HallsLevel();
            break;
        case 25:
            level = new HallsBossLevel();
            break;
        case 26:
            level = new LastLevel();
            break;
        default:
            level = new DeadEndLevel();
            Statistics.deepestFloor--;
    }
    level.create();
    Statistics.qualifiedForNoKilling = !bossLevel();
    return level;
}
Also used : CityBossLevel(com.watabou.pixeldungeon.levels.CityBossLevel) SewerLevel(com.watabou.pixeldungeon.levels.SewerLevel) SewerBossLevel(com.watabou.pixeldungeon.levels.SewerBossLevel) CityLevel(com.watabou.pixeldungeon.levels.CityLevel) CavesBossLevel(com.watabou.pixeldungeon.levels.CavesBossLevel) PrisonBossLevel(com.watabou.pixeldungeon.levels.PrisonBossLevel) LastShopLevel(com.watabou.pixeldungeon.levels.LastShopLevel) LastLevel(com.watabou.pixeldungeon.levels.LastLevel) PrisonLevel(com.watabou.pixeldungeon.levels.PrisonLevel) DeadEndLevel(com.watabou.pixeldungeon.levels.DeadEndLevel) PrisonLevel(com.watabou.pixeldungeon.levels.PrisonLevel) HallsBossLevel(com.watabou.pixeldungeon.levels.HallsBossLevel) CavesBossLevel(com.watabou.pixeldungeon.levels.CavesBossLevel) DeadEndLevel(com.watabou.pixeldungeon.levels.DeadEndLevel) LastLevel(com.watabou.pixeldungeon.levels.LastLevel) CityLevel(com.watabou.pixeldungeon.levels.CityLevel) LastShopLevel(com.watabou.pixeldungeon.levels.LastShopLevel) CavesLevel(com.watabou.pixeldungeon.levels.CavesLevel) SewerBossLevel(com.watabou.pixeldungeon.levels.SewerBossLevel) PrisonBossLevel(com.watabou.pixeldungeon.levels.PrisonBossLevel) Level(com.watabou.pixeldungeon.levels.Level) SewerLevel(com.watabou.pixeldungeon.levels.SewerLevel) CityBossLevel(com.watabou.pixeldungeon.levels.CityBossLevel) HallsLevel(com.watabou.pixeldungeon.levels.HallsLevel) HallsLevel(com.watabou.pixeldungeon.levels.HallsLevel) CavesLevel(com.watabou.pixeldungeon.levels.CavesLevel) HallsBossLevel(com.watabou.pixeldungeon.levels.HallsBossLevel)

Example 4 with Level

use of com.watabou.pixeldungeon.levels.Level in project pixel-dungeon by watabou.

the class Dungeon method loadLevel.

public static Level loadLevel(HeroClass cl) throws IOException {
    Dungeon.level = null;
    Actor.clear();
    InputStream input = Game.instance.openFileInput(Utils.format(depthFile(cl), depth));
    Bundle bundle = Bundle.read(input);
    input.close();
    return (Level) bundle.get("level");
}
Also used : InputStream(java.io.InputStream) Bundle(com.watabou.utils.Bundle) PrisonLevel(com.watabou.pixeldungeon.levels.PrisonLevel) HallsBossLevel(com.watabou.pixeldungeon.levels.HallsBossLevel) CavesBossLevel(com.watabou.pixeldungeon.levels.CavesBossLevel) DeadEndLevel(com.watabou.pixeldungeon.levels.DeadEndLevel) LastLevel(com.watabou.pixeldungeon.levels.LastLevel) CityLevel(com.watabou.pixeldungeon.levels.CityLevel) LastShopLevel(com.watabou.pixeldungeon.levels.LastShopLevel) CavesLevel(com.watabou.pixeldungeon.levels.CavesLevel) SewerBossLevel(com.watabou.pixeldungeon.levels.SewerBossLevel) PrisonBossLevel(com.watabou.pixeldungeon.levels.PrisonBossLevel) Level(com.watabou.pixeldungeon.levels.Level) SewerLevel(com.watabou.pixeldungeon.levels.SewerLevel) CityBossLevel(com.watabou.pixeldungeon.levels.CityBossLevel) HallsLevel(com.watabou.pixeldungeon.levels.HallsLevel)

Example 5 with Level

use of com.watabou.pixeldungeon.levels.Level in project pixel-dungeon by watabou.

the class InterlevelScene method descend.

private void descend() throws Exception {
    Actor.fixTime();
    if (Dungeon.hero == null) {
        Dungeon.init();
        if (noStory) {
            Dungeon.chapters.add(WndStory.ID_SEWERS);
            noStory = false;
        }
        GameLog.wipe();
    } else {
        Dungeon.saveLevel();
    }
    Level level;
    if (Dungeon.depth >= Statistics.deepestFloor) {
        level = Dungeon.newLevel();
    } else {
        Dungeon.depth++;
        level = Dungeon.loadLevel(Dungeon.hero.heroClass);
    }
    Dungeon.switchLevel(level, level.entrance);
}
Also used : Level(com.watabou.pixeldungeon.levels.Level)

Aggregations

Level (com.watabou.pixeldungeon.levels.Level)8 CavesBossLevel (com.watabou.pixeldungeon.levels.CavesBossLevel)2 CavesLevel (com.watabou.pixeldungeon.levels.CavesLevel)2 CityBossLevel (com.watabou.pixeldungeon.levels.CityBossLevel)2 CityLevel (com.watabou.pixeldungeon.levels.CityLevel)2 DeadEndLevel (com.watabou.pixeldungeon.levels.DeadEndLevel)2 HallsBossLevel (com.watabou.pixeldungeon.levels.HallsBossLevel)2 HallsLevel (com.watabou.pixeldungeon.levels.HallsLevel)2 LastLevel (com.watabou.pixeldungeon.levels.LastLevel)2 LastShopLevel (com.watabou.pixeldungeon.levels.LastShopLevel)2 PrisonBossLevel (com.watabou.pixeldungeon.levels.PrisonBossLevel)2 PrisonLevel (com.watabou.pixeldungeon.levels.PrisonLevel)2 SewerBossLevel (com.watabou.pixeldungeon.levels.SewerBossLevel)2 SewerLevel (com.watabou.pixeldungeon.levels.SewerLevel)2 Bundle (com.watabou.utils.Bundle)1 InputStream (java.io.InputStream)1