Search in sources :

Example 1 with RotLasher

use of com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RotLasher 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());
    }
}
Also used : RotHeart(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RotHeart) RotLasher(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RotLasher) IronKey(com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey)

Aggregations

RotHeart (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RotHeart)1 RotLasher (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RotLasher)1 IronKey (com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey)1