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