Search in sources :

Example 1 with ClassArmor

use of com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor in project shattered-pixel-dungeon-gdx by 00-Evan.

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(Messages.get(this, "upgraded", armor.name()));
    ClassArmor classArmor = ClassArmor.upgrade(curUser, armor);
    if (curUser.belongings.armor == armor) {
        curUser.belongings.armor = classArmor;
        ((HeroSprite) curUser.sprite).updateArmor();
        classArmor.activate(curUser);
    } 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.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor) HeroSprite(com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite)

Aggregations

ClassArmor (com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor)1 HeroSprite (com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite)1