Search in sources :

Example 16 with Point

use of com.watabou.utils.Point in project pixel-dungeon by watabou.

the class AltarPainter method paint.

public static void paint(Level level, Room room) {
    fill(level, room, Terrain.WALL);
    fill(level, room, 1, Dungeon.bossLevel(Dungeon.depth + 1) ? Terrain.HIGH_GRASS : Terrain.CHASM);
    Point c = room.center();
    Room.Door door = room.entrance();
    if (door.x == room.left || door.x == room.right) {
        Point p = drawInside(level, room, door, Math.abs(door.x - c.x) - 2, Terrain.EMPTY_SP);
        for (; p.y != c.y; p.y += p.y < c.y ? +1 : -1) {
            set(level, p, Terrain.EMPTY_SP);
        }
    } else {
        Point p = drawInside(level, room, door, Math.abs(door.y - c.y) - 2, Terrain.EMPTY_SP);
        for (; p.x != c.x; p.x += p.x < c.x ? +1 : -1) {
            set(level, p, Terrain.EMPTY_SP);
        }
    }
    fill(level, c.x - 1, c.y - 1, 3, 3, Terrain.EMBERS);
    set(level, c, Terrain.PEDESTAL);
    SacrificialFire fire = (SacrificialFire) level.blobs.get(SacrificialFire.class);
    if (fire == null) {
        fire = new SacrificialFire();
    }
    fire.seed(c.x + c.y * Level.WIDTH, 5 + Dungeon.depth * 5);
    level.blobs.put(SacrificialFire.class, fire);
    door.set(Room.Door.Type.EMPTY);
}
Also used : SacrificialFire(com.watabou.pixeldungeon.actors.blobs.SacrificialFire) Point(com.watabou.utils.Point) Room(com.watabou.pixeldungeon.levels.Room)

Example 17 with Point

use of com.watabou.utils.Point in project pixel-dungeon by watabou.

the class ArmoryPainter method paint.

public static void paint(Level level, Room room) {
    fill(level, room, Terrain.WALL);
    fill(level, room, 1, Terrain.EMPTY);
    Room.Door entrance = room.entrance();
    Point statue = null;
    if (entrance.x == room.left) {
        statue = new Point(room.right - 1, Random.Int(2) == 0 ? room.top + 1 : room.bottom - 1);
    } else if (entrance.x == room.right) {
        statue = new Point(room.left + 1, Random.Int(2) == 0 ? room.top + 1 : room.bottom - 1);
    } else if (entrance.y == room.top) {
        statue = new Point(Random.Int(2) == 0 ? room.left + 1 : room.right - 1, room.bottom - 1);
    } else if (entrance.y == room.bottom) {
        statue = new Point(Random.Int(2) == 0 ? room.left + 1 : room.right - 1, room.top + 1);
    }
    if (statue != null) {
        set(level, statue, Terrain.STATUE);
    }
    int n = 3 + (Random.Int(4) == 0 ? 1 : 0);
    for (int i = 0; i < n; i++) {
        int pos;
        do {
            pos = room.random();
        } while (level.map[pos] != Terrain.EMPTY || level.heaps.get(pos) != null);
        level.drop(prize(level), pos);
    }
    entrance.set(Room.Door.Type.LOCKED);
    level.addItemToSpawn(new IronKey());
}
Also used : IronKey(com.watabou.pixeldungeon.items.keys.IronKey) Point(com.watabou.utils.Point) Room(com.watabou.pixeldungeon.levels.Room) Point(com.watabou.utils.Point)

Example 18 with Point

use of com.watabou.utils.Point in project pixel-dungeon by watabou.

the class CryptPainter method paint.

public static void paint(Level level, Room room) {
    fill(level, room, Terrain.WALL);
    fill(level, room, 1, Terrain.EMPTY);
    Point c = room.center();
    int cx = c.x;
    int cy = c.y;
    Room.Door entrance = room.entrance();
    entrance.set(Room.Door.Type.LOCKED);
    level.addItemToSpawn(new IronKey());
    if (entrance.x == room.left) {
        set(level, new Point(room.right - 1, room.top + 1), Terrain.STATUE);
        set(level, new Point(room.right - 1, room.bottom - 1), Terrain.STATUE);
        cx = room.right - 2;
    } else if (entrance.x == room.right) {
        set(level, new Point(room.left + 1, room.top + 1), Terrain.STATUE);
        set(level, new Point(room.left + 1, room.bottom - 1), Terrain.STATUE);
        cx = room.left + 2;
    } else if (entrance.y == room.top) {
        set(level, new Point(room.left + 1, room.bottom - 1), Terrain.STATUE);
        set(level, new Point(room.right - 1, room.bottom - 1), Terrain.STATUE);
        cy = room.bottom - 2;
    } else if (entrance.y == room.bottom) {
        set(level, new Point(room.left + 1, room.top + 1), Terrain.STATUE);
        set(level, new Point(room.right - 1, room.top + 1), Terrain.STATUE);
        cy = room.top + 2;
    }
    level.drop(prize(level), cx + cy * Level.WIDTH).type = Type.TOMB;
}
Also used : IronKey(com.watabou.pixeldungeon.items.keys.IronKey) Point(com.watabou.utils.Point) Room(com.watabou.pixeldungeon.levels.Room) Point(com.watabou.utils.Point)

Aggregations

Point (com.watabou.utils.Point)18 Room (com.watabou.pixeldungeon.levels.Room)11 IronKey (com.watabou.pixeldungeon.items.keys.IronKey)6 Camera (com.watabou.noosa.Camera)2 Touch (com.watabou.input.Touchscreen.Touch)1 ColorBlock (com.watabou.noosa.ColorBlock)1 Group (com.watabou.noosa.Group)1 Image (com.watabou.noosa.Image)1 TouchArea (com.watabou.noosa.TouchArea)1 Alchemy (com.watabou.pixeldungeon.actors.blobs.Alchemy)1 SacrificialFire (com.watabou.pixeldungeon.actors.blobs.SacrificialFire)1 WellWater (com.watabou.pixeldungeon.actors.blobs.WellWater)1 Statue (com.watabou.pixeldungeon.actors.mobs.Statue)1 Item (com.watabou.pixeldungeon.items.Item)1 Archs (com.watabou.pixeldungeon.ui.Archs)1 RedButton (com.watabou.pixeldungeon.ui.RedButton)1 ArrayList (java.util.ArrayList)1