Search in sources :

Example 1 with Belongings

use of com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings in project shattered-pixel-dungeon-gdx by 00-Evan.

the class DistortionTrap method activate.

@Override
public void activate() {
    InterlevelScene.returnDepth = Dungeon.depth;
    Belongings belongings = Dungeon.hero.belongings;
    for (Notes.Record rec : Notes.getRecords()) {
        if (rec.depth() == Dungeon.depth) {
            Notes.remove(rec);
        }
    }
    for (Item i : belongings) {
        if (i instanceof LloydsBeacon && ((LloydsBeacon) i).returnDepth == Dungeon.depth)
            ((LloydsBeacon) i).returnDepth = -1;
    }
    InterlevelScene.mode = InterlevelScene.Mode.RESET;
    Game.switchScene(InterlevelScene.class);
}
Also used : Item(com.shatteredpixel.shatteredpixeldungeon.items.Item) Belongings(com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings) LloydsBeacon(com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon) Notes(com.shatteredpixel.shatteredpixeldungeon.journal.Notes)

Example 2 with Belongings

use of com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings in project shattered-pixel-dungeon-gdx by 00-Evan.

the class WndBag method placeItems.

protected void placeItems(Bag container) {
    // Equipped items
    Belongings stuff = Dungeon.hero.belongings;
    placeItem(stuff.weapon != null ? stuff.weapon : new Placeholder(ItemSpriteSheet.WEAPON_HOLDER));
    placeItem(stuff.armor != null ? stuff.armor : new Placeholder(ItemSpriteSheet.ARMOR_HOLDER));
    placeItem(stuff.misc1 != null ? stuff.misc1 : new Placeholder(ItemSpriteSheet.RING_HOLDER));
    placeItem(stuff.misc2 != null ? stuff.misc2 : new Placeholder(ItemSpriteSheet.RING_HOLDER));
    boolean backpack = (container == Dungeon.hero.belongings.backpack);
    if (!backpack) {
        count = nCols;
        col = 0;
        row = 1;
    }
    // Items in the bag
    for (Item item : container.items.toArray(new Item[0])) {
        placeItem(item);
    }
    // Free Space
    while (count - (backpack ? 4 : nCols) < container.size) {
        placeItem(null);
    }
}
Also used : EquipableItem(com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem) Item(com.shatteredpixel.shatteredpixeldungeon.items.Item) Belongings(com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings)

Aggregations

Belongings (com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings)2 Item (com.shatteredpixel.shatteredpixeldungeon.items.Item)2 EquipableItem (com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem)1 LloydsBeacon (com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon)1 Notes (com.shatteredpixel.shatteredpixeldungeon.journal.Notes)1