use of com.watabou.utils.Point in project pixel-dungeon by watabou.
the class AltarPainter method paint.
public static void paint(Level level, Room room) {
fill(level, room, Terrain.WALL);
fill(level, room, 1, Dungeon.bossLevel(Dungeon.depth + 1) ? Terrain.HIGH_GRASS : Terrain.CHASM);
Point c = room.center();
Room.Door door = room.entrance();
if (door.x == room.left || door.x == room.right) {
Point p = drawInside(level, room, door, Math.abs(door.x - c.x) - 2, Terrain.EMPTY_SP);
for (; p.y != c.y; p.y += p.y < c.y ? +1 : -1) {
set(level, p, Terrain.EMPTY_SP);
}
} else {
Point p = drawInside(level, room, door, Math.abs(door.y - c.y) - 2, Terrain.EMPTY_SP);
for (; p.x != c.x; p.x += p.x < c.x ? +1 : -1) {
set(level, p, Terrain.EMPTY_SP);
}
}
fill(level, c.x - 1, c.y - 1, 3, 3, Terrain.EMBERS);
set(level, c, Terrain.PEDESTAL);
SacrificialFire fire = (SacrificialFire) level.blobs.get(SacrificialFire.class);
if (fire == null) {
fire = new SacrificialFire();
}
fire.seed(c.x + c.y * Level.WIDTH, 5 + Dungeon.depth * 5);
level.blobs.put(SacrificialFire.class, fire);
door.set(Room.Door.Type.EMPTY);
}
use of com.watabou.utils.Point in project pixel-dungeon by watabou.
the class ArmoryPainter method paint.
public static void paint(Level level, Room room) {
fill(level, room, Terrain.WALL);
fill(level, room, 1, Terrain.EMPTY);
Room.Door entrance = room.entrance();
Point statue = null;
if (entrance.x == room.left) {
statue = new Point(room.right - 1, Random.Int(2) == 0 ? room.top + 1 : room.bottom - 1);
} else if (entrance.x == room.right) {
statue = new Point(room.left + 1, Random.Int(2) == 0 ? room.top + 1 : room.bottom - 1);
} else if (entrance.y == room.top) {
statue = new Point(Random.Int(2) == 0 ? room.left + 1 : room.right - 1, room.bottom - 1);
} else if (entrance.y == room.bottom) {
statue = new Point(Random.Int(2) == 0 ? room.left + 1 : room.right - 1, room.top + 1);
}
if (statue != null) {
set(level, statue, Terrain.STATUE);
}
int n = 3 + (Random.Int(4) == 0 ? 1 : 0);
for (int i = 0; i < n; i++) {
int pos;
do {
pos = room.random();
} while (level.map[pos] != Terrain.EMPTY || level.heaps.get(pos) != null);
level.drop(prize(level), pos);
}
entrance.set(Room.Door.Type.LOCKED);
level.addItemToSpawn(new IronKey());
}
use of com.watabou.utils.Point in project pixel-dungeon by watabou.
the class CryptPainter method paint.
public static void paint(Level level, Room room) {
fill(level, room, Terrain.WALL);
fill(level, room, 1, Terrain.EMPTY);
Point c = room.center();
int cx = c.x;
int cy = c.y;
Room.Door entrance = room.entrance();
entrance.set(Room.Door.Type.LOCKED);
level.addItemToSpawn(new IronKey());
if (entrance.x == room.left) {
set(level, new Point(room.right - 1, room.top + 1), Terrain.STATUE);
set(level, new Point(room.right - 1, room.bottom - 1), Terrain.STATUE);
cx = room.right - 2;
} else if (entrance.x == room.right) {
set(level, new Point(room.left + 1, room.top + 1), Terrain.STATUE);
set(level, new Point(room.left + 1, room.bottom - 1), Terrain.STATUE);
cx = room.left + 2;
} else if (entrance.y == room.top) {
set(level, new Point(room.left + 1, room.bottom - 1), Terrain.STATUE);
set(level, new Point(room.right - 1, room.bottom - 1), Terrain.STATUE);
cy = room.bottom - 2;
} else if (entrance.y == room.bottom) {
set(level, new Point(room.left + 1, room.top + 1), Terrain.STATUE);
set(level, new Point(room.right - 1, room.top + 1), Terrain.STATUE);
cy = room.top + 2;
}
level.drop(prize(level), cx + cy * Level.WIDTH).type = Type.TOMB;
}
Aggregations