use of com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.ExitRoom in project shattered-pixel-dungeon-gdx by 00-Evan.
the class RegularLevel method initRooms.
protected ArrayList<Room> initRooms() {
ArrayList<Room> initRooms = new ArrayList<>();
initRooms.add(roomEntrance = new EntranceRoom());
initRooms.add(roomExit = new ExitRoom());
int standards = standardRooms();
for (int i = 0; i < standards; i++) {
StandardRoom s;
do {
s = StandardRoom.createRoom();
} while (!s.setSizeCat(standards - i));
i += s.sizeCat.roomValue - 1;
initRooms.add(s);
}
if (Dungeon.shopOnLevel())
initRooms.add(new ShopRoom());
int specials = specialRooms();
SpecialRoom.initForFloor();
for (int i = 0; i < specials; i++) initRooms.add(SpecialRoom.createRoom());
int secrets = SecretRoom.secretsForFloor(Dungeon.depth);
for (int i = 0; i < secrets; i++) initRooms.add(SecretRoom.createRoom());
return initRooms;
}
use of com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.ExitRoom in project shattered-pixel-dungeon-gdx by 00-Evan.
the class RegularBuilder method setupRooms.
protected void setupRooms(ArrayList<Room> rooms) {
for (Room r : rooms) {
r.setEmpty();
}
entrance = exit = shop = null;
singleConnections.clear();
multiConnections.clear();
for (Room r : rooms) {
if (r instanceof EntranceRoom) {
entrance = r;
} else if (r instanceof ExitRoom) {
exit = r;
} else if (r instanceof ShopRoom && r.maxConnections(Room.ALL) == 1) {
shop = r;
} else if (r.maxConnections(Room.ALL) > 1) {
multiConnections.add(r);
} else if (r.maxConnections(Room.ALL) == 1) {
singleConnections.add(r);
}
}
// this weights larger rooms to be much more likely to appear in the main loop, by placing them earlier in the multiconnections list
weightRooms(multiConnections);
Random.shuffle(multiConnections);
multiConnections = new ArrayList<>(new LinkedHashSet<>(multiConnections));
}
use of com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.ExitRoom in project shattered-pixel-dungeon-gdx by 00-Evan.
the class LastShopLevel method initRooms.
@Override
protected ArrayList<Room> initRooms() {
ArrayList<Room> rooms = new ArrayList<>();
rooms.add(roomEntrance = new EntranceRoom());
rooms.add(new ImpShopRoom());
rooms.add(roomExit = new ExitRoom());
return rooms;
}
use of com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.ExitRoom in project shattered-pixel-dungeon-gdx by 00-Evan.
the class RegularLevel method restoreFromBundle.
@SuppressWarnings("unchecked")
@Override
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);
rooms = new ArrayList<>((Collection<Room>) ((Collection<?>) bundle.getCollection("rooms")));
for (Room r : rooms) {
r.onLevelLoad(this);
if (r instanceof EntranceRoom || r.legacyType.equals("ENTRANCE")) {
roomEntrance = r;
} else if (r instanceof ExitRoom || r.legacyType.equals("EXIT")) {
roomExit = r;
}
}
if (bundle.contains("mobs_to_spawn")) {
for (Class<? extends Mob> mob : bundle.getClassArray("mobs_to_spawn")) {
if (mob != null)
mobsToSpawn.add(mob);
}
}
}
Aggregations