use of com.watabou.pixeldungeon.items.keys.IronKey in project pixel-dungeon by watabou.
the class StatuePainter 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 door = room.entrance();
door.set(Room.Door.Type.LOCKED);
level.addItemToSpawn(new IronKey());
if (door.x == room.left) {
fill(level, room.right - 1, room.top + 1, 1, room.height() - 1, Terrain.STATUE);
cx = room.right - 2;
} else if (door.x == room.right) {
fill(level, room.left + 1, room.top + 1, 1, room.height() - 1, Terrain.STATUE);
cx = room.left + 2;
} else if (door.y == room.top) {
fill(level, room.left + 1, room.bottom - 1, room.width() - 1, 1, Terrain.STATUE);
cy = room.bottom - 2;
} else if (door.y == room.bottom) {
fill(level, room.left + 1, room.top + 1, room.width() - 1, 1, Terrain.STATUE);
cy = room.top + 2;
}
Statue statue = new Statue();
statue.pos = cx + cy * Level.WIDTH;
level.mobs.add(statue);
Actor.occupyCell(statue);
}
use of com.watabou.pixeldungeon.items.keys.IronKey in project pixel-dungeon by watabou.
the class TreasuryPainter method paint.
public static void paint(Level level, Room room) {
fill(level, room, Terrain.WALL);
fill(level, room, 1, Terrain.EMPTY);
set(level, room.center(), Terrain.STATUE);
Heap.Type heapType = Random.Int(2) == 0 ? Heap.Type.CHEST : Heap.Type.HEAP;
int n = Random.IntRange(2, 3);
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(new Gold().random(), pos).type = (i == 0 && heapType == Heap.Type.CHEST ? Heap.Type.MIMIC : heapType);
}
if (heapType == Heap.Type.HEAP) {
for (int i = 0; i < 6; i++) {
int pos;
do {
pos = room.random();
} while (level.map[pos] != Terrain.EMPTY);
level.drop(new Gold(Random.IntRange(1, 3)), pos);
}
}
room.entrance().set(Room.Door.Type.LOCKED);
level.addItemToSpawn(new IronKey());
}
use of com.watabou.pixeldungeon.items.keys.IronKey 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.pixeldungeon.items.keys.IronKey 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