use of com.watabou.pixeldungeon.items.Item in project pixel-dungeon-remix by NYRDS.
the class WndChooseWay method btnBreakSpell.
private void btnBreakSpell(RedButton btnWay1) {
RedButton btnWay2 = new RedButton(Utils.capitalize(TXT_BREAK_SPELL_BTN)) {
@Override
protected void onClick() {
hide();
Hero hero = Dungeon.hero;
Item a = hero.belongings.getItem(BlackSkullOfMastery.class);
a.removeItemFrom(hero);
Item b = new BlackSkull();
Dungeon.level.drop(b, hero.getPos()).sprite.drop();
}
};
btnWay2.setRect(btnWay1.right() + GAP, btnWay1.top(), btnWay1.width(), BTN_HEIGHT);
add(btnWay2);
}
use of com.watabou.pixeldungeon.items.Item in project pixel-dungeon by watabou.
the class Skeleton method dropLoot.
@Override
protected void dropLoot() {
if (Random.Int(5) == 0) {
Item loot = Generator.random(Generator.Category.WEAPON);
for (int i = 0; i < 2; i++) {
Item l = Generator.random(Generator.Category.WEAPON);
if (l.level() < loot.level()) {
loot = l;
}
}
Dungeon.level.drop(loot, pos).sprite.drop();
}
}
use of com.watabou.pixeldungeon.items.Item in project pixel-dungeon by watabou.
the class Mob method dropLoot.
@SuppressWarnings("unchecked")
protected void dropLoot() {
if (loot != null && Random.Float() < lootChance) {
Item item = null;
if (loot instanceof Generator.Category) {
item = Generator.random((Generator.Category) loot);
} else if (loot instanceof Class<?>) {
item = Generator.random((Class<? extends Item>) loot);
} else {
item = (Item) loot;
}
Dungeon.level.drop(item, pos).sprite.drop();
}
}
use of com.watabou.pixeldungeon.items.Item in project pixel-dungeon by watabou.
the class Bag method collect.
@Override
public boolean collect(Bag container) {
if (super.collect(container)) {
owner = container.owner;
for (Item item : container.items.toArray(new Item[0])) {
if (grab(item)) {
item.detachAll(container);
item.collect(this);
}
}
Badges.validateAllBagsBought(this);
return true;
} else {
return false;
}
}
use of com.watabou.pixeldungeon.items.Item in project pixel-dungeon by watabou.
the class CityBossLevel method createItems.
@Override
protected void createItems() {
Item item = Bones.get();
if (item != null) {
int pos;
do {
pos = Random.IntRange(LEFT + 1, LEFT + HALL_WIDTH - 2) + Random.IntRange(TOP + HALL_HEIGHT + 1, TOP + HALL_HEIGHT + CHAMBER_HEIGHT) * WIDTH;
} while (pos == entrance || map[pos] == Terrain.SIGN);
drop(item, pos).type = Heap.Type.SKELETON;
}
}
Aggregations