use of com.watabou.pixeldungeon.items.EquipableItem in project pixel-dungeon by watabou.
the class Blacksmith method upgrade.
public static void upgrade(Item item1, Item item2) {
Item first, second;
if (item2.level() > item1.level()) {
first = item2;
second = item1;
} else {
first = item1;
second = item2;
}
Sample.INSTANCE.play(Assets.SND_EVOKE);
ScrollOfUpgrade.upgrade(Dungeon.hero);
Item.evoke(Dungeon.hero);
if (first.isEquipped(Dungeon.hero)) {
((EquipableItem) first).doUnequip(Dungeon.hero, true);
}
first.upgrade();
GLog.p(TXT_LOOKS_BETTER, first.name());
Dungeon.hero.spendAndNext(2f);
Badges.validateItemLevelAquired(first);
if (second.isEquipped(Dungeon.hero)) {
((EquipableItem) second).doUnequip(Dungeon.hero, false);
}
second.detachAll(Dungeon.hero.belongings.backpack);
Quest.reforged = true;
Journal.remove(Journal.Feature.TROLL);
}
use of com.watabou.pixeldungeon.items.EquipableItem in project pixel-dungeon by watabou.
the class WndTradeItem method sell.
private void sell(Item item) {
Hero hero = Dungeon.hero;
if (item.isEquipped(hero) && !((EquipableItem) item).doUnequip(hero, false)) {
return;
}
item.detachAll(hero.belongings.backpack);
int price = item.price();
new Gold(price).doPickUp(hero);
GLog.i(TXT_SOLD, item.name(), price);
}
Aggregations