use of com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey in project shattered-pixel-dungeon-gdx by 00-Evan.
the class ArmoryRoom method paint.
public void paint(Level level) {
Painter.fill(level, this, Terrain.WALL);
Painter.fill(level, this, 1, Terrain.EMPTY);
Door entrance = entrance();
Point statue = null;
if (entrance.x == left) {
statue = new Point(right - 1, Random.Int(2) == 0 ? top + 1 : bottom - 1);
} else if (entrance.x == right) {
statue = new Point(left + 1, Random.Int(2) == 0 ? top + 1 : bottom - 1);
} else if (entrance.y == top) {
statue = new Point(Random.Int(2) == 0 ? left + 1 : right - 1, bottom - 1);
} else if (entrance.y == bottom) {
statue = new Point(Random.Int(2) == 0 ? left + 1 : right - 1, top + 1);
}
if (statue != null) {
Painter.set(level, statue, Terrain.STATUE);
}
int n = Random.IntRange(2, 3);
for (int i = 0; i < n; i++) {
int pos;
do {
pos = level.pointToCell(random());
} while (level.map[pos] != Terrain.EMPTY || level.heaps.get(pos) != null);
level.drop(prize(level), pos);
}
entrance.set(Door.Type.LOCKED);
level.addItemToSpawn(new IronKey(Dungeon.depth));
}
use of com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey in project shattered-pixel-dungeon-gdx by 00-Evan.
the class PitRoom method paint.
public void paint(Level level) {
Painter.fill(level, this, Terrain.WALL);
Painter.fill(level, this, 1, Terrain.EMPTY);
Door entrance = entrance();
entrance.set(Door.Type.LOCKED);
Point well = null;
if (entrance.x == left) {
well = new Point(right - 1, Random.Int(2) == 0 ? top + 1 : bottom - 1);
} else if (entrance.x == right) {
well = new Point(left + 1, Random.Int(2) == 0 ? top + 1 : bottom - 1);
} else if (entrance.y == top) {
well = new Point(Random.Int(2) == 0 ? left + 1 : right - 1, bottom - 1);
} else if (entrance.y == bottom) {
well = new Point(Random.Int(2) == 0 ? left + 1 : right - 1, top + 1);
}
Painter.set(level, well, Terrain.EMPTY_WELL);
int remains = level.pointToCell(random());
while (level.map[remains] == Terrain.EMPTY_WELL) {
remains = level.pointToCell(random());
}
level.drop(new IronKey(Dungeon.depth), remains).type = Heap.Type.SKELETON;
Item mainLoot = null;
do {
switch(Random.Int(3)) {
case 0:
mainLoot = Generator.random(Generator.Category.RING);
break;
case 1:
mainLoot = Generator.random(Generator.Category.ARTIFACT);
break;
case 2:
mainLoot = Generator.random(Random.oneOf(Generator.Category.WEAPON, Generator.Category.ARMOR));
break;
}
} while (mainLoot == null || Challenges.isItemBlocked(mainLoot));
level.drop(mainLoot, remains);
int n = Random.IntRange(1, 2);
for (int i = 0; i < n; i++) {
level.drop(prize(level), remains);
}
}
use of com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey in project shattered-pixel-dungeon-gdx by 00-Evan.
the class RotGardenRoom method paint.
public void paint(Level level) {
Door entrance = entrance();
entrance.set(Door.Type.LOCKED);
level.addItemToSpawn(new IronKey(Dungeon.depth));
Painter.fill(level, this, Terrain.WALL);
Painter.fill(level, this, 1, Terrain.GRASS);
int heartX = Random.IntRange(left + 1, right - 1);
int heartY = Random.IntRange(top + 1, bottom - 1);
if (entrance.x == left) {
heartX = right - 1;
} else if (entrance.x == right) {
heartX = left + 1;
} else if (entrance.y == top) {
heartY = bottom - 1;
} else if (entrance.y == bottom) {
heartY = top + 1;
}
placePlant(level, heartX + heartY * level.width(), new RotHeart());
int lashers = ((width() - 2) * (height() - 2)) / 8;
for (int i = 1; i <= lashers; i++) {
int pos;
do {
pos = level.pointToCell(random());
} while (!validPlantPos(level, pos));
placePlant(level, pos, new RotLasher());
}
}
use of com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey in project shattered-pixel-dungeon-gdx by 00-Evan.
the class StatueRoom method paint.
public void paint(Level level) {
Painter.fill(level, this, Terrain.WALL);
Painter.fill(level, this, 1, Terrain.EMPTY);
Point c = center();
int cx = c.x;
int cy = c.y;
Door door = entrance();
door.set(Door.Type.LOCKED);
level.addItemToSpawn(new IronKey(Dungeon.depth));
if (door.x == left) {
Painter.fill(level, right - 1, top + 1, 1, height() - 2, Terrain.STATUE);
cx = right - 2;
} else if (door.x == right) {
Painter.fill(level, left + 1, top + 1, 1, height() - 2, Terrain.STATUE);
cx = left + 2;
} else if (door.y == top) {
Painter.fill(level, left + 1, bottom - 1, width() - 2, 1, Terrain.STATUE);
cy = bottom - 2;
} else if (door.y == bottom) {
Painter.fill(level, left + 1, top + 1, width() - 2, 1, Terrain.STATUE);
cy = top + 2;
}
Statue statue = new Statue();
statue.pos = cx + cy * level.width();
level.mobs.add(statue);
}
use of com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey in project shattered-pixel-dungeon-gdx by 00-Evan.
the class VaultRoom method paint.
public void paint(Level level) {
Painter.fill(level, this, Terrain.WALL);
Painter.fill(level, this, 1, Terrain.EMPTY_SP);
Painter.fill(level, this, 2, Terrain.EMPTY);
int cx = (left + right) / 2;
int cy = (top + bottom) / 2;
int c = cx + cy * level.width();
Random.shuffle(prizeClasses);
Item i1, i2;
i1 = prize(level);
i2 = prize(level);
level.drop(i1, c).type = Heap.Type.CRYSTAL_CHEST;
level.drop(i2, c + PathFinder.NEIGHBOURS8[Random.Int(8)]).type = Heap.Type.CRYSTAL_CHEST;
level.addItemToSpawn(new CrystalKey(Dungeon.depth));
entrance().set(Door.Type.LOCKED);
level.addItemToSpawn(new IronKey(Dungeon.depth));
}
Aggregations