Search in sources :

Example 1 with CorpseDust

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

the class MassGraveRoom method paint.

public void paint(Level level) {
    Door entrance = entrance();
    entrance.set(Door.Type.BARRICADE);
    level.addItemToSpawn(new PotionOfLiquidFlame());
    Painter.fill(level, this, Terrain.WALL);
    Painter.fill(level, this, 1, Terrain.EMPTY_SP);
    Bones b = new Bones();
    b.setRect(left + 1, top, width() - 2, height() - 1);
    level.customTiles.add(b);
    // 50% 1 skeleton, 50% 2 skeletons
    for (int i = 0; i <= Random.Int(2); i++) {
        Skeleton skele = new Skeleton();
        int pos;
        do {
            pos = level.pointToCell(random());
        } while (level.map[pos] != Terrain.EMPTY_SP || level.findMob(pos) != null);
        skele.pos = pos;
        level.mobs.add(skele);
    }
    ArrayList<Item> items = new ArrayList<>();
    // 100% corpse dust, 2x100% 1 coin, 2x30% coins, 1x60% random item, 1x30% armor
    items.add(new CorpseDust());
    items.add(new Gold(1));
    items.add(new Gold(1));
    if (Random.Float() <= 0.3f)
        items.add(new Gold());
    if (Random.Float() <= 0.3f)
        items.add(new Gold());
    if (Random.Float() <= 0.6f)
        items.add(Generator.random());
    if (Random.Float() <= 0.3f)
        items.add(Generator.randomArmor());
    for (Item item : items) {
        int pos;
        do {
            pos = level.pointToCell(random());
        } while (level.map[pos] != Terrain.EMPTY_SP || level.heaps.get(pos) != null);
        Heap h = level.drop(item, pos);
        h.type = Heap.Type.SKELETON;
    }
}
Also used : Item(com.shatteredpixel.shatteredpixeldungeon.items.Item) Gold(com.shatteredpixel.shatteredpixeldungeon.items.Gold) PotionOfLiquidFlame(com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame) ArrayList(java.util.ArrayList) Skeleton(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Skeleton) Heap(com.shatteredpixel.shatteredpixeldungeon.items.Heap) CorpseDust(com.shatteredpixel.shatteredpixeldungeon.items.quest.CorpseDust)

Aggregations

Skeleton (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Skeleton)1 Gold (com.shatteredpixel.shatteredpixeldungeon.items.Gold)1 Heap (com.shatteredpixel.shatteredpixeldungeon.items.Heap)1 Item (com.shatteredpixel.shatteredpixeldungeon.items.Item)1 PotionOfLiquidFlame (com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame)1 CorpseDust (com.shatteredpixel.shatteredpixeldungeon.items.quest.CorpseDust)1 ArrayList (java.util.ArrayList)1