Search in sources :

Example 1 with IronKey

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

the class ArmoryRoom method paint.

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

Example 2 with IronKey

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

the class PitRoom method paint.

public void paint(Level level) {
    Painter.fill(level, this, Terrain.WALL);
    Painter.fill(level, this, 1, Terrain.EMPTY);
    Door entrance = entrance();
    entrance.set(Door.Type.LOCKED);
    Point well = null;
    if (entrance.x == left) {
        well = new Point(right - 1, Random.Int(2) == 0 ? top + 1 : bottom - 1);
    } else if (entrance.x == right) {
        well = new Point(left + 1, Random.Int(2) == 0 ? top + 1 : bottom - 1);
    } else if (entrance.y == top) {
        well = new Point(Random.Int(2) == 0 ? left + 1 : right - 1, bottom - 1);
    } else if (entrance.y == bottom) {
        well = new Point(Random.Int(2) == 0 ? left + 1 : right - 1, top + 1);
    }
    Painter.set(level, well, Terrain.EMPTY_WELL);
    int remains = level.pointToCell(random());
    while (level.map[remains] == Terrain.EMPTY_WELL) {
        remains = level.pointToCell(random());
    }
    level.drop(new IronKey(Dungeon.depth), remains).type = Heap.Type.SKELETON;
    Item mainLoot = null;
    do {
        switch(Random.Int(3)) {
            case 0:
                mainLoot = Generator.random(Generator.Category.RING);
                break;
            case 1:
                mainLoot = Generator.random(Generator.Category.ARTIFACT);
                break;
            case 2:
                mainLoot = Generator.random(Random.oneOf(Generator.Category.WEAPON, Generator.Category.ARMOR));
                break;
        }
    } while (mainLoot == null || Challenges.isItemBlocked(mainLoot));
    level.drop(mainLoot, remains);
    int n = Random.IntRange(1, 2);
    for (int i = 0; i < n; i++) {
        level.drop(prize(level), remains);
    }
}
Also used : Item(com.shatteredpixel.shatteredpixeldungeon.items.Item) IronKey(com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey) Point(com.watabou.utils.Point) Point(com.watabou.utils.Point)

Example 3 with IronKey

use of com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey 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)

Example 4 with IronKey

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

the class StatueRoom method paint.

public void paint(Level level) {
    Painter.fill(level, this, Terrain.WALL);
    Painter.fill(level, this, 1, Terrain.EMPTY);
    Point c = center();
    int cx = c.x;
    int cy = c.y;
    Door door = entrance();
    door.set(Door.Type.LOCKED);
    level.addItemToSpawn(new IronKey(Dungeon.depth));
    if (door.x == left) {
        Painter.fill(level, right - 1, top + 1, 1, height() - 2, Terrain.STATUE);
        cx = right - 2;
    } else if (door.x == right) {
        Painter.fill(level, left + 1, top + 1, 1, height() - 2, Terrain.STATUE);
        cx = left + 2;
    } else if (door.y == top) {
        Painter.fill(level, left + 1, bottom - 1, width() - 2, 1, Terrain.STATUE);
        cy = bottom - 2;
    } else if (door.y == bottom) {
        Painter.fill(level, left + 1, top + 1, width() - 2, 1, Terrain.STATUE);
        cy = top + 2;
    }
    Statue statue = new Statue();
    statue.pos = cx + cy * level.width();
    level.mobs.add(statue);
}
Also used : Statue(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Statue) IronKey(com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey) Point(com.watabou.utils.Point) Point(com.watabou.utils.Point)

Example 5 with IronKey

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

the class VaultRoom method paint.

public void paint(Level level) {
    Painter.fill(level, this, Terrain.WALL);
    Painter.fill(level, this, 1, Terrain.EMPTY_SP);
    Painter.fill(level, this, 2, Terrain.EMPTY);
    int cx = (left + right) / 2;
    int cy = (top + bottom) / 2;
    int c = cx + cy * level.width();
    Random.shuffle(prizeClasses);
    Item i1, i2;
    i1 = prize(level);
    i2 = prize(level);
    level.drop(i1, c).type = Heap.Type.CRYSTAL_CHEST;
    level.drop(i2, c + PathFinder.NEIGHBOURS8[Random.Int(8)]).type = Heap.Type.CRYSTAL_CHEST;
    level.addItemToSpawn(new CrystalKey(Dungeon.depth));
    entrance().set(Door.Type.LOCKED);
    level.addItemToSpawn(new IronKey(Dungeon.depth));
}
Also used : Item(com.shatteredpixel.shatteredpixeldungeon.items.Item) CrystalKey(com.shatteredpixel.shatteredpixeldungeon.items.keys.CrystalKey) IronKey(com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey)

Aggregations

IronKey (com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey)13 Point (com.watabou.utils.Point)5 Item (com.shatteredpixel.shatteredpixeldungeon.items.Item)4 SkeletonKey (com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey)3 Heap (com.shatteredpixel.shatteredpixeldungeon.items.Heap)2 CrystalKey (com.shatteredpixel.shatteredpixeldungeon.items.keys.CrystalKey)2 GoldenKey (com.shatteredpixel.shatteredpixeldungeon.items.keys.GoldenKey)2 Alchemy (com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Alchemy)1 RotHeart (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RotHeart)1 RotLasher (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RotLasher)1 Statue (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Statue)1 Gold (com.shatteredpixel.shatteredpixeldungeon.items.Gold)1 ScrollOfIdentify (com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify)1 ScrollOfRemoveCurse (com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse)1