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));
}
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;
}
}
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());
}
}
Aggregations