use of com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem in project shattered-pixel-dungeon-gdx by 00-Evan.
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);
}
// prevents on-upgrade effects like enchant/glyph removal
first.level(first.level() + 1);
Dungeon.hero.spendAndNext(2f);
Badges.validateItemLevelAquired(first);
if (second.isEquipped(Dungeon.hero)) {
((EquipableItem) second).doUnequip(Dungeon.hero, false);
}
second.detachAll(Dungeon.hero.belongings.backpack);
if (second instanceof Armor) {
BrokenSeal seal = ((Armor) second).checkSeal();
if (seal != null) {
Dungeon.level.drop(seal, Dungeon.hero.pos);
}
}
Quest.reforged = true;
Notes.remove(Notes.Landmark.TROLL);
}
use of com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem in project shattered-pixel-dungeon-gdx by 00-Evan.
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);
new Gold(item.price()).doPickUp(hero);
// selling items in the sell interface doesn't spend time
hero.spend(-hero.cooldown());
}
Aggregations