use of com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Skeleton in project shattered-pixel-dungeon-gdx by 00-Evan.
the class MassGraveRoom method paint.
public void paint(Level level) {
Door entrance = entrance();
entrance.set(Door.Type.BARRICADE);
level.addItemToSpawn(new PotionOfLiquidFlame());
Painter.fill(level, this, Terrain.WALL);
Painter.fill(level, this, 1, Terrain.EMPTY_SP);
Bones b = new Bones();
b.setRect(left + 1, top, width() - 2, height() - 1);
level.customTiles.add(b);
// 50% 1 skeleton, 50% 2 skeletons
for (int i = 0; i <= Random.Int(2); i++) {
Skeleton skele = new Skeleton();
int pos;
do {
pos = level.pointToCell(random());
} while (level.map[pos] != Terrain.EMPTY_SP || level.findMob(pos) != null);
skele.pos = pos;
level.mobs.add(skele);
}
ArrayList<Item> items = new ArrayList<>();
// 100% corpse dust, 2x100% 1 coin, 2x30% coins, 1x60% random item, 1x30% armor
items.add(new CorpseDust());
items.add(new Gold(1));
items.add(new Gold(1));
if (Random.Float() <= 0.3f)
items.add(new Gold());
if (Random.Float() <= 0.3f)
items.add(new Gold());
if (Random.Float() <= 0.6f)
items.add(Generator.random());
if (Random.Float() <= 0.3f)
items.add(Generator.randomArmor());
for (Item item : items) {
int pos;
do {
pos = level.pointToCell(random());
} while (level.map[pos] != Terrain.EMPTY_SP || level.heaps.get(pos) != null);
Heap h = level.drop(item, pos);
h.type = Heap.Type.SKELETON;
}
}
Aggregations