Search in sources :

Example 1 with Level

use of com.shatteredpixel.shatteredpixeldungeon.levels.Level in project shattered-pixel-dungeon-gdx by 00-Evan.

the class WandOfRegrowth method placePlants.

private void placePlants(float numPlants, float numDews, float numPods, float numStars) {
    Iterator<Integer> cells = affectedCells.iterator();
    Level floor = Dungeon.level;
    while (cells.hasNext() && Random.Float() <= numPlants) {
        Plant.Seed seed = (Plant.Seed) Generator.random(Generator.Category.SEED);
        if (seed instanceof BlandfruitBush.Seed) {
            if (Random.Int(3) - Dungeon.LimitedDrops.BLANDFRUIT_SEED.count >= 0) {
                floor.plant(seed, cells.next());
                Dungeon.LimitedDrops.BLANDFRUIT_SEED.count++;
            }
        } else
            floor.plant(seed, cells.next());
        numPlants--;
    }
    while (cells.hasNext() && Random.Float() <= numDews) {
        floor.plant(new Dewcatcher.Seed(), cells.next());
        numDews--;
    }
    while (cells.hasNext() && Random.Float() <= numPods) {
        floor.plant(new Seedpod.Seed(), cells.next());
        numPods--;
    }
    while (cells.hasNext() && Random.Float() <= numStars) {
        floor.plant(new Starflower.Seed(), cells.next());
        numStars--;
    }
}
Also used : Plant(com.shatteredpixel.shatteredpixeldungeon.plants.Plant) Starflower(com.shatteredpixel.shatteredpixeldungeon.plants.Starflower) Level(com.shatteredpixel.shatteredpixeldungeon.levels.Level)

Example 2 with Level

use of com.shatteredpixel.shatteredpixeldungeon.levels.Level in project shattered-pixel-dungeon-gdx by 00-Evan.

the class InterlevelScene method fall.

private void fall() throws IOException {
    Actor.fixTime();
    DriedRose.holdGhostHero(Dungeon.level);
    Dungeon.saveAll();
    Level level;
    if (Dungeon.depth >= Statistics.deepestFloor) {
        level = Dungeon.newLevel();
    } else {
        Dungeon.depth++;
        level = Dungeon.loadLevel(GamesInProgress.curSlot);
    }
    Dungeon.switchLevel(level, level.fallCell(fallIntoPit));
}
Also used : Level(com.shatteredpixel.shatteredpixeldungeon.levels.Level)

Example 3 with Level

use of com.shatteredpixel.shatteredpixeldungeon.levels.Level in project shattered-pixel-dungeon-gdx by 00-Evan.

the class InterlevelScene method resurrect.

private void resurrect() throws IOException {
    Actor.fixTime();
    DriedRose.holdGhostHero(Dungeon.level);
    if (Dungeon.level.locked) {
        Dungeon.hero.resurrect(Dungeon.depth);
        Dungeon.depth--;
        Level level = Dungeon.newLevel();
        Dungeon.switchLevel(level, level.entrance);
    } else {
        Dungeon.hero.resurrect(-1);
        Dungeon.resetLevel();
    }
}
Also used : Level(com.shatteredpixel.shatteredpixeldungeon.levels.Level)

Example 4 with Level

use of com.shatteredpixel.shatteredpixeldungeon.levels.Level in project shattered-pixel-dungeon-gdx by 00-Evan.

the class InterlevelScene method descend.

private void descend() throws IOException {
    Actor.fixTime();
    if (Dungeon.hero == null) {
        DriedRose.clearHeldGhostHero();
        Dungeon.init();
        if (noStory) {
            Dungeon.chapters.add(WndStory.ID_SEWERS);
            noStory = false;
        }
        GameLog.wipe();
    } else {
        DriedRose.holdGhostHero(Dungeon.level);
        Dungeon.saveAll();
    }
    Level level;
    if (Dungeon.depth >= Statistics.deepestFloor) {
        level = Dungeon.newLevel();
    } else {
        Dungeon.depth++;
        level = Dungeon.loadLevel(GamesInProgress.curSlot);
    }
    Dungeon.switchLevel(level, level.entrance);
}
Also used : Level(com.shatteredpixel.shatteredpixeldungeon.levels.Level)

Example 5 with Level

use of com.shatteredpixel.shatteredpixeldungeon.levels.Level in project shattered-pixel-dungeon-gdx by 00-Evan.

the class InterlevelScene method ascend.

private void ascend() throws IOException {
    Actor.fixTime();
    DriedRose.holdGhostHero(Dungeon.level);
    Dungeon.saveAll();
    Dungeon.depth--;
    Level level = Dungeon.loadLevel(GamesInProgress.curSlot);
    Dungeon.switchLevel(level, level.exit);
}
Also used : Level(com.shatteredpixel.shatteredpixeldungeon.levels.Level)

Aggregations

Level (com.shatteredpixel.shatteredpixeldungeon.levels.Level)11 PrisonBossLevel (com.shatteredpixel.shatteredpixeldungeon.levels.PrisonBossLevel)3 CavesBossLevel (com.shatteredpixel.shatteredpixeldungeon.levels.CavesBossLevel)2 CavesLevel (com.shatteredpixel.shatteredpixeldungeon.levels.CavesLevel)2 CityBossLevel (com.shatteredpixel.shatteredpixeldungeon.levels.CityBossLevel)2 CityLevel (com.shatteredpixel.shatteredpixeldungeon.levels.CityLevel)2 DeadEndLevel (com.shatteredpixel.shatteredpixeldungeon.levels.DeadEndLevel)2 HallsBossLevel (com.shatteredpixel.shatteredpixeldungeon.levels.HallsBossLevel)2 HallsLevel (com.shatteredpixel.shatteredpixeldungeon.levels.HallsLevel)2 LastLevel (com.shatteredpixel.shatteredpixeldungeon.levels.LastLevel)2 LastShopLevel (com.shatteredpixel.shatteredpixeldungeon.levels.LastShopLevel)2 PrisonLevel (com.shatteredpixel.shatteredpixeldungeon.levels.PrisonLevel)2 SewerBossLevel (com.shatteredpixel.shatteredpixeldungeon.levels.SewerBossLevel)2 SewerLevel (com.shatteredpixel.shatteredpixeldungeon.levels.SewerLevel)2 GrippingTrap (com.shatteredpixel.shatteredpixeldungeon.levels.traps.GrippingTrap)1 Plant (com.shatteredpixel.shatteredpixeldungeon.plants.Plant)1 Starflower (com.shatteredpixel.shatteredpixeldungeon.plants.Starflower)1 Bundle (com.watabou.utils.Bundle)1 IOException (java.io.IOException)1