use of com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.ShopRoom 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.special.ShopRoom 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));
}
Aggregations