Search in sources :

Example 1 with ClassArmor

use of com.watabou.pixeldungeon.items.armor.ClassArmor in project pixel-dungeon by watabou.

the class ArmorKit method upgrade.

private void upgrade(Armor armor) {
    detach(curUser.belongings.backpack);
    curUser.sprite.centerEmitter().start(Speck.factory(Speck.KIT), 0.05f, 10);
    curUser.spend(TIME_TO_UPGRADE);
    curUser.busy();
    GLog.w(TXT_UPGRADED, armor.name());
    ClassArmor classArmor = ClassArmor.upgrade(curUser, armor);
    if (curUser.belongings.armor == armor) {
        curUser.belongings.armor = classArmor;
        ((HeroSprite) curUser.sprite).updateArmor();
    } else {
        armor.detach(curUser.belongings.backpack);
        classArmor.collect(curUser.belongings.backpack);
    }
    curUser.sprite.operate(curUser.pos);
    Sample.INSTANCE.play(Assets.SND_EVOKE);
}
Also used : ClassArmor(com.watabou.pixeldungeon.items.armor.ClassArmor) HeroSprite(com.watabou.pixeldungeon.sprites.HeroSprite)

Aggregations

ClassArmor (com.watabou.pixeldungeon.items.armor.ClassArmor)1 HeroSprite (com.watabou.pixeldungeon.sprites.HeroSprite)1