Search in sources :

Example 11 with Gold

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

the class TreasuryRoom method paint.

public void paint(Level level) {
    Painter.fill(level, this, Terrain.WALL);
    Painter.fill(level, this, 1, Terrain.EMPTY);
    Painter.set(level, center(), Terrain.STATUE);
    Heap.Type heapType = Random.Int(2) == 0 ? Heap.Type.CHEST : Heap.Type.HEAP;
    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(new Gold().random(), pos).type = (Random.Int(20) == 0 && heapType == Heap.Type.CHEST ? Heap.Type.MIMIC : heapType);
    }
    if (heapType == Heap.Type.HEAP) {
        for (int i = 0; i < 6; i++) {
            int pos;
            do {
                pos = level.pointToCell(random());
            } while (level.map[pos] != Terrain.EMPTY);
            level.drop(new Gold(Random.IntRange(5, 12)), pos);
        }
    }
    entrance().set(Door.Type.LOCKED);
    level.addItemToSpawn(new IronKey(Dungeon.depth));
}
Also used : Gold(com.shatteredpixel.shatteredpixeldungeon.items.Gold) IronKey(com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey) Heap(com.shatteredpixel.shatteredpixeldungeon.items.Heap)

Example 12 with Gold

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

the class SuspiciousChestRoom method paint.

@Override
public void paint(Level level) {
    super.paint(level);
    Item i = level.findPrizeItem();
    if (i == null) {
        i = new Gold().random();
    }
    int center = level.pointToCell(center());
    Painter.set(level, center, Terrain.PEDESTAL);
    if (Random.Int(3) == 0) {
        level.drop(i, center).type = Heap.Type.MIMIC;
    } else {
        level.drop(i, center).type = Heap.Type.CHEST;
    }
}
Also used : Item(com.shatteredpixel.shatteredpixeldungeon.items.Item) Gold(com.shatteredpixel.shatteredpixeldungeon.items.Gold)

Example 13 with Gold

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

the class WndTradeItem method sellOne.

private void sellOne(Item item) {
    if (item.quantity() <= 1) {
        sell(item);
    } else {
        Hero hero = Dungeon.hero;
        item = item.detach(hero.belongings.backpack);
        new Gold(item.price()).doPickUp(hero);
        // selling items in the sell interface doesn't spend time
        hero.spend(-hero.cooldown());
    }
}
Also used : Gold(com.shatteredpixel.shatteredpixeldungeon.items.Gold) Hero(com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero)

Aggregations

Gold (com.shatteredpixel.shatteredpixeldungeon.items.Gold)13 Item (com.shatteredpixel.shatteredpixeldungeon.items.Item)7 ArrayList (java.util.ArrayList)4 Hero (com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero)2 Heap (com.shatteredpixel.shatteredpixeldungeon.items.Heap)2 Char (com.shatteredpixel.shatteredpixeldungeon.actors.Char)1 Skeleton (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Skeleton)1 Pushing (com.shatteredpixel.shatteredpixeldungeon.effects.Pushing)1 Bomb (com.shatteredpixel.shatteredpixeldungeon.items.Bomb)1 EquipableItem (com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem)1 Honeypot (com.shatteredpixel.shatteredpixeldungeon.items.Honeypot)1 Armor (com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor)1 Artifact (com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact)1 IronKey (com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey)1 PotionOfLiquidFlame (com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame)1 CorpseDust (com.shatteredpixel.shatteredpixeldungeon.items.quest.CorpseDust)1 DisintegrationTrap (com.shatteredpixel.shatteredpixeldungeon.levels.traps.DisintegrationTrap)1 PoisonDartTrap (com.shatteredpixel.shatteredpixeldungeon.levels.traps.PoisonDartTrap)1 Bundle (com.watabou.utils.Bundle)1 Point (com.watabou.utils.Point)1