Search in sources :

Example 1 with PotionOfInvisibility

use of com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfInvisibility in project shattered-pixel-dungeon-gdx by 00-Evan.

the class PoolRoom method paint.

public void paint(Level level) {
    Painter.fill(level, this, Terrain.WALL);
    Painter.fill(level, this, 1, Terrain.WATER);
    Door door = entrance();
    door.set(Door.Type.REGULAR);
    int x = -1;
    int y = -1;
    if (door.x == left) {
        x = right - 1;
        y = top + height() / 2;
        Painter.fill(level, left + 1, top + 1, 1, height() - 2, Terrain.EMPTY_SP);
    } else if (door.x == right) {
        x = left + 1;
        y = top + height() / 2;
        Painter.fill(level, right - 1, top + 1, 1, height() - 2, Terrain.EMPTY_SP);
    } else if (door.y == top) {
        x = left + width() / 2;
        y = bottom - 1;
        Painter.fill(level, left + 1, top + 1, width() - 2, 1, Terrain.EMPTY_SP);
    } else if (door.y == bottom) {
        x = left + width() / 2;
        y = top + 1;
        Painter.fill(level, left + 1, bottom - 1, width() - 2, 1, Terrain.EMPTY_SP);
    }
    int pos = x + y * level.width();
    level.drop(prize(level), pos).type = Random.Int(3) == 0 ? Heap.Type.CHEST : Heap.Type.HEAP;
    Painter.set(level, pos, Terrain.PEDESTAL);
    level.addItemToSpawn(new PotionOfInvisibility());
    for (int i = 0; i < NPIRANHAS; i++) {
        Piranha piranha = new Piranha();
        do {
            piranha.pos = level.pointToCell(random());
        } while (level.map[piranha.pos] != Terrain.WATER || level.findMob(piranha.pos) != null);
        level.mobs.add(piranha);
    }
}
Also used : PotionOfInvisibility(com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfInvisibility) Piranha(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Piranha)

Aggregations

Piranha (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Piranha)1 PotionOfInvisibility (com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfInvisibility)1