use of com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room in project shattered-pixel-dungeon-gdx by 00-Evan.
the class RegularPainter method paintGrass.
protected void paintGrass(Level l, ArrayList<Room> rooms) {
boolean[] grass = Patch.generate(l.width(), l.height(), grassFill, grassSmoothness, true);
ArrayList<Integer> grassCells = new ArrayList<>();
if (!rooms.isEmpty()) {
for (Room r : rooms) {
for (Point p : r.grassPlaceablePoints()) {
int i = l.pointToCell(p);
if (grass[i] && l.map[i] == Terrain.EMPTY) {
grassCells.add(i);
}
}
}
} else {
for (int i = 0; i < l.length(); i++) {
if (grass[i] && l.map[i] == Terrain.EMPTY) {
grassCells.add(i);
}
}
}
// low smoothing, or very low fill, will begin to push the ratio down, normally to 50-30%
for (int i : grassCells) {
if (l.heaps.get(i) != null || l.findMob(i) != null) {
l.map[i] = Terrain.GRASS;
continue;
}
int count = 1;
for (int n : PathFinder.NEIGHBOURS8) {
if (grass[i + n]) {
count++;
}
}
l.map[i] = (Random.Float() < count / 12f) ? Terrain.HIGH_GRASS : Terrain.GRASS;
}
}
use of com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room in project shattered-pixel-dungeon-gdx by 00-Evan.
the class SewerBossLevel method createMobs.
@Override
protected void createMobs() {
Goo boss = new Goo();
Room room;
do {
room = randomRoom(StandardRoom.class);
} while (room == roomEntrance);
boss.pos = pointToCell(room.random());
mobs.add(boss);
}
use of com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room in project shattered-pixel-dungeon-gdx by 00-Evan.
the class SewerBossLevel method initRooms.
@Override
protected ArrayList<Room> initRooms() {
ArrayList<Room> initRooms = new ArrayList<>();
initRooms.add(roomEntrance = roomExit = new SewerBossEntranceRoom());
int standards = standardRooms();
for (int i = 0; i < standards; i++) {
initRooms.add(new EmptyRoom());
}
initRooms.add(new RatKingRoom());
return initRooms;
}
use of com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room 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.Room in project shattered-pixel-dungeon-gdx by 00-Evan.
the class WalkwayRoom method paint.
@Override
public void paint(Level level) {
if (Math.min(width(), height()) > 3) {
Painter.fill(level, this, 1, Terrain.CHASM);
}
super.paint(level);
for (Room r : neigbours) {
if (r instanceof BridgeRoom || r instanceof RingBridgeRoom || r instanceof WalkwayRoom) {
Rect i = intersect(r);
if (i.width() != 0) {
i.left++;
i.right--;
} else {
i.top++;
i.bottom--;
}
Painter.fill(level, i.left, i.top, i.width() + 1, i.height() + 1, Terrain.CHASM);
}
}
}
Aggregations