use of com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RotHeart 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());
}
}